Skip to content

Allow defining update types when handling updates via getUpdates method #1202

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

Conversation

noplanman
Copy link
Member

? !
Type bug
BC Break no
Fixed issues #1201

Summary

Add an extra parameter to Telegram::handleGetUpdates to define allowed types. If no update types are passed, allow ALL update types, to make sure that special ones like chat_member (which MUST be defined to receive) also get fetched.

…add extra parameter to define allowed types
@noplanman noplanman force-pushed the 1201-allowed_updates-for-getupdates branch from cdb8846 to 2c193f5 Compare April 6, 2021 14:50
Copy link

@massadm massadm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with changes.

One remark. allowed_updates is optional and can be empty list to receive all update types except chat_member and this should be the default behavior.

@noplanman
Copy link
Member Author

@massadm I understand what you mean. The main reason I did it like this, is that only updates that are "known" by the library come through, to prevent any breakage in the future when new types get defined.

I agree with you though, that the default behaviour should be what Telegram sends without specifying anything, will change this 👍

@noplanman noplanman changed the title Allow all update types by default when using getUpdates method Allow defining update types when handling updates via getUpdates method Apr 8, 2021
@noplanman noplanman merged commit cb9868e into php-telegram-bot:develop Apr 8, 2021
@noplanman noplanman deleted the 1201-allowed_updates-for-getupdates branch April 8, 2021 12:06
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