Refactor interaction handling to remove unused commands and ensure proper command execution for 'gif'
This commit is contained in:
10
src/bot.ts
10
src/bot.ts
@@ -34,12 +34,8 @@ client.on(Events.ClientReady, (readyClient) => {
|
||||
client.on(Events.InteractionCreate, async (interaction) => {
|
||||
// messagehandler(interaction.command)
|
||||
if (!interaction.isChatInputCommand()) return;
|
||||
|
||||
if (interaction.commandName === "ping") {
|
||||
await interaction.reply("pong");
|
||||
}
|
||||
if (interaction.commandName === "pong") {
|
||||
// if (interaction.options.getString("something something"))
|
||||
if (interaction.commandName === "gif") {
|
||||
await commands.execute(interaction)
|
||||
}
|
||||
});
|
||||
|
||||
@@ -80,7 +76,7 @@ try {
|
||||
await rest.put(
|
||||
Routes.applicationCommands(client.application.id),
|
||||
{
|
||||
body: [commands],
|
||||
body: [commands.data.toJSON()],
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user