adding reminder class
This commit is contained in:
parent
6624e36a85
commit
13a1b23724
1 changed files with 34 additions and 0 deletions
34
src/utils/reminder.py
Normal file
34
src/utils/reminder.py
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
from db import Database
|
||||||
|
|
||||||
|
class Reminder(Database):
|
||||||
|
def creationTable(self):
|
||||||
|
requete = """
|
||||||
|
CREATE TABLE IF NOT EXISTS reminder (
|
||||||
|
id INTEGER PRIMARY KEY,
|
||||||
|
guild_id INTEGER,
|
||||||
|
channel_id INTEGER,
|
||||||
|
mention_bool INTEGER,
|
||||||
|
reminder_str TEXT,
|
||||||
|
creation_str INTEGER,
|
||||||
|
expiration_int INTEGER,
|
||||||
|
user_id INTEGER
|
||||||
|
);
|
||||||
|
"""
|
||||||
|
self.requete(requete)
|
||||||
|
|
||||||
|
def ajoutReminder(self, guildID, channelID, mention, reminder, creation, expiration, userID):
|
||||||
|
requete = """
|
||||||
|
INSERT INTO reminder (
|
||||||
|
guild_id, channel_id, mention_bool, reminder_str, creation_str, expiration_int, user_id
|
||||||
|
) VALUES (
|
||||||
|
?, ?, ?, ?, ?, ?, ?
|
||||||
|
);
|
||||||
|
"""
|
||||||
|
self.requete(requete, (guildID, channelID, mention, reminder, creation, expiration, userID))
|
||||||
|
|
||||||
|
def suppressionReminder(self, id):
|
||||||
|
requete = """
|
||||||
|
DELETE FROM reminder
|
||||||
|
WHERE id = ?
|
||||||
|
"""
|
||||||
|
self.requete(requete, id)
|
Reference in a new issue