feat: Reminders #44
1 changed files with 19 additions and 3 deletions
|
@ -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 \
|
||||
);');
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue