timoniq / telegrinder

Modern visionary telegram bot framework
MIT License
31 stars 5 forks source link

`IsPrivate` rule (and some other) do not support `CallbackQueryCute` even when the latter must be supported #83

Closed prostomarkeloff closed 3 months ago

prostomarkeloff commented 3 months ago

⚪️ Checklist ⚪️

✏️ Description ✏️

IsPrivate rule (and some other) do not support CallbackQueryCute even when the latter must be supported.

IsPrivate rule checks if chat_type is private. Message does support it and IsPrivate inherits from MessageRule that doesn't let anything but Message go there. There should be something like CallbackQueryOrMessageRule, adapter of which supports both Message and CallbackQuery

timoniq commented 3 months ago

CallbackQueryOrMessageRule -> probably SourceAdapter

also a node might be created for compositional approach (PrivateSource / PublicSource)

luwqz1 commented 3 months ago

i did this: https://github.com/timoniq/telegrinder/blob/dev/telegrinder/bot/rules/is_from.py#L28