feat: Reminders #44

Merged
Anri merged 54 commits from feat/reminders into main 2023-01-17 12:15:15 +01:00
Showing only changes of commit 0bdd2af66e - Show all commits

View file

@ -27,9 +27,9 @@ export default async () => {
console.log('Translations progression :');
client.locales = await loadLocales(client.config.default_lang);
client.db = new Database(`${
process.env.DOCKERIZED === '1' ? '/config' : './config'
}/db.sqlite3`);
client.db = new Database(`${process.env.DOCKERIZED === '1' ? '/config' : './config'}/db.sqlite3`);
initDatabase(client.db);
return client;
};
@ -41,3 +41,19 @@ export const quit = (client: Client) => {
// Close client
client.destroy();
};
const initDatabase = (db: Database) => {
// Table for reminders
db.run('CREATE TABLE IF NOT EXISTS reminder ( \
id INTEGER PRIMARY KEY, \
data TEXT, \
expiration_date INTEGER, \
message_id INTEGER, \
option_id INTEGER, \
channel_id INTEGER, \
creation_date INTEGER, \
user_id INTEGER, \
guild_id INTEGER \
);');
};