【发布时间】:2021-03-11 12:17:53
【问题描述】:
我有下面这行代码,它是用来接收一个频道并给出它的id。
channel = discord.utils.get(message.guild.channels, name='general', type="ChannelType.voice")
print(channel)
它最终返回None,我做错了吗?
【问题讨论】:
标签: python discord.py
我有下面这行代码,它是用来接收一个频道并给出它的id。
channel = discord.utils.get(message.guild.channels, name='general', type="ChannelType.voice")
print(channel)
它最终返回None,我做错了吗?
【问题讨论】:
标签: python discord.py
get_x 和 utils.get 都返回 None 如果找不到任何匹配项。
常见原因包括:
你可以试试:
channel = discord.utils.get(message.guild.voice_channels, name='general')
【讨论】: