mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Change error message for missing keys in the context.
This commit is contained in:
parent
c567b77a00
commit
62d5dda84d
2 changed files with 6 additions and 5 deletions
|
|
@ -138,10 +138,8 @@ class TelegramObject(metaclass=MetaTelegramObject):
|
|||
|
||||
@property
|
||||
def bot(self):
|
||||
bot = get_value('bot')
|
||||
if bot is None:
|
||||
raise RuntimeError('Can not found bot instance in current context!')
|
||||
return bot
|
||||
from ..dispatcher import ctx
|
||||
return ctx.get_bot()
|
||||
|
||||
def to_python(self) -> typing.Dict:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue