From 92661ea575c5ce666804db2596a8955cdb0f12e6 Mon Sep 17 00:00:00 2001 From: "Ean Milligan (Bastion)" Date: Thu, 8 Sep 2022 00:46:53 -0400 Subject: [PATCH] Start work on raid checkpoint channel cleaner --- config.example.ts | 3 ++- src/events/messageCreate.ts | 26 +++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/config.example.ts b/config.example.ts index 8c766b4..bc82651 100644 --- a/config.example.ts +++ b/config.example.ts @@ -1,6 +1,6 @@ export const config = { 'name': 'Sweeper Bot', // Name of the bot - 'version': '0.2.3', // Version of the bot + 'version': '0.2.4', // Version of the bot 'token': 'the_bot_token', // Discord API Token for this bot 'localtoken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS MUST BE DIFFERENT FROM "token" 'prefix': 's!', // Prefix for all commands @@ -17,6 +17,7 @@ export const config = { 'devServer': 0n, // Discord guild ID where testing of indev features/commands will be handled, used in conjuction with the DEVMODE bool in mod.ts 'ownerId': 0n, // Discord user ID of the bot owner 'pollChannels': [], // List of Discord channel IDs that are to be managed by the pollReaction system + 'raidCheckpointChannel': [], // List of Discord channel IDs that are to be managed by the cleanRaidCheckpoints system }; export default config; diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 4d2cff5..709788d 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -28,6 +28,10 @@ export const messageCreate = async (bot: Bot, message: Message) => { functions.pollReactions(bot, message); } + if (config.raidCheckpointChannel.includes(message.channelId)) { + console.log(message); + } + // return as we are done handling this command return; } @@ -77,17 +81,17 @@ export const messageCreate = async (bot: Bot, message: Message) => { commands.sendMessage(bot, message, args); } break; - case 'test': - const test = await bot.helpers.getMessage(413640605491658754n, 1016090989816987701n); - console.log(test) - if (test.reactions && test.reactions.length) { - console.log(test.reactions[0]) - const what = `${test.reactions[0].emoji.name}${test.reactions[0].emoji.id ? `:${test.reactions[0].emoji.id}` : ''}`; - console.log(what) - await getReactions(bot, 413640605491658754n, 1016090989816987701n, what) - } - // bot.helpers - break; + // case 'test': + // const test = await bot.helpers.getMessage(413640605491658754n, 1016090989816987701n); + // console.log(test) + // if (test.reactions && test.reactions.length) { + // console.log(test.reactions[0]) + // const what = `${test.reactions[0].emoji.name}${test.reactions[0].emoji.id ? `:${test.reactions[0].emoji.id}` : ''}`; + // console.log(what) + // await getReactions(bot, 413640605491658754n, 1016090989816987701n, what) + // } + // // bot.helpers + // break; default: // Non-standard commands console.log(`${command} WIP`);