Skip to content

Autoselect SystemCommand from existing Commands #940

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

Merged
merged 3 commits into from
Mar 23, 2019

Conversation

noplanman
Copy link
Member

@noplanman noplanman commented Mar 22, 2019

As suggested by @jacklul here: #920 (comment)

Message field types can now automatically choose which command class gets loaded to execute.
If none is defined, GenericmessageCommand is executed by default.
Removed all empty dummy SystemCommands from library.

❗ This can create problems for any project that does not specifically implement SystemCommands that handle all different types, as now GenericmessageCommand gets called for all of them, whereas before they would just be handled silently.
For this reason, SystemCommands must now either be dummied specifically, or GenericmessageCommand must handle the conditions to work correctly.

@jacklul What do you think, does this make sense? Or should we leave the current dummies as they are to preserve backwards compatibility and minimise any possible breakage?

Overrules and closes #921
Fixes #920

@noplanman noplanman requested a review from jacklul March 22, 2019 22:24
Remove all dummy commands from library. This may break backwards compat!!
@noplanman noplanman force-pushed the 920-new_system_commands branch from 8add74e to da604d8 Compare March 22, 2019 22:47
@jacklul
Copy link
Collaborator

jacklul commented Mar 23, 2019

Maybe we could add deprecation notice into generic one to notify people about this change?
Other than that this looks solid

@noplanman
Copy link
Member Author

@jacklul Perfect, I'll do that then for now. At some point they'll be removed completely though.

@noplanman noplanman changed the title WIP Autoselect SystemCommand from existing Commands Autoselect SystemCommand from existing Commands Mar 23, 2019
@noplanman noplanman merged commit 0efd567 into php-telegram-bot:develop Mar 23, 2019
@noplanman noplanman deleted the 920-new_system_commands branch March 23, 2019 22:02
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