From 0aaee0e0f140a7107c764440421632e5e86a0b63 Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Mon, 29 Aug 2022 11:31:15 +0800 Subject: [PATCH] slim down constants --- src/_reupload.ts | 4 ++-- src/constants.ts | 6 ------ src/index.ts | 27 --------------------------- 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/src/_reupload.ts b/src/_reupload.ts index f91627f..cdb102c 100644 --- a/src/_reupload.ts +++ b/src/_reupload.ts @@ -40,13 +40,13 @@ import 'dotenv/config'; const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN!); - await rest.put(Routes.applicationCommands('977174139297230888'), { + await rest.put(Routes.applicationCommands(process.env.DISCORD_APP!), { body: [], }); console.log('Successfully deleted all application commands.'); - await rest.put(Routes.applicationCommands('977174139297230888'), { + await rest.put(Routes.applicationCommands(process.env.DISCORD_APP!), { body: commands, }); diff --git a/src/constants.ts b/src/constants.ts index 86e49e9..62eaba7 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,9 +1,3 @@ -export const GUILD_ID = '923671181020766230'; -export const DEBUG_CHANNEL_ID = '977401259260788756'; -export const POLYCAT_CHANNEL_ID = '977797790749032448'; - -export const DM_TESTERS = ['952235800110694471']; - export const ETA_REGEX = /\beta\b/i; export const ETA_MESSAGES = [ 'Sometime', diff --git a/src/index.ts b/src/index.ts index f11f761..6acd8e1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -83,20 +83,6 @@ client.once('ready', async () => { if (e.author === client.user) return; - if ( - process.env.NODE_ENV === 'development' && - e.channelId !== BuildConfig.DEBUG_CHANNEL_ID && - e.channel.type === ChannelType.DM && - !BuildConfig.DM_TESTERS.includes(e.author.id) - ) { - return; - } else if ( - process.env.NODE_ENV !== 'development' && - e.channelId === BuildConfig.DEBUG_CHANNEL_ID - ) { - return; - } - if (e.cleanContent.match(BuildConfig.ETA_REGEX)) { await e.reply( `${random(BuildConfig.ETA_MESSAGES)} <:pofat:964546613194420294>` @@ -114,19 +100,6 @@ client.once('ready', async () => { client.on('interactionCreate', async (interaction) => { if (!interaction.isChatInputCommand()) return; - if ( - process.env.NODE_ENV === 'development' && - interaction.channelId !== BuildConfig.DEBUG_CHANNEL_ID - ) { - return; - } - if ( - process.env.NODE_ENV !== 'development' && - interaction.channelId === BuildConfig.DEBUG_CHANNEL_ID - ) { - return; - } - const { commandName } = interaction; if (commandName === 'ping') {