TheCodedProf | 21c0859 | 2022-09-13 14:14:43 -0400 | [diff] [blame] | 1 | import { CommandInteraction, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"; |
TheCodedProf | f86ba09 | 2023-01-27 17:10:07 -0500 | [diff] [blame] | 2 | import type { SlashCommandSubcommandBuilder } from "discord.js"; |
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) => |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 7 | builder.setName("invite").setDescription("Invites Nucleus to your server"); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 8 | |
pineafan | bd02b4a | 2022-08-05 22:01:38 +0100 | [diff] [blame] | 9 | const callback = async (interaction: CommandInteraction): Promise<void> => { |
Skyler Grey | f4f21c4 | 2023-03-08 14:36:29 +0000 | [diff] [blame] | 10 | await interaction.reply({ |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 11 | embeds: [ |
| 12 | new EmojiEmbed() |
| 13 | .setTitle("Invite") |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 14 | .setDescription("You can invite Nucleus to your server by clicking the button below") |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 15 | .setEmoji("NUCLEUS.LOGO") |
| 16 | .setStatus("Danger") |
| 17 | ], |
| 18 | components: [ |
PineaFan | 538d375 | 2023-01-12 21:48:23 +0000 | [diff] [blame] | 19 | new ActionRowBuilder<ButtonBuilder>().addComponents([ |
TheCodedProf | 21c0859 | 2022-09-13 14:14:43 -0400 | [diff] [blame] | 20 | new ButtonBuilder() |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 21 | .setLabel("Invite") |
TheCodedProf | 21c0859 | 2022-09-13 14:14:43 -0400 | [diff] [blame] | 22 | .setStyle(ButtonStyle.Link) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 23 | .setURL( |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame] | 24 | `https://discord.com/api/oauth2/authorize?client_id=${ |
| 25 | client.user!.id |
pineafan | 3c1c680 | 2023-05-28 15:45:24 +0100 | [diff] [blame^] | 26 | }&permissions=407900777662&scope=bot%20applications.commands` |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 27 | ) |
| 28 | ]) |
| 29 | ], |
| 30 | ephemeral: true |
| 31 | }); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 32 | }; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 33 | |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 34 | export { command }; |
| 35 | export { callback }; |