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