Instead of lowercasing before string comparison, use equal fold
MODIFY
discordutil/guilds.go
discordutil/guilds.go
@@ -66,7 +66,8 @@ func FindEmojiInGuild(session *discordgo.Session, guild *discordgo.Guild, omitGW
continue
}
- if strings.ToLower(emoji.Name) == emojiSequence && (omitGWCheck || strings.HasPrefix(emoji.Name, "GW")) {
+
+ if strings.EqualFold(emoji.Name, emojiSequence) && (omitGWCheck || strings.HasPrefix(emoji.Name, "GW")) {
if len(emoji.Roles) != 0 {
selfMember, cacheError := session.State.Member(guild.ID, session.State.User.ID)
if cacheError != nil {

MODIFY
ui/window.go
ui/window.go
@@ -1555,7 +1555,7 @@ INDEX_LOOP:
window.session.State.User.PremiumType == discordgo.UserPremiumTypeNitro {
for _, guild := range window.session.State.Guilds {
for _, emoji := range guild.Emojis {
- if strings.ToLower(emoji.Name) == emojiSequence {
+ if strings.EqualFold(emoji.Name, emojiSequence) {
var emojiRunes []rune
if emoji.Animated {
emojiRunes = []rune("<a:" + emoji.Name + ":" + emoji.ID + ">")

Instead of lowercasing before string comparison, use equal fold