This command allows users with the MANAGE_CHANNELS permission to disable all slash commands (except for built-in ones) in a given channel. Staff will still be able to use the commands but not normal members. This is very useful in raid situations or if you just want to have one specific bot commands channel. To set up, go to the Slash Command Builder and make a diablecommands command, then to use just do: /disablecommands. IF YOU NEED HELP SETTING UP, you can ping @Zeno in the Autocode Discord for support. Hope you enjoy! You can find the Enable commands twin snippet here: https://autocode.com/snippet/TheZeno/cachsnpt_w83VUVPMyYZwPQ5JnMwV6LkMFYZswEy1Rjqt/
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let isMANAGE_CHANNELS =
(context.params.event.member.permissions & (1 << 4)) === 1 << 4;
if (isMANAGE_CHANNELS) {
let message = context.params.event.content;
await lib.discord.channels['@0.1.1'].permissions.update({
overwrite_id: `${context.params.event.guild_id}`,
channel_id: `${context.params.event.channel_id}`,
deny: `${1 << 31}`,
type: 0,
});
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `**<@${context.params.event.member.user.id}> - Disabled Commands In - <#${context.params.event.channel_id}>**`,
});
} else {
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `**<@${context.params.event.member.user.id}> - You need the MANAGE_CHANNELS permission to use the Disable Commands command!**`,
});
}