mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Fix current state context getter for updates where chat is not presented.
This commit is contained in:
parent
43dddcafe4
commit
cf8df06f63
1 changed files with 4 additions and 2 deletions
|
|
@ -847,9 +847,11 @@ class Dispatcher:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
if chat is None:
|
if chat is None:
|
||||||
chat = types.Chat.current().id
|
chat_obj = types.Chat.current()
|
||||||
|
chat = chat_obj.id if chat_obj else None
|
||||||
if user is None:
|
if user is None:
|
||||||
user = types.User.current().id
|
user_obj = types.User.current()
|
||||||
|
user = user_obj.id if user_obj else None
|
||||||
|
|
||||||
return FSMContext(storage=self.storage, chat=chat, user=user)
|
return FSMContext(storage=self.storage, chat=chat, user=user)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue