From bb439d1e1f080440950fe1b1f2117d0e4e5506d9 Mon Sep 17 00:00:00 2001 From: Dmitrii Morozov Date: Mon, 24 Jun 2024 17:35:13 +0200 Subject: Answer callback query --- telegram_bot/__init__.py | 3 +++ telegram_bot/commands.py | 1 + 2 files changed, 4 insertions(+) diff --git a/telegram_bot/__init__.py b/telegram_bot/__init__.py index 0818d67..ebc8c47 100644 --- a/telegram_bot/__init__.py +++ b/telegram_bot/__init__.py @@ -44,6 +44,9 @@ class TelegramBot: callback=callback_query_handler.handle, func=filter) + async def answer_callback_query(self, callback_query_id): + await self.__bot.answer_callback_query(callback_query_id=callback_query_id) + async def send_message_to_all(self, message_text: str): for user in self.__user_repository.get_all_users(): try: diff --git a/telegram_bot/commands.py b/telegram_bot/commands.py index 5d4a849..c5e02ed 100644 --- a/telegram_bot/commands.py +++ b/telegram_bot/commands.py @@ -75,6 +75,7 @@ class GetStatsCallbackQueryHandler(CallbackQueryHandler): await self.reply_with_stats_days_difference(call.message, 7, 'week') elif call.data == __stats_month__: await self.reply_with_stats_days_difference(call.message, 30, 'month') + await self.__telegram_bot.answer_callback_query(callback_query_id=call.id) async def reply_with_today_stats(self, message): friends = await self.__fortnite_client.get_friends() -- cgit v1.2.3