Use chat_action instead of placeholder text

This commit is contained in:
Davte 2020-02-20 10:22:24 +01:00
parent 50872e9ca7
commit 2d2aadd4c1
2 changed files with 10 additions and 9 deletions

View File

@ -3,7 +3,7 @@
__author__ = "Davide Testa" __author__ = "Davide Testa"
__email__ = "davide@davte.it" __email__ = "davide@davte.it"
__license__ = "GNU General Public License v3.0" __license__ = "GNU General Public License v3.0"
__version__ = "1.1.8" __version__ = "1.1.9"
__maintainer__ = "Davide Testa" __maintainer__ = "Davide Testa"
__contact__ = "t.me/davte" __contact__ = "t.me/davte"

View File

@ -9,6 +9,7 @@ import datetime
import math import math
# Third party modules # Third party modules
import davtelepot
from davtelepot.utilities import ( from davtelepot.utilities import (
async_wrapper, CachedPage, extract, get_cleaned_text, async_wrapper, CachedPage, extract, get_cleaned_text,
line_drawing_unordered_list, make_button, make_inline_keyboard, line_drawing_unordered_list, make_button, make_inline_keyboard,
@ -567,21 +568,21 @@ async def cancel_ciclopi_location(bot, update, user_record):
) )
async def _ciclopi_command(bot, update, user_record, sent_message=None, async def _ciclopi_command(bot: davtelepot.bot.Bot, update, user_record, sent_message=None,
show_all=False): show_all=False):
chat_id = update['chat']['id'] chat_id = update['chat']['id']
default_stations_to_show = 5 default_stations_to_show = 5
stations = [] stations = []
placeholder_id = bot.set_placeholder( placeholder_id = bot.set_placeholder(
timeout=datetime.timedelta(seconds=1), timeout=datetime.timedelta(seconds=1),
sent_message=sent_message,
chat_id=chat_id, chat_id=chat_id,
text="<i>{message}...</i>".format( # sent_message=sent_message,
message=bot.get_message( # text="<i>{message}...</i>".format(
'ciclopi', 'command', 'updating', # message=bot.get_message(
update=update, user_record=user_record # 'ciclopi', 'command', 'updating',
) # update=update, user_record=user_record
) # )
# )
) )
ciclopi_data = await ciclopi_webpage.get_page() ciclopi_data = await ciclopi_webpage.get_page()
if ciclopi_data is None or isinstance(ciclopi_data, Exception): if ciclopi_data is None or isinstance(ciclopi_data, Exception):