bot commited on
Commit
63e542f
·
1 Parent(s): 215b80a
Files changed (1) hide show
  1. main.py +7 -7
main.py CHANGED
@@ -217,23 +217,23 @@ async def tg_emptytrash(update: Update, context):
217
  # 确认操作的回调
218
  async def handle_task_confirmation(update: Update, context: CallbackContext):
219
  query = update.callback_query
220
- query.answer()
221
 
222
  # 获取确认操作的类型和文件 ID
223
  action, task_id = query.data.split(":")[0], query.data.split(":")[1]
224
 
225
  if action == "confirm_task_delete_task":
226
  await THUNDERX_CLIENT.delete_tasks([task_id])
227
- query.edit_message_text(f"✅任务 {task_id} 已删除。")
228
 
229
 
230
  async def handle_task_cancel(update: Update, context: CallbackContext):
231
  query = update.callback_query
232
- query.answer()
233
  # 获取取消操作的类型和文件 ID
234
  action, file_id = query.data.split(":")[0], query.data.split(":")[1]
235
  # 返回文件夹列表
236
- query.edit_message_text(f"操作已取消。\n返回文件列表...")
237
 
238
 
239
  async def tg_show_task(update: Update, context: CallbackContext):
@@ -320,7 +320,7 @@ async def tg_show_task(update: Update, context: CallbackContext):
320
  # 处理任务操作的回调
321
  async def handle_tasks_operation(update: Update, context: CallbackContext):
322
  query = update.callback_query
323
- query.answer()
324
 
325
  # 获取操作类型和文件 ID
326
  action, task_id = query.data.split(":")
@@ -341,7 +341,7 @@ async def handle_tasks_operation(update: Update, context: CallbackContext):
341
  ],
342
  ]
343
  reply_markup = InlineKeyboardMarkup(keyboard)
344
- query.edit_message_text(
345
  f"你确定要{action}任务 {task_id} 吗?", reply_markup=reply_markup
346
  )
347
  else:
@@ -353,7 +353,7 @@ async def perform_task_action(
353
  update: Update, context: CallbackContext, action: str, file_id: str
354
  ):
355
  if action == "cancel_task":
356
- update.callback_query.edit_message_text(f"你选择了取消任务:{file_id}")
357
 
358
 
359
  @app.on_event("startup")
 
217
  # 确认操作的回调
218
  async def handle_task_confirmation(update: Update, context: CallbackContext):
219
  query = update.callback_query
220
+ await query.answer()
221
 
222
  # 获取确认操作的类型和文件 ID
223
  action, task_id = query.data.split(":")[0], query.data.split(":")[1]
224
 
225
  if action == "confirm_task_delete_task":
226
  await THUNDERX_CLIENT.delete_tasks([task_id])
227
+ await query.edit_message_text(f"✅任务 {task_id} 已删除。")
228
 
229
 
230
  async def handle_task_cancel(update: Update, context: CallbackContext):
231
  query = update.callback_query
232
+ await query.answer()
233
  # 获取取消操作的类型和文件 ID
234
  action, file_id = query.data.split(":")[0], query.data.split(":")[1]
235
  # 返回文件夹列表
236
+ await query.edit_message_text(f"操作已取消。\n返回文件列表...")
237
 
238
 
239
  async def tg_show_task(update: Update, context: CallbackContext):
 
320
  # 处理任务操作的回调
321
  async def handle_tasks_operation(update: Update, context: CallbackContext):
322
  query = update.callback_query
323
+ await query.answer()
324
 
325
  # 获取操作类型和文件 ID
326
  action, task_id = query.data.split(":")
 
341
  ],
342
  ]
343
  reply_markup = InlineKeyboardMarkup(keyboard)
344
+ await query.edit_message_text(
345
  f"你确定要{action}任务 {task_id} 吗?", reply_markup=reply_markup
346
  )
347
  else:
 
353
  update: Update, context: CallbackContext, action: str, file_id: str
354
  ):
355
  if action == "cancel_task":
356
+ await update.callback_query.edit_message_text(f"你选择了取消任务:{file_id}")
357
 
358
 
359
  @app.on_event("startup")