bot
commited on
Commit
·
1fbfa8d
1
Parent(s):
de524b5
fix
Browse files
main.py
CHANGED
@@ -304,6 +304,8 @@ async def handle_file_operation(update: Update, context: CallbackContext):
|
|
304 |
# 获取操作类型和文件 ID
|
305 |
action, file_id = query.data.split(":")
|
306 |
|
|
|
|
|
307 |
# 需要确认的操作
|
308 |
if action in ["delete_file"]:
|
309 |
# 生成确认消息
|
@@ -325,8 +327,17 @@ async def handle_file_operation(update: Update, context: CallbackContext):
|
|
325 |
)
|
326 |
else:
|
327 |
# 不需要确认的操作,直接处理
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
context.user_data["file_id"] = file_id
|
329 |
await tg_show_files(update, context)
|
|
|
330 |
|
331 |
|
332 |
#################### 离线任务处理 ##########################
|
|
|
304 |
# 获取操作类型和文件 ID
|
305 |
action, file_id = query.data.split(":")
|
306 |
|
307 |
+
print(f"Performing action: {action} for file_id: {file_id}")
|
308 |
+
|
309 |
# 需要确认的操作
|
310 |
if action in ["delete_file"]:
|
311 |
# 生成确认消息
|
|
|
327 |
)
|
328 |
else:
|
329 |
# 不需要确认的操作,直接处理
|
330 |
+
await perform_file_action(update, context, action, file_id)
|
331 |
+
|
332 |
+
|
333 |
+
async def perform_file_action(
|
334 |
+
update: Update, context: CallbackContext, action: str, file_id: str
|
335 |
+
):
|
336 |
+
print(f"1233 Performing action: {action} for file_id: {file_id}")
|
337 |
+
if action == "list_file":
|
338 |
context.user_data["file_id"] = file_id
|
339 |
await tg_show_files(update, context)
|
340 |
+
# await update.callback_query.edit_message_text(f"你选择了取消任务:{file_id}")
|
341 |
|
342 |
|
343 |
#################### 离线任务处理 ##########################
|