Add warning command

This commit is contained in:
Tarrgon
2025-05-29 09:36:59 -04:00
parent 2f21c07d1f
commit 1e39b151b1
13 changed files with 281 additions and 20 deletions
+6 -5
View File
@@ -1,5 +1,5 @@
import 'source-map-support/register';
import { Client as DiscordClient, GatewayIntentBits, Guild, Partials } from 'discord.js';
import { Client as DiscordClient, GatewayIntentBits, Guild, MessageFlags, Partials } from 'discord.js';
import { config } from './config';
import { Handler } from './types';
import { initIfNecessary, loadHandlersFrom, openRedisClient, refreshCommands } from './utils';
@@ -52,7 +52,7 @@ client.on('interactionCreate', async (interaction) => {
)
interaction.reply({
content: 'Bot is still starting up. Please wait a few seconds.',
ephemeral: true,
flags: [MessageFlags.Ephemeral],
});
return;
@@ -84,7 +84,7 @@ client.on('interactionCreate', async (interaction) => {
for (const button of buttons) {
if (id == button.name) {
button.handler(client, interaction, interaction.customId.split('_')[1]);
button.handler(client, interaction, ...interaction.customId.split('_').slice(1));
return;
}
}
@@ -94,7 +94,7 @@ client.on('interactionCreate', async (interaction) => {
for (const modal of modals) {
if (id == modal.name) {
modal.handler(client, interaction, interaction.customId.split('_')[1]);
modal.handler(client, interaction, ...interaction.customId.split('_').slice(1));
return;
}
}
@@ -104,7 +104,7 @@ client.on('interactionCreate', async (interaction) => {
for (const menu of menus) {
if (id == menu.name) {
menu.handler(client, interaction, interaction.customId.split('_')[1]);
menu.handler(client, interaction, ...interaction.customId.split('_').slice(1));
return;
}
}
@@ -151,5 +151,6 @@ client.on('threadCreate', handleThreadCreate);
client.on('voiceStateUpdate', handleVoiceStateUpdate);
client.on('error', console.error);
process.on('uncaughtException', console.error);
client.login(config.DISCORD_TOKEN);