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,28 +1,31 @@
|
||||
const { checkRole } = require('./verify.js');
|
||||
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'lock',
|
||||
description: 'Lock a channel',
|
||||
execute(message, args, Discord, Client, bot) {
|
||||
const guild = bot.guilds.cache.get(message.guild.id);
|
||||
execute(interaction, Discord, Client, bot) {
|
||||
const arg = interaction.options.data[0];
|
||||
const guild = bot.guilds.cache.get(interaction.guildId);
|
||||
|
||||
if (!checkRole(bot, guild, message.author.id)) { return message.reply('Insufficient Permissions!'); }
|
||||
if (!checkRole(bot, guild, interaction.user.id)) { return interaction.reply('Insufficient Permissions!'); }
|
||||
|
||||
var channel;
|
||||
if (args[0]) {
|
||||
channel = guild.channels.cache.find(channel => channel.name.toLowerCase() === args[0]);
|
||||
if (arg) {
|
||||
channel = arg.channel;
|
||||
} else {
|
||||
channel = message.channel;
|
||||
channel = interaction.channel;
|
||||
}
|
||||
|
||||
if (!channel) { return message.reply("This channel does not exist!"); }
|
||||
|
||||
channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {
|
||||
let role = interaction.guild.roles.cache.find(r => r.name === "@everyone");
|
||||
channel.permissionOverwrites.edit(role.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
SEND_MESSAGES: false,
|
||||
READ_MESSAGE_HISTORY: true,
|
||||
ATTACH_FILES: false
|
||||
});
|
||||
}
|
||||
|
||||
interaction.reply(`${channel} has been locked!`);
|
||||
},
|
||||
options: [{name: 'channel', description: 'The channel to lock (defaults to current channel)', type: Constants.ApplicationCommandOptionTypes.CHANNEL, required: false}]
|
||||
}
|
||||
Reference in New Issue
Block a user