mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-14 21:26:54 +00:00
Transitioned all Misc, audio, Selmer Specific, admin, anime/manga, and inventory commands to Slash Command format. The RSS and reactionrole commands are still broken and all game commands are still in message format due to compications
This commit is contained in:
@@ -1,18 +1,36 @@
|
||||
module.exports = {
|
||||
name: 'serverLock',
|
||||
description: 'Lock ***ALL CHANNELS*** for everyone with the "everyone" role - ***SERVER OWNER ONLY. FOR EMERGENCY USE ONLY***',
|
||||
execute(message, args, Discord, Client, bot) {
|
||||
const guild = bot.guilds.cache.get(message.guild.id);
|
||||
name: 'serverlock',
|
||||
description: 'Lock ALL CHANNELS for everyone with the "everyone" role - SERVER OWNER ONLY!',
|
||||
execute(interaction, Discord, Client, bot) {
|
||||
if (interaction.guild.ownerId != interaction.user.id) { return interaction.reply('Insufficient Permissions!'); }
|
||||
|
||||
if (guild.ownerId != message.author.id) { return message.reply('Insufficient Permissions!'); }
|
||||
const role = interaction.guild.roles.cache.find(r => r.name === "@everyone");
|
||||
const arr = [];
|
||||
|
||||
message.guild.channels.cache.forEach(ch => {
|
||||
channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {
|
||||
VIEW_CHANNEL: false,
|
||||
SEND_MESSAGES: false,
|
||||
READ_MESSAGE_HISTORY: false,
|
||||
ATTACH_FILES: false
|
||||
});
|
||||
interaction.guild.channels.cache.forEach(channel => {
|
||||
if (channel.permissionsFor(role).has("SEND_MESSAGES")) {
|
||||
channel.permissionOverwrites.edit(role.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
SEND_MESSAGES: false,
|
||||
READ_MESSAGE_HISTORY: true,
|
||||
ATTACH_FILES: false
|
||||
});
|
||||
|
||||
//Maybe add the message to the array to be edited/deleted after unlock
|
||||
if (channel.type == 'GUILD_TEXT') {
|
||||
channel.send(`***CHANNEL LOCKED BY ${interaction.user}***`);
|
||||
}
|
||||
|
||||
arr.push(channel.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bot.lockedChannels.set(interaction.guildId, arr);
|
||||
|
||||
interaction.reply(`***SERVER LOCKED BY ${interaction.user}***`);
|
||||
}, options: []
|
||||
}
|
||||
|
||||
// interaction.reply(```diff
|
||||
// - SERVER LOCKED
|
||||
// ```);
|
||||
Reference in New Issue
Block a user