From 67261413a76819ad2ef16182f56e2c4b61b21012 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Sun, 25 Feb 2024 12:52:08 +0100 Subject: Fixed multiple edge cases with /gfs. (#1055) --- .../features/commands/tabcomplete/GetFromSacksTabComplete.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/GetFromSacksTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/GetFromSacksTabComplete.kt index 424d72198..331c19fb0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/GetFromSacksTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/GetFromSacksTabComplete.kt @@ -25,12 +25,12 @@ object GetFromSacksTabComplete { if (event.senderIsSkyhanni()) return event - if (event.splitMessage.isEmpty()) return event + if (event.splitMessage.size < 3) return event - val rawName = event.splitMessage[1].uppercase() + val rawName = event.splitMessage.drop(1).dropLast(1).joinToString(" ") val realName = rawName.replace("_", " ") if (realName == rawName) return event - if (realName !in GetFromSackAPI.sackListNames) return event + if (realName.uppercase() !in GetFromSackAPI.sackListNames) return event return event.eventWithNewMessage(event.message.replace(rawName, realName)) } -- cgit