mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-14 21:26:54 +00:00
Added more moderation commands and upgraded the 'audio' command
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user