Add response for non-authorized channels using slash commands
This commit is contained in:
parent
042a63ca0a
commit
4f54e6c3a8
2
index.js
2
index.js
|
@ -63,7 +63,7 @@ client.on("ready", () => {
|
||||||
|
|
||||||
client.on('interactionCreate', async (interaction) => {
|
client.on('interactionCreate', async (interaction) => {
|
||||||
if (!interaction.isCommand()) return;
|
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) {
|
switch (interaction.commandName) {
|
||||||
case "reset":
|
case "reset":
|
||||||
// Remove the session
|
// Remove the session
|
||||||
|
|
Loading…
Reference in a new issue