[当我使用ctx.guild.text_channels并打印分配给我的变量时,它仅显示不和谐服务器中的第一个文本通道
我尝试查看不和谐重写的文档,如果有某种循环我必须使用,但找不到任何循环。所以我相信我做错了。
只是告诉大家我有成员:discord.Member,因为我稍后将使用它。
Discord公会频道列表:http://prntscr.com/prdcaa
@bot.command(pass_contect=True)
async def check_client_channel(ctx, member: discord.Member):
channels = discord.utils.get(ctx.guild.text_channels)
print(channels)
channel_name = member.display_name + "-" + member.discriminator
执行函数时的结果:
test2
预期结果:(有点类似)
["test2", "general", "test", "testing-2611"]
此版本为rewrite/master
版本
@bot.command()
async def on(msg):
chans=msg.guild.text_channels
print([i.name for i in chans])