Add response for non-authorized channels using slash commands

This commit is contained in:
Christopher Cookman 2023-03-11 12:10:58 -07:00
parent 042a63ca0a
commit 4f54e6c3a8
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42
2 changed files with 3 additions and 2 deletions

View file

@ -63,7 +63,7 @@ client.on("ready", () => {
client.on('interactionCreate', async (interaction) => {
if (!interaction.isCommand()) return;
if (!config.discord.authorized_channels.includes(interaction.channelId) && !config.discord.authorized_channels.includes(interaction.channel.parentId)) 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 interaction.reply({ephemeral: true, content: lang.noauth}); // Only allow messages in the authorized channels
switch (interaction.commandName) {
case "reset":
// Remove the session

View file

@ -18,5 +18,6 @@
"color": 16711680
}]
},
"busy": "The bot is busy right now. Please try again later."
"busy": "The bot is busy right now. Please try again later.",
"noauth": "This is not an authorized channel."
}