From 56be762445d135abc470e5a774ed361353a22ba4 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 29 Jul 2021 01:52:21 +0200 Subject: [PATCH] force value instead of making them as default --- src/utils/reminder.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/reminder.py b/src/utils/reminder.py index 659ac21..9145ccd 100644 --- a/src/utils/reminder.py +++ b/src/utils/reminder.py @@ -21,7 +21,7 @@ class Reminder(Database): """ self.requete(requete) - def ajoutReminder(self, messageID = int, channelID = int, extrarg = int, reminder = str, creation = int, expiration = int, userID = int, guildID = int): + def ajoutReminder(self, messageID: int, channelID: int, extrarg: int, reminder: str, creation: int, expiration: int, userID: int, guildID: int): """Ajoute un reminder.""" requete = """ INSERT INTO reminder ( @@ -33,7 +33,7 @@ class Reminder(Database): self.requete(requete, [messageID, channelID, extrarg, reminder, creation, expiration, userID, guildID]) return self.affichageResultat(self.requete("SELECT last_insert_rowid();")) - def suppressionReminder(self, id = int): + def suppressionReminder(self, id: int): """Supprime un reminder.""" requete = """ DELETE FROM reminder @@ -41,7 +41,7 @@ class Reminder(Database): """ self.requete(requete, id) - def listeReminder(self, userID = int, guildID = int): + def listeReminder(self, userID: int, guildID: int): """Retourne la liste des reminders d'un utilisateur.""" requete = """ SELECT reminder_str, creation_int, expiration_int, id FROM reminder @@ -49,7 +49,7 @@ class Reminder(Database): """ return self.affichageResultat(self.requete(requete, [userID, guildID])) - def recuperationExpiration(self, time = int): + def recuperationExpiration(self, time: int): """Récupère les reminders qui sont arrivés à expiration et ses infos.""" requete = """ SELECT channel_id, extrarg_id, reminder_str, creation_int, user_id, id, message_id FROM reminder @@ -57,7 +57,7 @@ class Reminder(Database): """ return self.affichageResultat(self.requete(requete, time)) - def appartenanceReminder(self, user = int, id = int, guildID = int): + def appartenanceReminder(self, userID: int, id: int, guildID: int): """Vérifie qu'un rappel appartiens à un utilisateur et que la guilde soit la bonne. Renvois False si le rappel n'existe pas.""" requete = """ SELECT EXISTS ( @@ -65,4 +65,4 @@ class Reminder(Database): WHERE id = ? AND user_id = ? AND (guild_id = ? OR guild_id = 0) ) """ - return True if self.affichageResultat(self.requete(requete, [id, user, guildID]))[0][0] == 1 else False + return True if self.affichageResultat(self.requete(requete, [id, userID, guildID]))[0][0] == 1 else False