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