mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
More Perm Checks, return in index
This commit is contained in:
@@ -41,6 +41,8 @@ module.exports = class BanCommand extends Command {
|
||||
return msg.say('This Command requires the `Ban Members` Permission.');
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
if(!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if(!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES'))
|
||||
return msg.say('This Command requires the `Send Messages` Permission for the Mod Log Channel.');
|
||||
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
|
||||
@@ -38,6 +38,8 @@ module.exports = class KickCommand extends Command {
|
||||
return msg.say('This Command requires the `Kick Members` Permission.');
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
if(!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if(!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES'))
|
||||
return msg.say('This Command requires the `Send Messages` Permission for the Mod Log Channel.');
|
||||
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
|
||||
@@ -40,6 +40,8 @@ module.exports = class SoftbanCommand extends Command {
|
||||
return msg.say('This Command requires the `Kick Members` Permission.');
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
if(!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if(!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES'))
|
||||
return msg.say('This Command requires the `Send Messages` Permission for the Mod Log Channel.');
|
||||
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
|
||||
@@ -45,6 +45,8 @@ module.exports = class UnbanCommand extends Command {
|
||||
return msg.say('This Command requires the `Ban Members` Permission.');
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
if(!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if(!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES'))
|
||||
return msg.say('This Command requires the `Send Messages` Permission for the Mod Log Channel.');
|
||||
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { id, reason } = args;
|
||||
|
||||
@@ -36,6 +36,8 @@ module.exports = class WarnCommand extends Command {
|
||||
async run(msg, args) {
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
if(!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if(!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES'))
|
||||
return msg.say('This Command requires the `Send Messages` Permission for the Mod Log Channel.');
|
||||
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
|
||||
@@ -53,7 +53,7 @@ client.on('guildMemberAdd', (member) => {
|
||||
.replace(/(<user>)/gi, member.user.username)
|
||||
.replace(/(<server>)/gi, member.guild.name)
|
||||
.replace(/(<mention>)/gi, member);
|
||||
channel.send(msg);
|
||||
return channel.send(msg);
|
||||
});
|
||||
|
||||
client.on('guildMemberRemove', (member) => {
|
||||
@@ -64,7 +64,7 @@ client.on('guildMemberRemove', (member) => {
|
||||
.replace(/(<user>)/gi, member.user.username)
|
||||
.replace(/(<server>)/gi, member.guild.name)
|
||||
.replace(/(<mention>)/gi, member);
|
||||
channel.send(msg);
|
||||
return channel.send(msg);
|
||||
});
|
||||
|
||||
client.on('guildCreate', async(guild) => {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "18.6.0",
|
||||
"version": "18.6.1",
|
||||
"description": "A Discord Bot",
|
||||
"main": "shardingmanager.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user