blob: 9f78cc5daa4a04a161b3e355f55b1ad3f8b86c38 [file] [log] [blame]
TheCodedProf21c08592022-09-13 14:14:43 -04001import { CommandInteraction, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
TheCodedProff86ba092023-01-27 17:10:07 -05002import type { SlashCommandSubcommandBuilder } from "discord.js";
pineafan4edb7762022-06-26 19:21:04 +01003import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
pineafan63fc5e22022-08-04 22:04:10 +01004import client from "../../utils/client.js";
pineafanad54d752022-04-18 19:01:43 +01005
6const command = (builder: SlashCommandSubcommandBuilder) =>
Skyler Grey75ea9172022-08-06 10:22:23 +01007 builder.setName("invite").setDescription("Invites Nucleus to your server");
pineafanad54d752022-04-18 19:01:43 +01008
pineafanbd02b4a2022-08-05 22:01:38 +01009const callback = async (interaction: CommandInteraction): Promise<void> => {
Skyler Grey75ea9172022-08-06 10:22:23 +010010 interaction.reply({
11 embeds: [
12 new EmojiEmbed()
13 .setTitle("Invite")
Skyler Grey11236ba2022-08-08 21:13:33 +010014 .setDescription("You can invite Nucleus to your server by clicking the button below")
Skyler Grey75ea9172022-08-06 10:22:23 +010015 .setEmoji("NUCLEUS.LOGO")
16 .setStatus("Danger")
17 ],
18 components: [
PineaFan538d3752023-01-12 21:48:23 +000019 new ActionRowBuilder<ButtonBuilder>().addComponents([
TheCodedProf21c08592022-09-13 14:14:43 -040020 new ButtonBuilder()
Skyler Grey75ea9172022-08-06 10:22:23 +010021 .setLabel("Invite")
TheCodedProf21c08592022-09-13 14:14:43 -040022 .setStyle(ButtonStyle.Link)
Skyler Grey75ea9172022-08-06 10:22:23 +010023 .setURL(
Skyler Greyda16adf2023-03-05 10:22:12 +000024 `https://discord.com/api/oauth2/authorize?client_id=${
25 client.user!.id
TheCodedProfe92b9b52023-03-06 17:07:34 -050026 }&permissions=407900777662&scope=bot%20applications.commands`
Skyler Grey75ea9172022-08-06 10:22:23 +010027 )
28 ])
29 ],
30 ephemeral: true
31 });
pineafan63fc5e22022-08-04 22:04:10 +010032};
pineafanad54d752022-04-18 19:01:43 +010033
pineafanad54d752022-04-18 19:01:43 +010034export { command };
35export { callback };