mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update builtin.py (#510)
* 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. * Update aiogram/dispatcher/filters/builtin.py Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
This commit is contained in:
parent
6c423d2b92
commit
8612a64b3c
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 isinstance(obj, 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