mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: strip @botname from commands so /new@TigerNanoBot resolves correctly (#3581)
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. Co-authored-by: MacroAnarchy <MacroAnarchy@users.noreply.github.com>
This commit is contained in:
parent
df1bf0a209
commit
d6b4fa2e9f
2 changed files with 16 additions and 1 deletions
|
|
@ -333,7 +333,10 @@ class MessageEvent:
|
|||
return None
|
||||
# Split on space and get first word, strip the /
|
||||
parts = self.text.split(maxsplit=1)
|
||||
return parts[0][1:].lower() if parts else None
|
||||
raw = parts[0][1:].lower() if parts else None
|
||||
if raw and "@" in raw:
|
||||
raw = raw.split("@", 1)[0]
|
||||
return raw
|
||||
|
||||
def get_command_args(self) -> str:
|
||||
"""Get the arguments after a command."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue