adding reminder class

This commit is contained in:
Mylloon 2021-06-03 11:41:51 +02:00
parent 6624e36a85
commit 13a1b23724

34
src/utils/reminder.py Normal file
View 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)