openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

bug: Discord GM bot command matching is case-sensitive — should be case-insensitive

Open Al629176 opened this issue 5 months ago • 2 comments

Bug: Discord GM bot command is case-sensitive — "gm" vs "GM" treated differently

Epic: #4192 — Discord Integration

Observed behaviour: The Discord GM (Good Morning) bot only triggers on an exact case match of the command/keyword. Users typing "gm", "Gm", or "GM" get inconsistent results depending on casing.

Expected behaviour: All command matching in the Discord bot should be case-insensitive. "gm", "GM", "Gm", "gM" should all be treated identically.

Fix:

  • Normalise incoming message content to lowercase (or uppercase) before matching against trigger keywords
  • Apply the same normalisation to all bot commands, not just GM
  • Check src/openhuman/channels/ or the Discord scanner module (app/src-tauri/src/discord_scanner.rs) for the pattern match logic

Labels: bug, P2

Al629176 avatar Jun 26 '26 15:06 Al629176

Part of epic #4190 — Tiny Place.

Al629176 avatar Jun 28 '26 10:06 Al629176

This bug doesn't reproduce. Matching is already case-insensitive — select_acknowledgment_reaction in src/openhuman/channels/runtime/dispatch/helpers.rs lowercases input before any comparison:

let l = content.to_lowercase();

So gm/GM/Gm/gM can't diverge. Also, there was no GM branch at all before #4251 — gm was never matched in any casing, so the "lowercase works, uppercase doesn't" symptom can't occur. And the referenced app/src-tauri/src/discord_scanner.rs doesn't exist (404).

There's no case-sensitivity defect here. #4251 doesn't fix casing — it adds a new GM greeting category. Suggest closing as invalid, or relabeling to "enhancement: add GM greeting acknowledgment" if the category is wanted.

YellowSnnowmann avatar Jun 30 '26 07:06 YellowSnnowmann