2024-05-14 00:18:23 发布
网友
我需要一个服务器中所有语音频道的列表,我在文档中看到了getunall_频道,但我不确定如何实现它。在
https://discordpy.readthedocs.io/en/latest/api.html?highlight=voice%20channels
循环检查Server.channels检查Channel.type与{}
Server.channels
Channel.type
from discord import ChannelType @bot.command(pass_context=True) async def voicechannels(ctx): channels = (c.name for c in ctx.message.server.channels if c.type==ChannelType.voice) await bot.say("\n".join(channels))
循环检查}
Server.channels
检查Channel.type
与{相关问题 更多 >
编程相关推荐