diff --git a/db/initialize.ts b/db/initialize.ts index 279219b..94e1471 100644 --- a/db/initialize.ts +++ b/db/initialize.ts @@ -13,6 +13,7 @@ console.log('Attempt to drop all tables'); await dbClient.execute(`DROP PROCEDURE IF EXISTS INC_CNT;`); await dbClient.execute(`DROP TABLE IF EXISTS command_cnt;`); await dbClient.execute(`DROP TABLE IF EXISTS guild_settings;`); +await dbClient.execute(`DROP TABLE IF EXISTS active_event;`); console.log('Tables dropped'); console.log('Attempting to create table command_cnt'); @@ -51,5 +52,20 @@ await dbClient.execute(` `); console.log('Table created'); +console.log('Attempting to create table active_event'); +await dbClient.execute(` + CREATE TABLE active_event ( + messageId bigint unsigned NOT NULL, + channelId bigint unsigned NOT NULL, + guildId bigint unsigned NOT NULL, + ownerId bigint unsigned NOT NULL, + eventTime timestamp NOT NULL, + notifiedFlag tinyint(1) NOT NULL DEFAULT 0, + lockedFlag tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (messageId, channelId) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +`); +console.log('Table created'); + await dbClient.close(); console.log('Done!'); diff --git a/src/buttons/_index.ts b/src/buttons/_index.ts index 246e34e..e4b7dd6 100644 --- a/src/buttons/_index.ts +++ b/src/buttons/_index.ts @@ -1,7 +1,8 @@ import { Button } from '../types/commandTypes.ts'; -import { createEventButton } from './event-creation/step1-gameSelection.ts'; +import { gameSelectionButton } from './event-creation/step1-gameSelection.ts'; import { createCustomEventButton } from './event-creation/step1a-openCustomModal.ts'; import { verifyCustomEventButton } from './event-creation/step1b-verifyCustomActivity.ts'; import { finalizeEventButton } from './event-creation/step2-finalize.ts'; +import { createEventButton } from './event-creation/step3-createEvent.ts'; -export const buttons: Array