From 9e4fe28c815dd7bdba1398c8b06541d52720320c Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 27 Mar 2025 13:47:22 +0100 Subject: [PATCH] Updated emojis --- src/commands/check.ts | 25 +++++++++++---------- src/commands/forceverify.ts | 5 +++-- src/commands/guild/info.ts | 5 +++-- src/commands/guild/member.ts | 5 +++-- src/commands/guild/top.ts | 5 +++-- src/commands/staff/beast.ts | 25 +++++++++++---------- src/commands/test.ts | 18 +++++++++++++++ src/commands/uuid.ts | 3 ++- src/commands/verify.ts | 9 ++++---- src/components/buttons/checkstats.ts | 17 +++++++------- src/utils/Functions/applicationquestions.ts | 3 ++- src/utils/Functions/emoji.ts | 13 +++++++++++ 12 files changed, 87 insertions(+), 46 deletions(-) create mode 100644 src/commands/test.ts create mode 100644 src/utils/Functions/emoji.ts diff --git a/src/commands/check.ts b/src/commands/check.ts index 58ab1f7..b39cf43 100644 --- a/src/commands/check.ts +++ b/src/commands/check.ts @@ -2,6 +2,7 @@ import { InteractionContextType, SlashCommandBuilder } from "discord.js" import { devMessage, embedColor } from "~/config/options" import { bwfkdr, bwstars, bwwins, duelswins, duelswlr, swkdr, swstars } from "~/config/reqs" import { ICommand } from "~/typings" +import emoji from "~/utils/Functions/emoji" import { bedwarsLevel, getGuild, getHeadURL, getPlayer, getUUID, hypixelLevel, skywarsLevel } from "~/utils/Hypixel" export default { @@ -39,7 +40,7 @@ export default { if (!uuid) { interaction.editReply({ embeds: [{ - description: " That player does not exist.", + description: emoji("questionmark") + " That player does not exist.", color: embedColor }] }) @@ -58,7 +59,7 @@ export default { if (!player) { interaction.editReply({ embeds: [{ - description: " That player hasn't played Hypixel before.", + description: emoji("questionmark") + " That player hasn't played Hypixel before.", color: embedColor }] }) @@ -116,7 +117,7 @@ export default { if (!player.stats) { statsFields.push({ - name: " This player never played any games.", + name: emoji("warning") + " This player never played any games.", value: "**➺ Stats:** `None`" }) } else { @@ -130,9 +131,9 @@ export default { let bwtitle = "" if (hsbwstars < bwstars || hsbwfkdr < bwfkdr || hsbwwins < bwwins) { - bwtitle = " This player does not meet the BedWars requirements." + bwtitle = emoji("cross") + " This player does not meet the BedWars requirements." } else { - bwtitle = " This player meets the BedWars requirements." + bwtitle = emoji("checkmark") + " This player meets the BedWars requirements." } statsFields.push({ @@ -146,7 +147,7 @@ export default { }) } else { statsFields.push({ - name: " This player never played BedWars.", + name: emoji("warning") + " This player never played BedWars.", value: "**➺ Stats:** `None`" }) } @@ -161,9 +162,9 @@ export default { let swtitle = "" if (hsswstars < swstars || hsswkd < swkdr) { - swtitle = " This player does not meet the SkyWars requirements." + swtitle = emoji("cross") + " This player does not meet the SkyWars requirements." } else { - swtitle = " This player meets the SkyWars requirements." + swtitle = emoji("checkmark") + " This player meets the SkyWars requirements." } statsFields.push({ @@ -176,7 +177,7 @@ export default { }) } else { statsFields.push({ - name: " This player never played SkyWars.", + name: emoji("warning") + " This player never played SkyWars.", value: "**➺ Stats:** `None`" }) } @@ -191,9 +192,9 @@ export default { let duelstitle = "" if (hsduelswins < duelswins || hsduelswlr < duelswlr) { - duelstitle = " This player does not meet the Duels requirements." + duelstitle = emoji("cross") + " This player does not meet the Duels requirements." } else { - duelstitle = " This player meets the Duels requirements." + duelstitle = emoji("checkmark") + " This player meets the Duels requirements." } statsFields.push({ @@ -206,7 +207,7 @@ export default { }) } else { statsFields.push({ - name: " This player never played Duels.", + name: emoji("warning") + " This player never played Duels.", value: "**➺ Stats:** `None`" }) } diff --git a/src/commands/forceverify.ts b/src/commands/forceverify.ts index 1866636..5f8c5a1 100644 --- a/src/commands/forceverify.ts +++ b/src/commands/forceverify.ts @@ -2,6 +2,7 @@ import { GuildMember, InteractionContextType, PermissionFlagsBits, SlashCommandB import { addVerify, getVerify } from "src/drizzle/functions" import { devMessage, embedColor, hypixelGuildID } from "~/config/options" import { ICommand } from "~/typings" +import emoji from "~/utils/Functions/emoji" import getGuildRank from "~/utils/Functions/guildrank" import logToChannel from "~/utils/Functions/logtochannel" import roleManage from "~/utils/Functions/rolesmanage" @@ -58,7 +59,7 @@ export default { if (!uuid) { interaction.editReply({ embeds: [{ - description: " That player doesn't exist.", + description: emoji("questionmark") + " That player doesn't exist.", color: embedColor }] }) @@ -76,7 +77,7 @@ export default { if (!player) { interaction.editReply({ embeds: [{ - description: " That player hasn't played Hypixel before.", + description: emoji("questionmark") + " That player hasn't played Hypixel before.", color: embedColor }] }) diff --git a/src/commands/guild/info.ts b/src/commands/guild/info.ts index 26787c8..4956093 100644 --- a/src/commands/guild/info.ts +++ b/src/commands/guild/info.ts @@ -1,6 +1,7 @@ import { SlashCommandSubcommandBuilder } from "discord.js" import { devMessage, embedColor } from "~/config/options" import { IGuildData, SubCommand } from "~/typings" +import emoji from "~/utils/Functions/emoji" import { dateTimeFormatter, numberFormatter } from "~/utils/Functions/intlFormaters" import { getGuild, getIGN, getPlayer, getUUID, guildLevel } from "~/utils/Hypixel" @@ -43,7 +44,7 @@ const cmd: SubCommand = async ({ interaction }) => { if (!uuid) { interaction.editReply({ embeds: [{ - description: " That player does not exist.", + description: emoji("questionmark") + " That player does not exist.", color: embedColor }] }) @@ -61,7 +62,7 @@ const cmd: SubCommand = async ({ interaction }) => { if (!player) { interaction.editReply({ embeds: [{ - description: " That player hasn't played Hypixel before.", + description: emoji("questionmark") + " That player hasn't played Hypixel before.", color: embedColor }] }) diff --git a/src/commands/guild/member.ts b/src/commands/guild/member.ts index ff2b4fd..1415e3b 100644 --- a/src/commands/guild/member.ts +++ b/src/commands/guild/member.ts @@ -1,6 +1,7 @@ import { SlashCommandSubcommandBuilder } from "discord.js" import { devMessage, embedColor } from "~/config/options" import { SubCommand } from "~/typings" +import emoji from "~/utils/Functions/emoji" import { dateTimeFormatter, numberFormatter } from "~/utils/Functions/intlFormaters" import { getGuild, getHeadURL, getPlayer, getUUID } from "~/utils/Hypixel" @@ -32,7 +33,7 @@ const cmd: SubCommand = async ({ interaction }) => { if (!uuid) { interaction.editReply({ embeds: [{ - description: " That player does not exist.", + description: emoji("questionmark") + " That player does not exist.", color: embedColor }] }) @@ -51,7 +52,7 @@ const cmd: SubCommand = async ({ interaction }) => { if (!player) { await interaction.editReply({ embeds: [{ - description: " That player hasn't played Hypixel before.", + description: emoji("questionmark") + " That player hasn't played Hypixel before.", color: embedColor, thumbnail: { url: head! diff --git a/src/commands/guild/top.ts b/src/commands/guild/top.ts index fdf3298..0fab466 100644 --- a/src/commands/guild/top.ts +++ b/src/commands/guild/top.ts @@ -1,6 +1,7 @@ import { SlashCommandSubcommandBuilder } from "discord.js" import { devMessage, embedColor } from "~/config/options" import { IGuildData, SubCommand } from "~/typings" +import emoji from "~/utils/Functions/emoji" import { numberFormatter } from "~/utils/Functions/intlFormaters" import { getGuild, getIGN, getPlayer, getUUID } from "~/utils/Hypixel" import { redis } from "~/utils/Illegitimate" @@ -50,7 +51,7 @@ const cmd: SubCommand = async ({ interaction }) => { if (!uuid) { interaction.editReply({ embeds: [{ - description: " That player does not exist.", + description: emoji("questionmark") + " That player does not exist.", color: embedColor }] }) @@ -68,7 +69,7 @@ const cmd: SubCommand = async ({ interaction }) => { if (!player) { interaction.editReply({ embeds: [{ - description: " That player hasn't played Hypixel before.", + description: emoji("questionmark") + " That player hasn't played Hypixel before.", color: embedColor }] }) diff --git a/src/commands/staff/beast.ts b/src/commands/staff/beast.ts index 6bdf69c..c9b2f9e 100644 --- a/src/commands/staff/beast.ts +++ b/src/commands/staff/beast.ts @@ -2,6 +2,7 @@ import { SlashCommandSubcommandBuilder } from "discord.js" import { devMessage, embedColor } from "~/config/options" import { beastbwfkdr, beastbwstars, beastduelswins, beastswkdr, beastswstars, bwwins, duelswlr } from "~/config/reqs" import { SubCommand } from "~/typings" +import emoji from "~/utils/Functions/emoji" import { bedwarsLevel, getGuild, getHeadURL, getPlayer, getUUID, hypixelLevel, skywarsLevel } from "~/utils/Hypixel" export const beastSub = new SlashCommandSubcommandBuilder() @@ -30,7 +31,7 @@ const cmd: SubCommand = async ({ interaction }) => { if (!uuid) { interaction.editReply({ embeds: [{ - description: " That player does not exist.", + description: emoji("questionmark") + " That player does not exist.", color: embedColor }] }) @@ -49,7 +50,7 @@ const cmd: SubCommand = async ({ interaction }) => { if (!player) { interaction.editReply({ embeds: [{ - description: " That player hasn't played Hypixel before.", + description: emoji("questionmark") + " That player hasn't played Hypixel before.", color: embedColor }] }) @@ -100,7 +101,7 @@ const cmd: SubCommand = async ({ interaction }) => { if (!player.stats) { statsFields.push({ - name: " This player never played any games.", + name: emoji("warning") + " This player never played any games.", value: "**➺ Stats:** `None`" }) } else { @@ -114,9 +115,9 @@ const cmd: SubCommand = async ({ interaction }) => { let bwtitle = "" if (hsbwstars < beastbwstars || hsbwfkdr < beastbwfkdr || hsbwwins < bwwins) { - bwtitle = " This player does not meet the BedWars requirements." + bwtitle = emoji("cross") + " This player does not meet the BedWars requirements." } else { - bwtitle = " This player meets the BedWars requirements." + bwtitle = emoji("checkmark") + " This player meets the BedWars requirements." } statsFields.push({ @@ -130,7 +131,7 @@ const cmd: SubCommand = async ({ interaction }) => { }) } else { statsFields.push({ - name: " This player never played BedWars.", + name: emoji("warning") + " This player never played BedWars.", value: "**➺ Stats:** `None`" }) } @@ -145,9 +146,9 @@ const cmd: SubCommand = async ({ interaction }) => { let swtitle = "" if (hsswstars < beastswstars || hsswkd < beastswkdr) { - swtitle = " This player does not meet the SkyWars requirements." + swtitle = emoji("cross") + " This player does not meet the SkyWars requirements." } else { - swtitle = " This player meets the SkyWars requirements." + swtitle = emoji("checkmark") + " This player meets the SkyWars requirements." } statsFields.push({ @@ -160,7 +161,7 @@ const cmd: SubCommand = async ({ interaction }) => { }) } else { statsFields.push({ - name: " This player never played SkyWars.", + name: emoji("warning") + " This player never played SkyWars.", value: "**➺ Stats:** `None`" }) } @@ -175,9 +176,9 @@ const cmd: SubCommand = async ({ interaction }) => { let duelstitle = "" if (hsduelswins < beastduelswins || hsduelswlr < duelswlr) { - duelstitle = " This player does not meet the Duels requirements." + duelstitle = emoji("cross") + " This player does not meet the Duels requirements." } else { - duelstitle = " This player meets the Duels requirements." + duelstitle = emoji("checkmark") + " This player meets the Duels requirements." } statsFields.push({ @@ -190,7 +191,7 @@ const cmd: SubCommand = async ({ interaction }) => { }) } else { statsFields.push({ - name: " This player never played Duels.", + name: emoji("warning") + " This player never played Duels.", value: "**➺ Stats:** `None`" }) } diff --git a/src/commands/test.ts b/src/commands/test.ts new file mode 100644 index 0000000..d751416 --- /dev/null +++ b/src/commands/test.ts @@ -0,0 +1,18 @@ +import { SlashCommandBuilder } from "discord.js" +import { ICommand } from "~/typings" +import emoji from "~/utils/Functions/emoji" + +export default { + name: "test", + description: "Test command", + public: false, + dev: true, + data: new SlashCommandBuilder() + .setName("test") + .setDescription("Test command"), + async execute({ interaction }) { + await interaction.reply({ + content: `${emoji("questionmark")} ${emoji("warning")} ${emoji("cross")} ${emoji("checkmark")}` + }) + } +} as ICommand diff --git a/src/commands/uuid.ts b/src/commands/uuid.ts index b9ddde6..34a8a23 100644 --- a/src/commands/uuid.ts +++ b/src/commands/uuid.ts @@ -1,6 +1,7 @@ import { InteractionContextType, SlashCommandBuilder } from "discord.js" import { devMessage, embedColor } from "~/config/options" import { ICommand } from "~/typings" +import emoji from "~/utils/Functions/emoji" import { formatUuid, getHeadURL, getIGN, getUUID } from "~/utils/Hypixel" export default { @@ -31,7 +32,7 @@ export default { if (!uuid) { interaction.editReply({ embeds: [{ - description: " That player does not exist.", + description: emoji("questionmark") + " That player does not exist.", color: embedColor }] }) diff --git a/src/commands/verify.ts b/src/commands/verify.ts index 33c9fb8..5811824 100644 --- a/src/commands/verify.ts +++ b/src/commands/verify.ts @@ -2,6 +2,7 @@ import { GuildMember, InteractionContextType, SlashCommandBuilder } from "discor import { addVerify, getVerify } from "src/drizzle/functions" import { devMessage, embedColor, hypixelGuildID } from "~/config/options" import { ICommand, IGuildData, IPlayerData } from "~/typings" +import emoji from "~/utils/Functions/emoji" import getGuildRank from "~/utils/Functions/guildrank" import roleManage from "~/utils/Functions/rolesmanage" import { getGuild, getHeadURL, getPlayer, getUUID } from "~/utils/Hypixel" @@ -48,7 +49,7 @@ export default { if (!uuid) { interaction.editReply({ embeds: [{ - description: " That player does not exist.", + description: emoji("questionmark") + " That player does not exist.", color: embedColor }] }) @@ -67,7 +68,7 @@ export default { if (!player) { interaction.editReply({ embeds: [{ - description: " That player hasn't played Hypixel before.", + description: emoji("questionmark") + " That player hasn't played Hypixel before.", color: embedColor }] }) @@ -87,7 +88,7 @@ export default { if (!linkedDiscord) { interaction.editReply({ embeds: [{ - description: " There is no Discord account linked to `" + player.displayname + "`.\n\n" + + description: emoji("cross") + " There is no Discord account linked to `" + player.displayname + "`.\n\n" + "**Please set your Discord tag on hypixel to `" + username + "` and try again.**", color: embedColor }] @@ -98,7 +99,7 @@ export default { if (linkedDiscord !== username) { interaction.editReply({ embeds: [{ - description: " The Discord account linked to `" + + description: emoji("cross") + " The Discord account linked to `" + player.displayname + "` is currently `" + linkedDiscord + "`\n\n" + "**Please set your Discord tag on hypixel to `" + username + "` and try again.**", color: embedColor diff --git a/src/components/buttons/checkstats.ts b/src/components/buttons/checkstats.ts index 41b2279..70e4118 100644 --- a/src/components/buttons/checkstats.ts +++ b/src/components/buttons/checkstats.ts @@ -2,6 +2,7 @@ import { getGuildApp } from "src/drizzle/functions" import { devMessage, embedColor } from "~/config/options" import { bwfkdr, bwstars, bwwins, duelswins, duelswlr, swkdr, swstars } from "~/config/reqs" import { IButton } from "~/typings" +import emoji from "~/utils/Functions/emoji" import { bedwarsLevel, getGuild, getHeadURL, getPlayer, hypixelLevel, skywarsLevel } from "~/utils/Hypixel" export default { @@ -21,7 +22,7 @@ export default { if (!player) { interaction.editReply({ embeds: [{ - description: " That player hasn't played Hypixel before.", + description: emoji("questionmark") + " That player hasn't played Hypixel before.", color: embedColor }] }) @@ -73,7 +74,7 @@ export default { const statsFields = [] if (!player.stats) { statsFields.push({ - name: " This player never played any games.", + name: emoji("warning") + " This player never played any games.", value: "**➺ Stats:** `None`" }) } else { @@ -87,9 +88,9 @@ export default { let bwtitle = "" if (hsbwstars < bwstars || hsbwfkdr < bwfkdr || hsbwwins < bwwins) { - bwtitle = " This player does not meet the BedWars requirements." + bwtitle = emoji("cross") + " This player does not meet the BedWars requirements." } else { - bwtitle = " This player meets the BedWars requirements." + bwtitle = emoji("checkmark") + " This player meets the BedWars requirements." } statsFields.push({ @@ -113,9 +114,9 @@ export default { let swtitle = "" if (hsswstars < swstars || hsswkd < swkdr) { - swtitle = " This player does not meet the SkyWars requirements." + swtitle = emoji("cross") + " This player does not meet the SkyWars requirements." } else { - swtitle = " This player meets the SkyWars requirements." + swtitle = emoji("checkmark") + " This player meets the SkyWars requirements." } statsFields.push({ @@ -138,9 +139,9 @@ export default { let duelstitle = "" if (hsduelswins < duelswins || hsduelswlr < duelswlr) { - duelstitle = " This player does not meet the Duels requirements." + duelstitle = emoji("cross") + " This player does not meet the Duels requirements." } else { - duelstitle = " This player meets the Duels requirements." + duelstitle = emoji("checkmark") + " This player meets the Duels requirements." } statsFields.push({ diff --git a/src/utils/Functions/applicationquestions.ts b/src/utils/Functions/applicationquestions.ts index 9fd8bea..f1583e7 100644 --- a/src/utils/Functions/applicationquestions.ts +++ b/src/utils/Functions/applicationquestions.ts @@ -1,6 +1,7 @@ import { Collection, EmbedBuilder, GuildMember, Message } from "discord.js" import { embedColor } from "~/config/options" import { getUUID } from "~/utils/Hypixel" +import emoji from "./emoji" const tooLong = new EmbedBuilder() .setDescription("You took too long to respond.") @@ -59,7 +60,7 @@ export default async function applicationQuestions( if (!uuid) { await user.send({ embeds: [{ - description: " That player does not exist." + + description: emoji("questionmark") + " That player does not exist." + "Application cancelled.", color: embedColor }] diff --git a/src/utils/Functions/emoji.ts b/src/utils/Functions/emoji.ts new file mode 100644 index 0000000..0aefe2e --- /dev/null +++ b/src/utils/Functions/emoji.ts @@ -0,0 +1,13 @@ +const emojis = { + questionmark: { name: "questionmark_pink", type: "a", id: "1130206038008803488" }, + warning: { name: "_warning", type: "a", id: "1178350183457751100" }, + cross: { name: "cross_a", type: "a", id: "1087808606897983539" }, + checkmark: { name: "check_a", type: "a", id: "1087808632172847134" } +} + +type Emoji = keyof typeof emojis + +export default function emoji(emoji: Emoji) { + const e = emojis[emoji] + return `<${e.type}:${e.name}:${e.id}>` +}