slim down constants
This commit is contained in:
parent
e095aeef11
commit
0aaee0e0f1
3 changed files with 2 additions and 35 deletions
|
@ -40,13 +40,13 @@ import 'dotenv/config';
|
||||||
|
|
||||||
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN!);
|
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: [],
|
body: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('Successfully deleted all application commands.');
|
console.log('Successfully deleted all application commands.');
|
||||||
|
|
||||||
await rest.put(Routes.applicationCommands('977174139297230888'), {
|
await rest.put(Routes.applicationCommands(process.env.DISCORD_APP!), {
|
||||||
body: commands,
|
body: commands,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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_REGEX = /\beta\b/i;
|
||||||
export const ETA_MESSAGES = [
|
export const ETA_MESSAGES = [
|
||||||
'Sometime',
|
'Sometime',
|
||||||
|
|
27
src/index.ts
27
src/index.ts
|
@ -83,20 +83,6 @@ client.once('ready', async () => {
|
||||||
|
|
||||||
if (e.author === client.user) return;
|
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)) {
|
if (e.cleanContent.match(BuildConfig.ETA_REGEX)) {
|
||||||
await e.reply(
|
await e.reply(
|
||||||
`${random(BuildConfig.ETA_MESSAGES)} <:pofat:964546613194420294>`
|
`${random(BuildConfig.ETA_MESSAGES)} <:pofat:964546613194420294>`
|
||||||
|
@ -114,19 +100,6 @@ client.once('ready', async () => {
|
||||||
client.on('interactionCreate', async (interaction) => {
|
client.on('interactionCreate', async (interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return;
|
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;
|
const { commandName } = interaction;
|
||||||
|
|
||||||
if (commandName === 'ping') {
|
if (commandName === 'ping') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue