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"; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 3 | import EmojiEmbed from "../../utils/generateEmojiEmbed.js"; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 4 | import client from "../../utils/client.js"; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 5 | |
| 6 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 7 | builder |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 8 | .setName("invite") |
| 9 | .setDescription("Invites Nucleus to your server"); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 10 | |
pineafan | bd02b4a | 2022-08-05 22:01:38 +0100 | [diff] [blame^] | 11 | const callback = async (interaction: CommandInteraction): Promise<void> => { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 12 | interaction.reply({embeds: [new EmojiEmbed() |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 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") |
PineappleFan | b3dd83c | 2022-06-17 10:53:48 +0100 | [diff] [blame] | 20 | .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] | 21 | ])], ephemeral: true}); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 22 | }; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 23 | |
pineafan | bd02b4a | 2022-08-05 22:01:38 +0100 | [diff] [blame^] | 24 | const check = () => { |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 25 | return true; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 26 | }; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 27 | |
| 28 | export { command }; |
| 29 | export { callback }; |
| 30 | export { check }; |