diff options
Diffstat (limited to 'src/commands/info/invite.ts')
-rw-r--r-- | src/commands/info/invite.ts | 33 |
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] }); + } +} |