pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 1 | import { CommandInteraction, MessageActionRow, MessageButton } from "discord.js"; |
| 2 | import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; |
| 3 | import { WrappedCheck } from "jshaiku"; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 4 | import EmojiEmbed from "../../utils/generateEmojiEmbed.js"; |
PineappleFan | b3dd83c | 2022-06-17 10:53:48 +0100 | [diff] [blame] | 5 | import client from "../../utils/client.js" |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 6 | |
| 7 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 8 | builder |
| 9 | .setName("invite") |
| 10 | .setDescription("Invites Nucleus to your server") |
| 11 | |
| 12 | const callback = (interaction: CommandInteraction) => { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 13 | interaction.reply({embeds: [new EmojiEmbed() |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 14 | .setTitle("Invite") |
| 15 | .setDescription("You can invite Nucleus to your server by clicking the button below") |
| 16 | .setEmoji("NUCLEUS.LOGO") |
| 17 | .setStatus("Danger") |
| 18 | ], components: [new MessageActionRow().addComponents([new MessageButton() |
| 19 | .setLabel("Invite") |
| 20 | .setStyle("LINK") |
PineappleFan | b3dd83c | 2022-06-17 10:53:48 +0100 | [diff] [blame] | 21 | .setURL(`https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=295157886134&scope=bot%20applications.commands`) |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 22 | ])], ephemeral: true}); |
| 23 | } |
| 24 | |
| 25 | const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => { |
| 26 | return true; |
| 27 | } |
| 28 | |
| 29 | export { command }; |
| 30 | export { callback }; |
| 31 | export { check }; |