right import + good name of columns in table + commentary + 2 methods
This commit is contained in:
parent
99765c7b9e
commit
c296bb35a9
1 changed files with 14 additions and 3 deletions
|
@ -1,7 +1,8 @@
|
||||||
from db import Database
|
from utils.db import Database
|
||||||
|
|
||||||
class Reminder(Database):
|
class Reminder(Database):
|
||||||
def creationTable(self):
|
def creationTable(self):
|
||||||
|
"""Créer la table qui stocker les reminders"""
|
||||||
requete = """
|
requete = """
|
||||||
CREATE TABLE IF NOT EXISTS reminder (
|
CREATE TABLE IF NOT EXISTS reminder (
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
|
@ -9,7 +10,7 @@ class Reminder(Database):
|
||||||
channel_id INTEGER,
|
channel_id INTEGER,
|
||||||
mention_bool INTEGER,
|
mention_bool INTEGER,
|
||||||
reminder_str TEXT,
|
reminder_str TEXT,
|
||||||
creation_str INTEGER,
|
creation_int INTEGER,
|
||||||
expiration_int INTEGER,
|
expiration_int INTEGER,
|
||||||
user_id INTEGER
|
user_id INTEGER
|
||||||
);
|
);
|
||||||
|
@ -17,9 +18,10 @@ class Reminder(Database):
|
||||||
self.requete(requete)
|
self.requete(requete)
|
||||||
|
|
||||||
def ajoutReminder(self, guildID, channelID, mention, reminder, creation, expiration, userID):
|
def ajoutReminder(self, guildID, channelID, mention, reminder, creation, expiration, userID):
|
||||||
|
"""Ajoute un reminder"""
|
||||||
requete = """
|
requete = """
|
||||||
INSERT INTO reminder (
|
INSERT INTO reminder (
|
||||||
guild_id, channel_id, mention_bool, reminder_str, creation_str, expiration_int, user_id
|
guild_id, channel_id, mention_bool, reminder_str, creation_int, expiration_int, user_id
|
||||||
) VALUES (
|
) VALUES (
|
||||||
?, ?, ?, ?, ?, ?, ?
|
?, ?, ?, ?, ?, ?, ?
|
||||||
);
|
);
|
||||||
|
@ -27,8 +29,17 @@ class Reminder(Database):
|
||||||
self.requete(requete, (guildID, channelID, mention, reminder, creation, expiration, userID))
|
self.requete(requete, (guildID, channelID, mention, reminder, creation, expiration, userID))
|
||||||
|
|
||||||
def suppressionReminder(self, id):
|
def suppressionReminder(self, id):
|
||||||
|
"""Supprime un reminder"""
|
||||||
requete = """
|
requete = """
|
||||||
DELETE FROM reminder
|
DELETE FROM reminder
|
||||||
WHERE id = ?
|
WHERE id = ?
|
||||||
"""
|
"""
|
||||||
self.requete(requete, id)
|
self.requete(requete, id)
|
||||||
|
|
||||||
|
def listeReminder(self, userID = None):
|
||||||
|
"""Retourne la liste des reminders, si un userID est mentionné, retourne la liste de cet utilisateur"""
|
||||||
|
return
|
||||||
|
|
||||||
|
def recuperationReminder(self, id):
|
||||||
|
"""Récupère les informations d'un reminder"""
|
||||||
|
return
|
||||||
|
|
Reference in a new issue