mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 21:44:48 +02:00
Destructuring Args
This commit is contained in:
@@ -13,7 +13,7 @@ module.exports = class WarnCommand extends Command {
|
||||
args: [{
|
||||
key: 'member',
|
||||
prompt: 'What member do you want to warn?',
|
||||
type: 'user'
|
||||
type: 'member'
|
||||
}, {
|
||||
key: 'reason',
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
@@ -37,9 +37,7 @@ module.exports = class WarnCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
let member = message.guild.member(args.member);
|
||||
if (!member) member = await message.guild.fetchMember(args.member);
|
||||
const reason = args.reason;
|
||||
const { member, reason } = args;
|
||||
if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!');
|
||||
try {
|
||||
await message.say(':ok_hand:');
|
||||
|
||||
Reference in New Issue
Block a user