Repository navigation
fix: match commands addressed to the bot by username - #320
Merged
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #320 +/- ##
==========================================
+ Coverage 63.16% 63.41% +0.25%
==========================================
Files 40 40
Lines 3404 3428 +24
==========================================
+ Hits 2150 2174 +24
- Misses 1195 1196 +1
+ Partials 59 58 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #174.
In groups, a command picked from the menu arrives with the bot's username appended, like
/start@my_bot. Command handlers compare the wholestart@my_botwith the pattern, so a handler forstartnever gets it. This affects every command, not just/start.GetMenow records the bot's username, andMatchTypeCommandandMatchTypeCommandStartOnlyhandlers also match commands addressed to it, comparing the username case-insensitively./start@other_botstill doesn't match.Newalready callsGetMe, so this works by default. WithWithSkipGetMe, callGetMeyourself to enable it.SetTokenwith another bot's token clears the username.Behavior change: if a
starthandler is registered before another handler for/start@my_bot, that command now goes to thestarthandler.