Added more moderation commands and upgraded the 'audio' command

This commit is contained in:
ION606
2022-07-12 20:10:35 +03:00
parent 6ceb8cb381
commit 5a17e3811f
16 changed files with 881 additions and 114 deletions
+28
View File
@@ -0,0 +1,28 @@
const { checkRole } = require('./verify.js');
module.exports = {
name: 'lock',
description: 'Lock a channel',
execute(message, args, Discord, Client, bot) {
const guild = bot.guilds.cache.get(message.guild.id);
if (!checkRole(bot, guild, message.author.id)) { return message.reply('Insufficient Permissions!'); }
var channel;
if (args[0]) {
channel = guild.channels.cache.find(channel => channel.name.toLowerCase() === args[0]);
} else {
channel = message.channel;
}
if (!channel) { return message.reply("This channel does not exist!"); }
channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {
VIEW_CHANNEL: true,
SEND_MESSAGES: false,
READ_MESSAGE_HISTORY: true,
ATTACH_FILES: false
});
}
}
+11 -1
View File
@@ -3,6 +3,13 @@ const { log, SEVCODES } = require('../log.js');
const { checkRole } = require('./verify.js');
function modHelp() {
const l = ['lock', 'unlock', 'kick', 'ban', 'unban', 'mute', 'unmute'];
return l.join(", ");
}
function kick(guild, user) {
guild.members.kick(user);
}
@@ -134,4 +141,7 @@ function moderation_handler(bot, message, args, command) {
}
}
module.exports = { moderation_handler }
module.exports = {
name: 'moderation',
moderation_handler, modHelp
}
+18
View File
@@ -0,0 +1,18 @@
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);
if (guild.ownerId != message.author.id) { return message.reply('Insufficient Permissions!'); }
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
});
});
}
}
+21
View File
@@ -0,0 +1,21 @@
// const { checkRole } = require('./verify.js');
// module.exports = {
// name: 'serverUnlock',
// description: 'unlocks ***ALL CHANNELS*** for everyone except the those with the "Selmer Bot Commands" role',
// execute(message, args, Discord, Client, bot) {
// const guild = bot.guilds.cache.get(message.guild.id);
// if (!checkRole(bot, guild, message.author.id)) { return message.reply('Insufficient Permissions!'); }
// message.guild.channels.cache.forEach(ch => {
// channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {
// VIEW_CHANNEL: true,
// SEND_MESSAGES: false,
// READ_MESSAGE_HISTORY: false,
// ATTACH_FILES: false
// });
// });
// }
// }
+1 -1
View File
@@ -104,6 +104,6 @@ async function execute(bot, message, args, command, Discord, mongouri, items, xp
module.exports = {
name: 'setup',
description: 'N/A',
description: 'Set up server features',
execute
}
+28
View File
@@ -0,0 +1,28 @@
const { checkRole } = require('./verify.js');
module.exports = {
name: 'unlock',
description: 'Unlock a channel',
execute(message, args, Discord, Client, bot) {
const guild = bot.guilds.cache.get(message.guild.id);
if (!checkRole(bot, guild, message.author.id)) { return message.reply('Insufficient Permissions!'); }
var channel;
if (args[0]) {
channel = guild.channels.cache.find(channel => channel.name.toLowerCase() === args[0]);
} else {
channel = message.channel;
}
if (!channel) { return message.reply("This channel does not exist!"); }
channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {
VIEW_CHANNEL: true,
SEND_MESSAGES: true,
READ_MESSAGE_HISTORY: true,
ATTACH_FILES: true
});
}
}