blob: fd65e515a000b91217f19812f85b7d7f7144adfb [file] [log] [blame]
TheCodedProf21c08592022-09-13 14:14:43 -04001import { CommandInteraction, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
PineaFan538d3752023-01-12 21:48:23 +00002import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
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(
PineaFan538d3752023-01-12 21:48:23 +000024 `https://discord.com/api/oauth2/authorize?client_id=${client.user!.id}&permissions=295157886134&scope=bot%20applications.commands`
Skyler Grey75ea9172022-08-06 10:22:23 +010025 )
26 ])
27 ],
28 ephemeral: true
29 });
pineafan63fc5e22022-08-04 22:04:10 +010030};
pineafanad54d752022-04-18 19:01:43 +010031
pineafanbd02b4a2022-08-05 22:01:38 +010032const check = () => {
pineafanad54d752022-04-18 19:01:43 +010033 return true;
pineafan63fc5e22022-08-04 22:04:10 +010034};
pineafanad54d752022-04-18 19:01:43 +010035
36export { command };
37export { callback };
Skyler Grey75ea9172022-08-06 10:22:23 +010038export { check };