diff --git a/src/commands-message/general/invite.ts b/src/commands-message/general/invite.ts new file mode 100644 index 00000000..b11eedf5 --- /dev/null +++ b/src/commands-message/general/invite.ts @@ -0,0 +1,18 @@ +import type { MessageCommand } from "@type/commands"; +import type { Message } from "@lilybird/transformers"; + +export default { + name: "invite", + description: "Get an invite link of the bot.", + cooldown: 1000, + run: async ({ message }: { message: Message }) => { + const links = { + invite: "https://discord.com/oauth2/authorize?client_id=995999045157916763&permissions=265216&scope=bot", + vote: "https://top.gg/bot/995999045157916763" + }; + + await message.reply({ + content: `You can invite the bot to your server using the following link:\n${links.invite}\nYou can also vote for the bot:\n${links.vote}` + }); + } +} satisfies MessageCommand; diff --git a/src/commands-message/general/vote.ts b/src/commands-message/general/vote.ts new file mode 100644 index 00000000..0996237d --- /dev/null +++ b/src/commands-message/general/vote.ts @@ -0,0 +1,15 @@ +import type { MessageCommand } from "@type/commands"; +import type { Message } from "@lilybird/transformers"; + +export default { + name: "vote", + description: "Vote for the bot.", + cooldown: 1000, + run: async ({ message }: { message: Message }) => { + const voteLink = "https://top.gg/bot/995999045157916763"; + + await message.reply({ + content: `You can vote for the bot using the following link:\n${voteLink}` + }); + } +} satisfies MessageCommand; diff --git a/src/commands-message/help/help.ts b/src/commands-message/help/help.ts index 98d9384a..d115fa29 100644 --- a/src/commands-message/help/help.ts +++ b/src/commands-message/help/help.ts @@ -1,4 +1,4 @@ -import { helpBuilder } from "@builders/help"; +import { helpBuilder } from "@builders/index"; import type { MessageCommand } from "@type/commands"; import type { Message } from "@lilybird/transformers"; diff --git a/src/commands-message/osu/avatar.ts b/src/commands-message/osu/avatar.ts index 544a1220..03965545 100644 --- a/src/commands-message/osu/avatar.ts +++ b/src/commands-message/osu/avatar.ts @@ -3,7 +3,7 @@ import { client } from "@utils/initalize"; import { UserType } from "@type/commandArgs"; import { EmbedBuilderType } from "@type/embedBuilders"; import { Mode } from "@type/osu"; -import { avatarBuilder } from "@builders/avatar"; +import { avatarBuilder } from "@builders/index"; import { EmbedType } from "lilybird"; import type { GuildTextChannel, Message } from "@lilybird/transformers"; import type { MessageCommand } from "@type/commands"; diff --git a/src/commands-message/osu/background.ts b/src/commands-message/osu/background.ts index 77dda070..6a98c684 100644 --- a/src/commands-message/osu/background.ts +++ b/src/commands-message/osu/background.ts @@ -3,7 +3,7 @@ import { getBeatmapIdFromContext } from "@utils/osu"; import { Mode } from "@type/osu"; import { EmbedBuilderType } from "@type/embedBuilders"; import { client } from "@utils/initalize"; -import { backgroundBuilder } from "@builders/background"; +import { backgroundBuilder } from "@builders/index"; import { EmbedType } from "lilybird"; import type { GuildTextChannel, Message } from "@lilybird/transformers"; import type { MessageCommand } from "@type/commands"; diff --git a/src/commands-message/osu/banner.ts b/src/commands-message/osu/banner.ts index baaaae09..867ffc9c 100644 --- a/src/commands-message/osu/banner.ts +++ b/src/commands-message/osu/banner.ts @@ -3,7 +3,7 @@ import { client } from "@utils/initalize"; import { UserType } from "@type/commandArgs"; import { EmbedBuilderType } from "@type/embedBuilders"; import { Mode } from "@type/osu"; -import { bannerBuilder } from "@builders/banner"; +import { bannerBuilder } from "@builders/index"; import { EmbedType } from "lilybird"; import type { GuildTextChannel, Message } from "@lilybird/transformers"; import type { MessageCommand } from "@type/commands"; diff --git a/src/commands/general/invite.ts b/src/commands/general/invite.ts new file mode 100644 index 00000000..28c0d591 --- /dev/null +++ b/src/commands/general/invite.ts @@ -0,0 +1,15 @@ +import type { SlashCommand } from "@type/commands"; + +export default { + data: { name: "invite", description: "Get an invite link of the bot." }, + run: async (interaction) => { + const links = { + invite: "https://discord.com/oauth2/authorize?client_id=995999045157916763&permissions=265216&scope=bot", + vote: "https://top.gg/bot/995999045157916763" + }; + + await interaction.editReply({ + content: `You can invite the bot to your server using the following link:\n${links.invite}\nYou can also vote for the bot:\n${links.vote}` + }); + } +} satisfies SlashCommand; diff --git a/src/commands/general/vote.ts b/src/commands/general/vote.ts new file mode 100644 index 00000000..c0a40dce --- /dev/null +++ b/src/commands/general/vote.ts @@ -0,0 +1,12 @@ +import type { SlashCommand } from "@type/commands"; + +export default { + data: { name: "vote", description: "Vote for the bot." }, + run: async (interaction) => { + const voteLink = "https://top.gg/bot/995999045157916763"; + + await interaction.editReply({ + content: `You can vote for the bot using the following link:\n${voteLink}` + }); + } +} satisfies SlashCommand; diff --git a/src/commands/help/help.ts b/src/commands/help/help.ts index 77afebc9..abeb3872 100644 --- a/src/commands/help/help.ts +++ b/src/commands/help/help.ts @@ -1,4 +1,4 @@ -import { helpBuilder } from "@builders/help"; +import { helpBuilder } from "@builders/index"; import type { SlashCommand } from "@type/commands"; export default { diff --git a/src/commands/osu/avatar.ts b/src/commands/osu/avatar.ts index 4e8e5a0f..5182acbb 100644 --- a/src/commands/osu/avatar.ts +++ b/src/commands/osu/avatar.ts @@ -2,7 +2,7 @@ import { getCommandArgs } from "@utils/args"; import { client } from "@utils/initalize"; import { UserType } from "@type/commandArgs"; import { EmbedBuilderType } from "@type/embedBuilders"; -import { avatarBuilder } from "@builders/avatar"; +import { avatarBuilder } from "@builders/index"; import { ApplicationCommandOptionType, EmbedType } from "lilybird"; import type { ApplicationCommandData, GuildInteraction } from "@lilybird/transformers"; import type { SlashCommand } from "@type/commands"; diff --git a/src/commands/osu/background.ts b/src/commands/osu/background.ts index 5b6d8dd8..df3c070c 100644 --- a/src/commands/osu/background.ts +++ b/src/commands/osu/background.ts @@ -1,7 +1,7 @@ import { getCommandArgs } from "@utils/args"; import { getBeatmapIdFromContext } from "@utils/osu"; import { EmbedBuilderType } from "@type/embedBuilders"; -import { backgroundBuilder } from "@builders/background"; +import { backgroundBuilder } from "@builders/index"; import { client } from "@utils/initalize"; import { ApplicationCommandOptionType, EmbedType } from "lilybird"; import type { ApplicationCommandData, GuildInteraction } from "@lilybird/transformers"; diff --git a/src/commands/osu/banner.ts b/src/commands/osu/banner.ts index 9c12b8c8..57218240 100644 --- a/src/commands/osu/banner.ts +++ b/src/commands/osu/banner.ts @@ -1,4 +1,4 @@ -import { bannerBuilder } from "@builders/banner"; +import { bannerBuilder } from "@builders/index"; import { getCommandArgs } from "@utils/args"; import { client } from "@utils/initalize"; import { UserType } from "@type/commandArgs"; diff --git a/src/embed-builders/index.ts b/src/embed-builders/index.ts index e6831cf1..2d11550c 100644 --- a/src/embed-builders/index.ts +++ b/src/embed-builders/index.ts @@ -1,5 +1,12 @@ +// Complicated functions export * from "./compare"; export * from "./leaderboard"; export * from "./map"; export * from "./plays"; export * from "./profile"; + +// Simple functions +export * from "./simple/avatar"; +export * from "./simple/background"; +export * from "./simple/banner"; +export * from "./simple/help"; diff --git a/src/embed-builders/avatar.ts b/src/embed-builders/simple/avatar.ts similarity index 100% rename from src/embed-builders/avatar.ts rename to src/embed-builders/simple/avatar.ts diff --git a/src/embed-builders/background.ts b/src/embed-builders/simple/background.ts similarity index 100% rename from src/embed-builders/background.ts rename to src/embed-builders/simple/background.ts diff --git a/src/embed-builders/banner.ts b/src/embed-builders/simple/banner.ts similarity index 100% rename from src/embed-builders/banner.ts rename to src/embed-builders/simple/banner.ts diff --git a/src/embed-builders/help.ts b/src/embed-builders/simple/help.ts similarity index 88% rename from src/embed-builders/help.ts rename to src/embed-builders/simple/help.ts index ce94c3e0..6ea29743 100644 --- a/src/embed-builders/help.ts +++ b/src/embed-builders/simple/help.ts @@ -7,6 +7,7 @@ export function helpBuilder(): Array { const downloadedMaps = getRowCount("maps"); const hanamiWebsite = "https://hanami.yorunoken.com"; const inviteLink = "https://discord.com/oauth2/authorize?client_id=995999045157916763&permissions=265216&scope=bot"; + const voteLink = "https://top.gg/bot/995999045157916763"; return [ { @@ -17,7 +18,7 @@ export function helpBuilder(): Array { name: "Statistics", value: `**Joined servers:** \`${joinedServers}\`\n**Users linked:** \`${linkedUers}\`\n**Maps in database:** ${downloadedMaps}` }, - { name: "Links", value: `[Official Website](${hanamiWebsite}) | [Invite Link](${inviteLink})` } + { name: "Links", value: `[Official Website](${hanamiWebsite}) | [Invite Link](${inviteLink}) | [Vote Link](${voteLink})` } ] } ]; diff --git a/src/listeners/interactionCreate.ts b/src/listeners/interactionCreate.ts index 4c7d2842..3e4c9fa6 100644 --- a/src/listeners/interactionCreate.ts +++ b/src/listeners/interactionCreate.ts @@ -1,14 +1,11 @@ -import { compareBuilder, leaderboardBuilder, mapBuilder, playBuilder, profileBuilder } from "../embed-builders"; import { getEntry, insertData } from "@utils/database"; import { client, applicationCommands, loadLogs } from "@utils/initalize"; import { mesageDataForButtons } from "@utils/cache"; import { EmbedBuilderType } from "@type/embedBuilders"; import { calculateButtonState, createActionRow } from "@utils/buttons"; -import { backgroundBuilder } from "@builders/background"; -import { avatarBuilder } from "@builders/avatar"; -import { bannerBuilder } from "@builders/banner"; import { simulateBuilder } from "@builders/simulate"; import { Tables } from "@type/database"; +import { compareBuilder, leaderboardBuilder, mapBuilder, playBuilder, profileBuilder, avatarBuilder, backgroundBuilder, bannerBuilder } from "@builders/index"; import type { DMInteraction, Interaction, InteractionReplyOptions, Message, MessageComponentData } from "@lilybird/transformers"; import type { EmbedStructure } from "lilybird"; import type { Event } from "@lilybird/handlers";