From 08b9f730a3ebdd1f19d6ec305700a1b2c2dcc9de Mon Sep 17 00:00:00 2001 From: Supositware Date: Mon, 21 Jan 2019 22:13:02 +0100 Subject: [PATCH] Allow to send invite in current channel --- commands/utility/invite.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/commands/utility/invite.js b/commands/utility/invite.js index aa3f75d..6e24432 100644 --- a/commands/utility/invite.js +++ b/commands/utility/invite.js @@ -6,6 +6,13 @@ class InviteCommand extends Command { super('invite', { aliases: ['invite'], category: 'utility', + args: [ + { + id: 'here', + type: 'string', + optional: true + } + ], description: { content: 'Send invite link for the bot and support server', usage: '', @@ -14,9 +21,14 @@ class InviteCommand extends Command { }); } - async exec(message) { - message.channel.send('Check your dm'); - return message.author.send(`You can add me from here: https://discordapp.com/oauth2/authorize?client_id=${this.client.user.id}&scope=bot&permissions=0\nYou can also join my support server over here: ${supportServer} come and say hi :)`); + async exec(message, args) { + let invMessage = `You can add me from here: https://discordapp.com/oauth2/authorize?client_id=${this.client.user.id}&scope=bot&permissions=0\nYou can also join my support server over here: ${supportServer} come and say hi :)`; + if (args.here == 'here') { + message.channel.send(invMessage); + } else { + message.channel.send('Check your dm'); + return message.author.send(invMessage); + } } }