mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 15:57:50 +02:00
Remove all useless async
This commit is contained in:
@@ -19,7 +19,7 @@ module.exports = class BanCommand extends commando.Command {
|
||||
return msg.member.hasPermission('BAN_MEMBERS');
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'BAN_MEMBERS'])) return;
|
||||
}
|
||||
@@ -28,7 +28,7 @@ module.exports = class BanCommand extends commando.Command {
|
||||
let userToBan = message.mentions.users.first();
|
||||
let reason = message.content.split(" ").slice(2).join(" ");
|
||||
if (message.mentions.users.size !== 1) {
|
||||
message.channel.send(":x: Error! Please mention one user!");
|
||||
return message.channel.send(":x: Error! Please mention one user!");
|
||||
}
|
||||
else {
|
||||
if (message.guild.member(userToBan).bannable) {
|
||||
@@ -41,19 +41,19 @@ module.exports = class BanCommand extends commando.Command {
|
||||
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Member:** ${userToBan.username}#${userToBan.discriminator} (${userToBan.id})\n**Action:** Ban\n**Reason:** ${reason}`);
|
||||
message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
|
||||
return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
|
||||
}
|
||||
else {
|
||||
message.channel.send(":notepad_spiral: **Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
|
||||
return message.channel.send(":notepad_spiral: **Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
|
||||
}
|
||||
}
|
||||
else {
|
||||
message.channel.send(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?");
|
||||
return message.channel.send(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
message.channel.send(":x: Error! This command does not work in DM!");
|
||||
return message.channel.send(":x: Error! This command does not work in DM!");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = class KickCommand extends commando.Command {
|
||||
return msg.member.hasPermission('KICK_MEMBERS');
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'KICK_MEMBERS'])) return;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ module.exports = class KickCommand extends commando.Command {
|
||||
let userToKick = message.mentions.users.first();
|
||||
let reason = message.content.split(" ").slice(2).join(" ");
|
||||
if (message.mentions.users.size !== 1) {
|
||||
message.channel.send(":x: Error! Please mention one user!");
|
||||
return message.channel.send(":x: Error! Please mention one user!");
|
||||
}
|
||||
else {
|
||||
if (message.guild.member(userToKick).kickable) {
|
||||
@@ -38,19 +38,19 @@ module.exports = class KickCommand extends commando.Command {
|
||||
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Member:** ${userToKick.username}#${userToKick.discriminator} (${userToKick.id})\n**Action:** Kick\n**Reason:** ${reason}`);
|
||||
message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
|
||||
return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
|
||||
}
|
||||
else {
|
||||
message.channel.send(":notepad_spiral: **Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
|
||||
return message.channel.send(":notepad_spiral: **Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
|
||||
}
|
||||
}
|
||||
else {
|
||||
message.channel.send(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?");
|
||||
return message.channel.send(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
message.channel.send(":x: Error! This command does not work in DM!");
|
||||
return message.channel.send(":x: Error! This command does not work in DM!");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = class WarnCommand extends commando.Command {
|
||||
return msg.member.hasPermission('MANAGE_MESSAGES');
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ module.exports = class WarnCommand extends commando.Command {
|
||||
let userToWarn = message.mentions.users.first();
|
||||
let reason = message.content.split(" ").slice(2).join(" ");
|
||||
if (message.mentions.users.size !== 1) {
|
||||
message.channel.send(":x: Error! Please mention one user!");
|
||||
return message.channel.send(":x: Error! Please mention one user!");
|
||||
}
|
||||
else {
|
||||
message.channel.send(":ok_hand:");
|
||||
@@ -36,15 +36,15 @@ module.exports = class WarnCommand extends commando.Command {
|
||||
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Member:** ${userToWarn.username}#${userToWarn.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`);
|
||||
message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
|
||||
return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
|
||||
}
|
||||
else {
|
||||
message.channel.send("**Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
|
||||
return message.channel.send("**Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
message.channel.send(":x: Error! This command does not work in DM!");
|
||||
return message.channel.send(":x: Error! This command does not work in DM!");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user