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, (interaction) => {
|
||||||
veluna.discord.on(Events.InteractionCreate, async(interaction) => {
|
|
||||||
if (!interaction.inCachedGuild()) {
|
if (!interaction.inCachedGuild()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (interaction.isButton()) {
|
if (interaction.isButton()) {
|
||||||
await handleButton(veluna, interaction);
|
void handleButton(veluna, interaction);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (interaction.isModalSubmit()) {
|
if (interaction.isModalSubmit()) {
|
||||||
await handleModalSubmit(veluna, interaction);
|
void handleModalSubmit(veluna, interaction);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (interaction.isChatInputCommand()) {
|
if (interaction.isChatInputCommand()) {
|
||||||
await handleChatCommand(veluna, interaction);
|
void handleChatCommand(veluna, interaction);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -104,4 +104,8 @@ export const handleChatCommand = async(
|
|||||||
serverId: guild.id,
|
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