Skip to content
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 faster check #1074

Merged
merged 5 commits into from Apr 17, 2018

Conversation

Projects
None yet
4 participants
@wagnerluis1982
Copy link
Contributor

wagnerluis1982 commented Apr 13, 2018

Make the filters applied to a command to execute only if the command name matches. This solves the problem described in #1073

@wagnerluis1982

This comment has been minimized.

Copy link
Contributor Author

wagnerluis1982 commented Apr 14, 2018

I forgot to say, this fixes #1073

@erickmendonca
Copy link

erickmendonca left a comment

Looks good to me. Avoids processing filters if not needed.

@jh0ker

This comment has been minimized.

Copy link
Member

jh0ker commented Apr 14, 2018

Thanks a lot for your contribution @wagnerluis1982

The fix looks good, but it would be great to have a test to ensure we won't have regressions on this in the future.

I see you are a first-time contributor, would you like to add your name to the contributor list?

@jh0ker

This comment has been minimized.

Copy link
Member

jh0ker commented Apr 14, 2018

@wagnerluis1982 A good test case would be to show that a filter on a command handler is not executed when the command in a message does not match the command defined in the handler.

@tsnoam

tsnoam approved these changes Apr 16, 2018

Copy link
Member

tsnoam left a comment

LGTM. Just waiting for tests to succeed (restarted the py3.5 on travis)

@tsnoam

This comment has been minimized.

Copy link
Member

tsnoam commented Apr 16, 2018

darn, forgot there are no unitests. yeah we need them.
@wagnerluis1982 if you don't manage to get to it we'll add them but it'll take us a while since we have lot on our plate.

jh0ker added some commits Apr 16, 2018

@jh0ker

This comment has been minimized.

Copy link
Member

jh0ker commented Apr 16, 2018

I added a unit test 👍

@wagnerluis1982

This comment has been minimized.

Copy link
Contributor Author

wagnerluis1982 commented Apr 16, 2018

@jh0ker Sorry the delay, I was off in the weekend.

The fix looks good, but it would be great to have a test to ensure we won't have regressions on this in the future.

I was so eager to fix the issue that I didn't remember tests 🙄. I see you already did, so I'm too late now...

I see you are a first-time contributor, would you like to add your name to the contributor list?

It's always good 😄. Since I actively develop one bot, I intend to contribute more to the project.

jh0ker and others added some commits Apr 16, 2018

@tsnoam tsnoam merged commit 5efd5e2 into python-telegram-bot:master Apr 17, 2018

5 checks passed

Hound No violations found. Woof!
codecov/patch 100% of diff hit (target 92.56%)
Details
codecov/project Absolute coverage decreased by -0.1% but relative coverage increased by +7.43% compared to 59659ea
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@tsnoam

This comment has been minimized.

Copy link
Member

tsnoam commented Apr 17, 2018

@wagnerluis1982 thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.