Skip to content

fix: strip @botname from slash commands so /new@TigerNanoBot resolves - #3550

Closed
MacroAnarchy wants to merge 1 commit into
NousResearch:mainfrom
MacroAnarchy:fix/atbotname-command
Closed

fix: strip @botname from slash commands so /new@TigerNanoBot resolves#3550
MacroAnarchy wants to merge 1 commit into
NousResearch:mainfrom
MacroAnarchy:fix/atbotname-command

Conversation

@MacroAnarchy

Copy link
Copy Markdown
Contributor

Summary

get_command() now strips the @botname suffix from Telegram bot-menu commands like /compress@TigerNanoBot before lookup.

Before: /compress@TigerNanoBot → lookup compress@tigernanobot → no match → silently ignored

After: /compress@TigerNanoBot → lookup compress → match → works correctly

Changes

  • gateway/platforms/base.py: strip @... from command name in get_command()
  • tests/gateway/test_platform_base.py: 3 new test cases for @botName variants

Test

tests/gateway/test_platform_base.py::TestMessageEventGetCommand — 8 passed

…ctly

Commands sent directly to the bot in groups include @botName suffix
(e.g. /compress@TigerNanoBot). get_command() now strips the @anything
part before lookup, matching how Telegram bot menu generates commands.
Fixes all slash commands silently doing nothing when sent with @mention.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #3581 — your commit was cherry-picked onto current main with authorship preserved. Thanks for the fix and the tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants