Removed unnecessary awaits
This commit is contained in:
+5
-5
@@ -28,7 +28,7 @@ class TelegramHelper:
|
||||
|
||||
async def clear(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
user_id = update.effective_user.id
|
||||
await self.bot.clear_conversation_history(user_id)
|
||||
self.bot.clear_conversation_history(user_id)
|
||||
await update.message.reply_text("Conversation history cleared. Let's start fresh!")
|
||||
|
||||
async def status(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
@@ -61,13 +61,13 @@ class TelegramHelper:
|
||||
|
||||
logging.info(f"Message from user {user_id}: {user_message}")
|
||||
|
||||
status_message = await update.message.reply_text("Processing your request...", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("Abort", callback_data='abort')]]))\
|
||||
await self.bot.set_processing_status(user_id, status_message.message_id)
|
||||
status_message = await update.message.reply_text("Processing your request...", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("Abort", callback_data='abort')]]))
|
||||
self.bot.set_processing_status(user_id, status_message.message_id)
|
||||
|
||||
response = await self.bot.handle_message(user_id, user_message)
|
||||
|
||||
await context.bot.delete_message(chat_id=update.effective_chat.id, message_id=status_message.message_id)
|
||||
await self.bot.clear_processing_status(user_id)
|
||||
self.bot.clear_processing_status(user_id)
|
||||
|
||||
response = response.replace("<think>", self.HTML_QUOTE_BLOCK_START).replace("</think>", self.HTML_QUOTE_BLOCK_END)
|
||||
|
||||
@@ -126,7 +126,7 @@ class TelegramHelper:
|
||||
application.add_handler(CommandHandler("status", self.status))
|
||||
application.add_handler(CommandHandler("reboot", self.reboot))
|
||||
application.add_handler(CommandHandler("browse", self.browse))
|
||||
application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, self.handle_message))\
|
||||
application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, self.handle_message))
|
||||
application.add_handler(CallbackQueryHandler(self.abort_processing, pattern='^abort$'))
|
||||
application.add_handler(CallbackQueryHandler(button_callback, pattern='^(browse|file):'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user