generated from nhcarrigan/template
fix: no misuse promises, actually respond to interaction
Node.js CI / Lint and Test (push) Successful in 56s
Node.js CI / Lint and Test (push) Successful in 56s
This commit is contained in:
+4
-7
@@ -27,21 +27,18 @@ veluna.discord.once(Events.ClientReady, () => {
|
||||
);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises -- Top-level await.
|
||||
veluna.discord.on(Events.InteractionCreate, async(interaction) => {
|
||||
veluna.discord.on(Events.InteractionCreate, (interaction) => {
|
||||
if (!interaction.inCachedGuild()) {
|
||||
return;
|
||||
}
|
||||
if (interaction.isButton()) {
|
||||
await handleButton(veluna, interaction);
|
||||
return;
|
||||
void handleButton(veluna, interaction);
|
||||
}
|
||||
if (interaction.isModalSubmit()) {
|
||||
await handleModalSubmit(veluna, interaction);
|
||||
return;
|
||||
void handleModalSubmit(veluna, interaction);
|
||||
}
|
||||
if (interaction.isChatInputCommand()) {
|
||||
await handleChatCommand(veluna, interaction);
|
||||
void handleChatCommand(veluna, interaction);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -104,4 +104,8 @@ export const handleChatCommand = async(
|
||||
serverId: guild.id,
|
||||
},
|
||||
});
|
||||
|
||||
await interaction.editReply({
|
||||
content: `This server's ${commandName} channel has been set to <#${channel.id}>.`,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user