Fix session reset commands

This commit is contained in:
Christopher Cookman 2023-03-09 08:30:14 -07:00
parent 5c1841472a
commit 127a02e8f2
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -56,11 +56,10 @@ client.on("ready", () => {
client.on('interactionCreate', async (interaction) => {
if (!interaction.isCommand()) return;
if (!config.discord.authorized_channels.includes(interaction.channelId)) return; // Only allow messages in the authorized channels
if (!config.discord.authorized_channels.includes(interaction.channelId) && !config.discord.authorized_channels.includes(interaction.channel.parentId)) return; // Only allow messages in the authorized channels
switch (interaction.commandName) {
case "reset":
// Remove the session
console.log(`${colors.cyan("[INFO]")} Resetting session for ${colors.green(interaction.channelId)} (${interaction.channel.name})}`)
await delete sessions[interaction.channelId];
interaction.reply(lang.reset);
break;