-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CommandHandler - ignore strings in entities and "/" followed by whitespace #1020
CommandHandler - ignore strings in entities and "/" followed by whitespace #1020
Conversation
Telegram entities show that `/ test` is not a valid command. However, PTB accepts this as a valid command due to how the message splitting is done. This commit makes sure that any commands are indeed in the format of `/test`, with no space between `/` and `test`.
@PaulSonOfLars I pushed a really small fix for the PR and making sure that unitest pass. |
Small question, why do you check on |
@Eldinnie That's a smart change. Suppose the message sent to the bot is |
@tsnoam Ah that is indeed true. However /吴语 isn't a command either, and we do accept those as commands. Changing the behavior breaks with what people axpect and this changes more then only the proposed change. |
@Eldinnie We'll still support "/吴语" (up to potential problems with py2) |
Fixed the PR title to be a bit more accurate. |
05f34a5
to
ede8299
Compare
Ok so I found out what the trouble was. (And I;m pretty surprised it didn't give any trouble on other platforms). If CI finishes properly now it;s good to merge |
Awesome, glad I could help! And thanks for the debugging, I really had no clue what was going on there... Let me know if there's anything else that should be changed. |
Telegram entities show that
/ test
is not a valid command. However,PTB accepts this as a valid command due to how the message splitting is
done.
This commit makes sure that any commands are indeed in the format of
/test
, with no space between/
andtest
.