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

Refactor: Replace Custom Events with Filter Queries #11

Open
JumpLink opened this issue Feb 9, 2024 · 0 comments
Open

Refactor: Replace Custom Events with Filter Queries #11

JumpLink opened this issue Feb 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@JumpLink
Copy link
Collaborator

JumpLink commented Feb 9, 2024

The Telegram Bot uses grammY, which is a Telegram Bot Framework.

Currently, the internal Telegram Bot events are split into several events using a own implementation via EventService.emitDetailedEvents. If, for example, the event callback_query:data:show-callout-slug:my-callout is triggered, this method ensures that several events are generated:

  • callback_query
  • callback_query:user-123456789
  • callback_query:data
  • callback_query:data:user-123456789
  • callback_query:data:show-callout-slug * callback_query:data:show-callout-slug
  • callback_query:data:show-callout-slug:user-123456789
  • callback_query:data:show-callout-slug:my-callout
  • callback_query:data:show-callout-slug:my-callout:user-123456789

This allows you to listen for the event that is most suitable for you at the moment.

What I saw too late is that grammY already has its own solution for this, which is also much more powerful, namely so-called Filter Queries. We should refactor the bot so that the custom implementation can be removed and should use Filter Queries instead.

@JumpLink JumpLink added the enhancement New feature or request label Feb 9, 2024
@JumpLink JumpLink changed the title Replace Custom Events with Filter Queries Refactor: Replace Custom Events with Filter Queries Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant