From df0d295c0801b04cfaf8d5f8e2ef1decb2359e1b Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 12 Sep 2019 21:11:39 +0200 Subject: [PATCH] make it say that it only work with bot --- commands/utility/invite.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/commands/utility/invite.js b/commands/utility/invite.js index 4eec0c69..8b6b3cc8 100644 --- a/commands/utility/invite.js +++ b/commands/utility/invite.js @@ -7,14 +7,14 @@ class InviteCommand extends Command { aliases: ['invite'], category: 'utility', args: [ - { - id: 'member', - type: 'user' - }, { id: 'here', match: 'flag', flag: '--here' + }, + { + id: 'member', + type: 'user' } ], description: { @@ -27,8 +27,12 @@ class InviteCommand extends Command { async exec(message, args) { let botid; - if (args.member.bot) { - botid = args.member.id; + if (args.member) { + if (args.member.bot) { + botid = args.member.id; + } else { + return message.channel.send('Sorry, the user you mentioned is not a bot!'); + } } else { botid = this.client.user.id; }