bot commited on
Commit
9cd2910
·
1 Parent(s): 6efccd0
Files changed (1) hide show
  1. main.py +14 -2
main.py CHANGED
@@ -346,8 +346,6 @@ async def perform_file_action(
346
  files = await THUNDERX_CLIENT.file_list(100, file_id, "", {})
347
  keyboard = []
348
 
349
- print(files["files"])
350
-
351
  if files["files"] is None:
352
  await update.message.reply_text("❌未找到文件!!")
353
  else:
@@ -360,6 +358,20 @@ async def perform_file_action(
360
  ]
361
  )
362
  # 为每个文件创建按钮和操作选项
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
 
364
  reply_markup = InlineKeyboardMarkup(keyboard)
365
  # await update.message.reply_text(f"📋文件列表:", reply_markup=reply_markup)
 
346
  files = await THUNDERX_CLIENT.file_list(100, file_id, "", {})
347
  keyboard = []
348
 
 
 
349
  if files["files"] is None:
350
  await update.message.reply_text("❌未找到文件!!")
351
  else:
 
358
  ]
359
  )
360
  # 为每个文件创建按钮和操作选项
361
+ for file in files["files"]:
362
+ if file["kind"].lower() == "drive#folder":
363
+ keyboard.append(
364
+ [
365
+ InlineKeyboardButton(
366
+ f"查看📁: {file['name']}",
367
+ callback_data=f"list_file:{file['id']}:{file['parent_id']}",
368
+ ),
369
+ InlineKeyboardButton(
370
+ f"删除",
371
+ callback_data=f"delete_file:{file['id']}:{file['parent_id']}",
372
+ ),
373
+ ]
374
+ )
375
 
376
  reply_markup = InlineKeyboardMarkup(keyboard)
377
  # await update.message.reply_text(f"📋文件列表:", reply_markup=reply_markup)