MKE0108 commited on
Commit
516ef78
·
1 Parent(s): 1345bb7
Files changed (1) hide show
  1. bot_main.py +14 -1
bot_main.py CHANGED
@@ -51,6 +51,19 @@ async def pick(ctx,str):
51
  solgan = ["我從不覺得在召喚峽谷快樂過","一但加入了召喚峽谷就再也回不去了","我們的遊戲就是要讓你們不開心","你們的不開心就是我們的快樂","你們滿腦子只想著自己","還真是虛情假義呢"]
52
 
53
  await ctx.send(random.sample(solgan,1)[0],embed=embed)
54
-
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  bot.run(os.getenv('BOT_TOKENS'))
 
51
  solgan = ["我從不覺得在召喚峽谷快樂過","一但加入了召喚峽谷就再也回不去了","我們的遊戲就是要讓你們不開心","你們的不開心就是我們的快樂","你們滿腦子只想著自己","還真是虛情假義呢"]
52
 
53
  await ctx.send(random.sample(solgan,1)[0],embed=embed)
54
+ @bot.command()
55
+ async def list_voice_members(ctx, channel_id: int):
56
+ # 獲取指定 ID 的語音頻道
57
+ channel = bot.get_channel(channel_id)
58
+ if channel and isinstance(channel, discord.VoiceChannel):
59
+ # 獲取語音頻道中的所有成員
60
+ members = channel.members
61
+ if members:
62
+ member_names = [member.name for member in members]
63
+ await ctx.send(f'語音頻道中的成員: {", ".join(member_names)}')
64
+ else:
65
+ await ctx.send('語音頻道中沒有成員。')
66
+ else:
67
+ await ctx.send('找不到指定的語音頻道。')
68
 
69
  bot.run(os.getenv('BOT_TOKENS'))