Try to use contextvars (partial)

This commit is contained in:
Alex Root Junior 2018-06-23 17:39:24 +03:00
parent c88ee7ed52
commit 8086a120c2
7 changed files with 54 additions and 7 deletions

View file

@ -137,8 +137,8 @@ class TelegramObject(metaclass=MetaTelegramObject):
@property
def bot(self):
from ..dispatcher import ctx
return ctx.get_bot()
from ..bot.bot import Bot
return Bot.current()
def to_python(self) -> typing.Dict:
"""