Change error message for missing keys in the context.

This commit is contained in:
Alex Root Junior 2017-12-22 05:35:31 +02:00
parent c567b77a00
commit 62d5dda84d
2 changed files with 6 additions and 5 deletions

View file

@ -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:
"""