mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update builtin.py
In StateFilter check if object is CallbackQuery because it has different structure compared to simple message. This change prevents https://github.com/aiogram/aiogram/issues/508 bug.
This commit is contained in:
parent
9de257efec
commit
9a7408361c
1 changed files with 2 additions and 0 deletions
|
|
@ -529,6 +529,8 @@ class StateFilter(BoundFilter):
|
|||
self.states = states
|
||||
|
||||
def get_target(self, obj):
|
||||
if type(obj) is CallbackQuery:
|
||||
return getattr(getattr(getattr(obj, 'message', None),'chat', None), 'id', None), getattr(getattr(obj, 'from_user', None), 'id', None)
|
||||
return getattr(getattr(obj, 'chat', None), 'id', None), getattr(getattr(obj, 'from_user', None), 'id', None)
|
||||
|
||||
async def check(self, obj):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue