Fix current state context getter for updates where chat is not presented.

This commit is contained in:
Alex Root Junior 2018-07-02 00:36:12 +03:00
parent 43dddcafe4
commit cf8df06f63

View file

@ -847,9 +847,11 @@ class Dispatcher:
:return:
"""
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:
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)