Skip to content

Commit

Permalink
Refactoring FoxyEmotes
Browse files Browse the repository at this point in the history
  • Loading branch information
WinG4merBR committed Jan 24, 2025
1 parent f3e439c commit f44dd54
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 66 deletions.
84 changes: 40 additions & 44 deletions common/src/main/kotlin/net/cakeyfox/common/FoxyEmotes.kt
Original file line number Diff line number Diff line change
@@ -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 = "<a:foxy_see:817493038053326858>"
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 = "<a:foxy_petpet:1288229687163752590>"
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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AskFoxyExecutor: FoxyCommandExecutor() {

context.reply {
content = pretty(
FoxyEmotes.FoxyThink,
FoxyEmotes.FoxyHm,
getRandomAnswer(answers)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion foxy/src/main/kotlin/net/cakeyfox/foxy/utils/FoxyUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class FoxyUtils(

actionRow(
foxy.interactionManager.createLinkButton(
FoxyEmotes.FoxyCupcake,
FoxyEmotes.FoxyCake,
context.locale["ban.appealButton"],
Constants.UNBAN_FORM_URL
)
Expand Down
7 changes: 2 additions & 5 deletions foxy/src/main/kotlin/net/cakeyfox/foxy/utils/PrettyMessage.kt
Original file line number Diff line number Diff line change
@@ -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"
}
1 change: 1 addition & 0 deletions foxy/src/main/resources/locales/en-us/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions foxy/src/main/resources/locales/pt-br/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f44dd54

Please sign in to comment.