Fix /reset crashing sometimes

This commit is contained in:
Christopher Cookman 2023-03-11 12:04:13 -07:00
parent dd5d426c94
commit 042a63ca0a
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -67,6 +67,10 @@ client.on('interactionCreate', async (interaction) => {
switch (interaction.commandName) {
case "reset":
// Remove the session
if (!sessions[interaction.channelId]) return interaction.reply({
ephemeral: true,
content: lang.empty
});
if (!sessions[interaction.channelId].processing) {
await resetSession(interaction.channelId);
interaction.reply(lang.reset);