From f44dd545c7dedb4c51bcec9fc494b845aae8b0fc Mon Sep 17 00:00:00 2001 From: WinG4merBR <68250074+WinG4merBR@users.noreply.github.com> Date: Fri, 24 Jan 2025 20:09:52 -0300 Subject: [PATCH] Refactoring FoxyEmotes --- .../kotlin/net/cakeyfox/common/FoxyEmotes.kt | 84 +++++++++---------- .../command/component/FoxyComponentManager.kt | 4 +- .../vanilla/entertainment/AskFoxyExecutor.kt | 2 +- .../command/vanilla/social/MarryExecutor.kt | 21 +++-- .../command/vanilla/utils/HelpExecutor.kt | 9 +- .../command/vanilla/utils/PingExecutor.kt | 4 +- .../net/cakeyfox/foxy/utils/FoxyUtils.kt | 2 +- .../net/cakeyfox/foxy/utils/PrettyMessage.kt | 7 +- .../main/resources/locales/en-us/commands.yml | 1 + .../main/resources/locales/pt-br/commands.yml | 1 + 10 files changed, 69 insertions(+), 66 deletions(-) diff --git a/common/src/main/kotlin/net/cakeyfox/common/FoxyEmotes.kt b/common/src/main/kotlin/net/cakeyfox/common/FoxyEmotes.kt index 4da57cf5..bf23e471 100644 --- a/common/src/main/kotlin/net/cakeyfox/common/FoxyEmotes.kt +++ b/common/src/main/kotlin/net/cakeyfox/common/FoxyEmotes.kt @@ -1,50 +1,46 @@ package net.cakeyfox.common object FoxyEmotes { - const val FoxyYay = "1070906796274888795" - const val FoxyCry = "1071151976504627290" - const val FoxySee = "817493038053326858" - const val FoxyScared = "890688173951315988" - const val FoxyHowdy = "853366973751885854" - const val FoxyWow = "853366914054881310" - const val FoxyDaily = "915736630495686696" - const val FoxySunglasses = "890688144280784926" - const val FoxyOk = "1070726762440441876" - const val FoxyDrinkingCoffee = "1071119512352591974" - const val FoxyHug = "1071453100415668225" - const val FoxyShrug = "1149156714130702417" - const val FoxyRage = "1103700803971190895" - const val FoxyBugHunter = "1071939041819361310" - const val FoxyPray = "1084184966998536303" - const val FoxyThink = "1084105543200809060" - const val FoxyNice = "1107464573604335616" - const val FoxyBread = "891102041911468072" - const val FoxyBan = "1094787488670822450" - const val FoxyPlushie = "1131035090277896232" - const val FoxyId = "1150431883293900860" - const val Paws = "1072263834649231380" - const val ShiroFoxy = "934469525997518848" - const val FoxyCupcake = "866084383843549204" - const val Twitter = "1072251951447810168" - const val GitHub = "1072251686288113694" - const val Instagram = "1092607337564483674" - const val YouTube = "1092607821771710584" - const val TikTok = "1092607324889300992" - const val Twitch = "1225196448648269884" - const val Rock = "1083438844680085525" - const val UndertaleHeart = "1085996390813016154" - const val Roblox = "1098781084319240262" - const val ServerBooster = "1150427343681245326" - const val FoxyPetPet = "1288229687163752590" - const val Connected = "1304276804885938197" - const val Connecting = "1304280183661920348" - const val Disconnected = "1304276834892120094" - const val Unidentified = "1304276834892120094" - const val Identifying = "1304280183661920348" - const val Resuming = "1304280183661920348" - const val Offline = "1304276914265133097" - const val Kotlin = "1317932082244358215" - const val Java = "1317934020285304843" + const val FoxyYay = "<:foxy_yay:1070906796274888795>" + const val FoxyCry = "<:foxy_cry:1071151976504627290>" + const val FoxySee = "" + const val FoxyScared = "<:foxy_scared:890688173951315988>" + const val FoxyHowdy = "<:foxy_howdy:853366973751885854>" + const val FoxyWow = "<:foxy_wow:853366914054881310>" + const val FoxyDaily = "<:foxy_daily:915736630495686696>" + const val FoxySunglasses = "<:foxy_sunglasses:890688144280784926>" + const val FoxyOk = "<:foxy_ok:1070726762440441876>" + const val FoxyDrinkingCoffee = "<:foxy_drinking_coffee:1071119512352591974>" + const val FoxyHug = "<:foxy_hug:1071453100415668225>" + const val FoxyShrug = "<:foxy_shrug:1149156714130702417>" + const val FoxyRage = "<:foxy_rage:1103700803971190895>" + const val FoxyBugHunter = "<:foxybughunter:1071939041819361310>" + const val FoxyPray = "<:foxy_pray:1084184966998536303>" + const val FoxyHm = "<:foxy_hm:1084105543200809060>" + const val FoxyNice = "<:foxy_nice:1107464573604335616>" + const val FoxyBread = "<:foxy_bread:891102041911468072>" + const val FoxyBan = "<:foxy_ban:1094787488670822450>" + const val FoxyPlush = "<:foxy_plush:1131035090277896232>" + const val FoxyIdPurple = "<:foxy_id_purple:1150431883293900860>" + const val FoxyShield = "<:foxy_shield:1072263834649231380>" + const val FoxyShiro = "<:foxy_shiro:934469525997518848>" + const val FoxyCake = "<:foxy_cake:866084383843549204>" + const val Twitter = "<:twitter:1072251951447810168>" + const val GitHubLogo = "<:github_logo:1072251686288113694>" + const val Instagram = "<:instagram:1092607337564483674>" + const val YouTube = "<:youtube:1092607821771710584>" + const val TikTok = "<:tiktok:1092607324889300992>" + const val Twitch = "<:twitch:1225196448648269884>" + const val Rock = "<:rock:1083438844680085525>" + const val UndertaleHeart = "<:undertale_heart:1085996390813016154>" + const val RobloxLogoOld = "<:roblox_logo_old:1098781084319240262>" + const val FoxyPetPet = "" + const val Online = "<:online:1304276804885938197>" + const val Away = "<:away:1304280183661920348>" + const val Dnd = "<:dnd:1304276834892120094>" + const val Offline = "<:offline:1304276914265133097>" + const val Kotlin = "<:kotlin:1317932082244358215>" + const val Java = "<:java:1317934020285304843>" // Unicode Emotes const val FlagBr = "\uD83C\uDDE7\uD83C\uDDF7" diff --git a/foxy/src/main/kotlin/net/cakeyfox/foxy/command/component/FoxyComponentManager.kt b/foxy/src/main/kotlin/net/cakeyfox/foxy/command/component/FoxyComponentManager.kt index 637864b7..dc3b2a47 100644 --- a/foxy/src/main/kotlin/net/cakeyfox/foxy/command/component/FoxyComponentManager.kt +++ b/foxy/src/main/kotlin/net/cakeyfox/foxy/command/component/FoxyComponentManager.kt @@ -93,7 +93,7 @@ class FoxyComponentManager( ButtonStyle.LINK, url, label, - Emoji.fromFormatted("<:emoji:$emoji") + emoji?.let { Emoji.fromFormatted(it) } ).let { ButtonBuilder(it).apply(builder).button } @@ -112,7 +112,7 @@ class FoxyComponentManager( style, ComponentId(buttonId).toString(), label, - emoji?.let { Emoji.fromFormatted("<:emoji:$emoji") } + emoji?.let { Emoji.fromFormatted(it) } ).let { ButtonBuilder(it).apply(builder).button } diff --git a/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/entertainment/AskFoxyExecutor.kt b/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/entertainment/AskFoxyExecutor.kt index 722a4ab2..c5fef028 100644 --- a/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/entertainment/AskFoxyExecutor.kt +++ b/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/entertainment/AskFoxyExecutor.kt @@ -23,7 +23,7 @@ class AskFoxyExecutor: FoxyCommandExecutor() { context.reply { content = pretty( - FoxyEmotes.FoxyThink, + FoxyEmotes.FoxyHm, getRandomAnswer(answers) ) } diff --git a/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/social/MarryExecutor.kt b/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/social/MarryExecutor.kt index ce002225..45071bf0 100644 --- a/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/social/MarryExecutor.kt +++ b/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/social/MarryExecutor.kt @@ -24,6 +24,17 @@ class MarryExecutor : FoxyCommandExecutor() { return } + if (user.isBot) { + context.reply(true) { + content = pretty( + FoxyEmotes.FoxyCry, + context.locale["marry.cantMarryBot", user.asMention] + ) + } + + return + } + if (user.id == context.foxy.selfUser.id) { context.reply(true) { content = pretty( @@ -63,15 +74,14 @@ class MarryExecutor : FoxyCommandExecutor() { context.reply { content = pretty( FoxyEmotes.Ring, - context.locale["marry.proposal", user.asMention, context.user.asMention], - true + context.locale["marry.proposal", user.asMention, context.user.asMention] ) actionRow( context.foxy.interactionManager.createButtonForUser( user, ButtonStyle.SUCCESS, - FoxyEmotes.FoxyCupcake, + FoxyEmotes.FoxyCake, context.locale["marry.acceptButton"], ) { context.db.utils.user.updateUser( @@ -93,15 +103,14 @@ class MarryExecutor : FoxyCommandExecutor() { it.edit { content = pretty( FoxyEmotes.Ring, - context.locale["marry.accepted", user.asMention], - true + context.locale["marry.accepted", user.asMention] ) actionRow( context.foxy.interactionManager.createButtonForUser( user, ButtonStyle.SUCCESS, - FoxyEmotes.FoxyCupcake, + FoxyEmotes.FoxyCake, context.locale["marry.acceptedButton"] ) { }.asDisabled() ) diff --git a/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/HelpExecutor.kt b/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/HelpExecutor.kt index 0a61ffdf..1aa7a9d6 100644 --- a/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/HelpExecutor.kt +++ b/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/HelpExecutor.kt @@ -19,27 +19,26 @@ class HelpExecutor : FoxyCommandExecutor() { color = Colors.FOXY_DEFAULT thumbnail = context.foxy.selfUser.effectiveAvatarUrl - // Yes, using "emoji" instead of emoji name will work field { - name = context.locale["help.field.addMe", "<:emoji:${FoxyEmotes.FoxyWow}>"] + name = context.locale["help.field.addMe", FoxyEmotes.FoxyWow] value = "[${context.locale["help.field.addMeValue"]}](${Constants.INVITE_LINK})" inline = false } field { - name = context.locale["help.field.support", "<:emoji:${FoxyEmotes.FoxyHug}>"] + name = context.locale["help.field.support", FoxyEmotes.FoxyHug] value = Constants.SUPPORT_SERVER inline = false } field { - name = context.locale["help.field.website", "<:emoji:${FoxyEmotes.FoxyCupcake}>"] + name = context.locale["help.field.website", FoxyEmotes.FoxyCake] value = Constants.FOXY_WEBSITE inline = false } field { - name = context.locale["help.field.terms", "<:emoji:${FoxyEmotes.FoxyRage}>"] + name = context.locale["help.field.terms", FoxyEmotes.FoxyRage] value = Constants.TERMS inline = false } diff --git a/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/PingExecutor.kt b/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/PingExecutor.kt index 07a1623d..925942a5 100644 --- a/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/PingExecutor.kt +++ b/foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/PingExecutor.kt @@ -23,13 +23,13 @@ class PingExecutor : FoxyCommandExecutor() { color = Colors.FOXY_DEFAULT field { - name = pretty(FoxyEmotes.FoxyCupcake, "Gateway Ping:") + name = pretty(FoxyEmotes.FoxyCake, "Gateway Ping:") value = "`${gatewayPing}ms`" inline = false } field { - name = pretty(FoxyEmotes.FoxyThink, "Shard") + name = pretty(FoxyEmotes.FoxyHm, "Shard") value = "`${currentShardId}/${totalShards}`" inline = false } diff --git a/foxy/src/main/kotlin/net/cakeyfox/foxy/utils/FoxyUtils.kt b/foxy/src/main/kotlin/net/cakeyfox/foxy/utils/FoxyUtils.kt index c0fbf67a..d7eefb22 100644 --- a/foxy/src/main/kotlin/net/cakeyfox/foxy/utils/FoxyUtils.kt +++ b/foxy/src/main/kotlin/net/cakeyfox/foxy/utils/FoxyUtils.kt @@ -82,7 +82,7 @@ class FoxyUtils( actionRow( foxy.interactionManager.createLinkButton( - FoxyEmotes.FoxyCupcake, + FoxyEmotes.FoxyCake, context.locale["ban.appealButton"], Constants.UNBAN_FORM_URL ) diff --git a/foxy/src/main/kotlin/net/cakeyfox/foxy/utils/PrettyMessage.kt b/foxy/src/main/kotlin/net/cakeyfox/foxy/utils/PrettyMessage.kt index 46098d04..b3004612 100644 --- a/foxy/src/main/kotlin/net/cakeyfox/foxy/utils/PrettyMessage.kt +++ b/foxy/src/main/kotlin/net/cakeyfox/foxy/utils/PrettyMessage.kt @@ -1,8 +1,5 @@ package net.cakeyfox.foxy.utils -fun pretty(emoji: String, content: String, isUnicode: Boolean = false): String { - if (isUnicode) { - return "$emoji **|** $content" - } - return "<:emoji:$emoji> **|** $content" +fun pretty(emoji: String, content: String): String { + return "$emoji **|** $content" } \ No newline at end of file diff --git a/foxy/src/main/resources/locales/en-us/commands.yml b/foxy/src/main/resources/locales/en-us/commands.yml index 854c309a..575a6923 100644 --- a/foxy/src/main/resources/locales/en-us/commands.yml +++ b/foxy/src/main/resources/locales/en-us/commands.yml @@ -119,6 +119,7 @@ marry: userAlreadyMarried: "You can't marry someone who's already married! Stealing someone's partner is not cool!" cantMarryMe: "No, sorry, but I don't want to marry you!" cantMarryYourself: "Self-love is great, but you can't marry yourself." + cantMarryBot: "You can't marry bots!" accepted: "Proposal accepted! Best wishes to the happy couple! :3" divorce: diff --git a/foxy/src/main/resources/locales/pt-br/commands.yml b/foxy/src/main/resources/locales/pt-br/commands.yml index b093cd56..a7ca1426 100644 --- a/foxy/src/main/resources/locales/pt-br/commands.yml +++ b/foxy/src/main/resources/locales/pt-br/commands.yml @@ -119,6 +119,7 @@ marry: userAlreadyMarried: "Você não pode se casar com quem já está casado! Talaricagem é feio!" cantMarryMe: "Não, desculpa, mas eu não quero me casar com você!" cantMarryYourself: "Amor próprio é algo bom, mas você não pode casar com você mesmo" + cantMarryBot: "Você não pode se casar com bots!" accepted: "Pedido aceito! Felicidades para o casal! :3" divorce: