mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix the Mod Commands
This commit is contained in:
@@ -47,12 +47,12 @@ module.exports = class BanCommand extends Command {
|
||||
if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
try {
|
||||
await member.send(stripIndents`
|
||||
await member.user.send(stripIndents`
|
||||
You were banned from ${msg.guild.name}!
|
||||
Reason: ${reason}.
|
||||
`);
|
||||
} catch (err) {
|
||||
await msg.say('Failed to send DM to the user.');
|
||||
await msg.say('Failed to Send DM.');
|
||||
}
|
||||
await member.ban({ days: 7, reason });
|
||||
msg.say(':ok_hand:');
|
||||
|
||||
@@ -46,12 +46,12 @@ module.exports = class KickCommand extends Command {
|
||||
if (!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
try {
|
||||
await member.send(stripIndents`
|
||||
await member.user.send(stripIndents`
|
||||
You were kicked from ${msg.guild.name}!
|
||||
Reason: ${reason}.
|
||||
`);
|
||||
} catch (err) {
|
||||
await msg.say('Failed to send DM.');
|
||||
await msg.say('Failed to Send DM.');
|
||||
}
|
||||
await member.kick({ reason });
|
||||
msg.say(':ok_hand:');
|
||||
|
||||
@@ -46,15 +46,15 @@ module.exports = class SoftbanCommand extends Command {
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
|
||||
if (!member.bannable) return msg.say('This member is not softbannable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
try {
|
||||
await member.send(stripIndents`
|
||||
await member.user.send(stripIndents`
|
||||
You were softbanned from ${msg.guild.name}!
|
||||
Reason: ${reason}.
|
||||
`);
|
||||
} catch (err) {
|
||||
await msg.say('Failed to send DM to user.');
|
||||
await msg.say('Failed to Send DM.');
|
||||
}
|
||||
await member.ban({ days: 7, reason });
|
||||
await msg.guild.unban(member.user);
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = class WarnCommand extends Command {
|
||||
return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.has(msg.guild.settings.get('staffRole'));
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
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'))
|
||||
@@ -41,6 +41,15 @@ module.exports = class WarnCommand extends Command {
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
if (!member.kickable) return msg.say('This member is not warnable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
await member.user.send(stripIndents`
|
||||
You were warned in ${msg.guild.name}!
|
||||
Reason: ${reason}.
|
||||
`);
|
||||
} catch (err) {
|
||||
await msg.say('Failed to Send DM.');
|
||||
}
|
||||
msg.say(':ok_hand:');
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "19.12.0",
|
||||
"version": "19.12.1",
|
||||
"description": "A Discord Bot",
|
||||
"main": "shardingmanager.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user