Add "breaks" functionality to bot. #1

Merged
contrastellar merged 23 commits from gabby-dev into main 2025-10-17 17:53:55 +00:00
Showing only changes of commit 26276b0989 - Show all commits

View File

@@ -166,6 +166,23 @@ class DBHelper():
return return
def remove_break(self, user_id: int, start_date: datetime.date) -> None:
"""Remove a callout based on user + date, which form the primary key in the db
Args:
user_id (int): The Discord UUID of the user removing something from the db
callout (datetime.datetime): The date of the callout
"""
self.__CONN = connect_config(self._config)
self.__CONN.autocommit = True
cursor = self.__CONN.cursor()
cursor.execute("DELETE FROM breaks WHERE created_user = %s AND open_range = %s", (user_id, start_date))
self.__CONN.commit()
return
def formatted_list_of_callouts(self, callouts: list) -> str: def formatted_list_of_callouts(self, callouts: list) -> str:
"""Format the python list of callouts. """Format the python list of callouts.