Coroutines must be awaited!

Accept format keyword arguments.
This commit is contained in:
Davte 2018-11-25 00:56:59 +01:00
parent 269f167be5
commit b0d97265b5
3 changed files with 7 additions and 4 deletions

View File

@ -7,7 +7,7 @@ __author__ = "Davide Testa"
__email__ = "davte@libero.it"
__credits__ = "Marco Origlia"
__license__ = "GNU General Public License v3.0"
__version__ = "1.4.10"
__version__ = "1.4.11"
__maintainer__ = "Davide Testa"
__contact__ = "t.me/davte"

View File

@ -101,7 +101,7 @@ async def _forward_to(update, bot, sender, addressee, is_admin=False):
pass # Remove custom parser to sender and addressee
else:
bot.set_custom_parser(
async_wrapper(
await async_wrapper(
_forward_to,
bot=bot,
sender=sender,

View File

@ -467,7 +467,8 @@ class Bot(telepot.aio.Bot, Gettable):
self.last_sending_time['absolute'] = datetime.datetime.now()
return
def get_message(self, *fields, update=None, language=None):
def get_message(self, *fields, update=None, language=None,
**format_kwargs):
"""Given a list of strings (`fields`), return proper message.
If `language` is not passed, it is extracted from `update`.
@ -517,7 +518,9 @@ class Bot(telepot.aio.Bot, Gettable):
)
)
return "Invalid message!"
return result[language]
return result[language].format(
**format_kwargs
)
async def on_inline_query(self, update):
"""Schedule handling of received inline queries.