mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-10 10:57:08 +02:00
Remove all useless async
This commit is contained in:
@@ -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