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"; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +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 |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame^] | 9 | .setName("invite") |
| 10 | .setDescription("Invites Nucleus to your server"); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 11 | |
pineafan | 41d9356 | 2022-07-30 22:10:15 +0100 | [diff] [blame] | 12 | const callback = async (interaction: CommandInteraction): Promise<any> => { |
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}); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame^] | 23 | }; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 24 | |
| 25 | const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => { |
| 26 | return true; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame^] | 27 | }; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 28 | |
| 29 | export { command }; |
| 30 | export { callback }; |
| 31 | export { check }; |