aboutsummaryrefslogtreecommitdiff
path: root/src/commands/info/invite.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-14 21:22:09 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-14 21:22:09 -0400
commit53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3 (patch)
treef95f23aad382879b35860d4d3be3642068fac8a2 /src/commands/info/invite.ts
parenteaaae08aeee1fa16a4e1ad0b26fceb42885bfcde (diff)
downloadtanzanite-53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3.tar.gz
tanzanite-53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3.tar.bz2
tanzanite-53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3.zip
started moving over some other commands
Diffstat (limited to 'src/commands/info/invite.ts')
-rw-r--r--src/commands/info/invite.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/commands/info/invite.ts b/src/commands/info/invite.ts
new file mode 100644
index 0000000..f53e930
--- /dev/null
+++ b/src/commands/info/invite.ts
@@ -0,0 +1,33 @@
+import { BushCommand, BushMessage, BushSlashMessage } from '@lib';
+import { MessageActionRow, MessageButton } from 'discord.js';
+
+export default class InviteCommand extends BushCommand {
+ public constructor() {
+ super('invite', {
+ aliases: ['invite'],
+ category: 'info',
+ description: {
+ content: 'Sends the bot invite link.',
+ usage: 'invite',
+ examples: ['invite']
+ },
+ ratelimit: 4,
+ cooldown: 4000,
+ clientPermissions: ['SEND_MESSAGES'],
+ slash: true
+ });
+ }
+
+ public async exec(message: BushMessage | BushSlashMessage): Promise<unknown> {
+ if (this.client.config.dev)
+ return await message.util.reply(`${this.client.util.emojis.error} The dev bot cannot be invited.`);
+ const ButtonRow = new MessageActionRow().addComponents(
+ new MessageButton({
+ style: 'LINK',
+ label: 'Invite Me',
+ url: `https://discord.com/api/oauth2/authorize?client_id=${this.client.user.id}&permissions=2147483647&scope=bot%20applications.commands`
+ })
+ );
+ return await message.util.reply({ components: [ButtonRow] });
+ }
+}