bot commited on
Commit
de41578
·
1 Parent(s): 9cd2910
Files changed (1) hide show
  1. main.py +16 -0
main.py CHANGED
@@ -359,7 +359,9 @@ async def perform_file_action(
359
  )
360
  # 为每个文件创建按钮和操作选项
361
  for file in files["files"]:
 
362
  if file["kind"].lower() == "drive#folder":
 
363
  keyboard.append(
364
  [
365
  InlineKeyboardButton(
@@ -372,6 +374,20 @@ async def perform_file_action(
372
  ),
373
  ]
374
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
 
376
  reply_markup = InlineKeyboardMarkup(keyboard)
377
  # await update.message.reply_text(f"📋文件列表:", reply_markup=reply_markup)
 
359
  )
360
  # 为每个文件创建按钮和操作选项
361
  for file in files["files"]:
362
+ print(file["kind"].lower())
363
  if file["kind"].lower() == "drive#folder":
364
+ print(file["parent_id"])
365
  keyboard.append(
366
  [
367
  InlineKeyboardButton(
 
374
  ),
375
  ]
376
  )
377
+ else:
378
+ print(file["parent_id"])
379
+ keyboard.append(
380
+ [
381
+ InlineKeyboardButton(
382
+ f"下载📄: {file['name']}",
383
+ callback_data=f"download_file:{file['id']}:{file['parent_id']}",
384
+ ),
385
+ InlineKeyboardButton(
386
+ f"删除",
387
+ callback_data=f"delete_file:{file['id']}:{file['parent_id']}",
388
+ ),
389
+ ]
390
+ )
391
 
392
  reply_markup = InlineKeyboardMarkup(keyboard)
393
  # await update.message.reply_text(f"📋文件列表:", reply_markup=reply_markup)