我希望我的机器人找到第一个频道,这是一个文本频道,并且他有权在其中发送消息。问题是我不知道如何检查每个频道的权限。
# When the bot is ready
@client.event
async def on_ready():
# Ready message
print("Bot is ready.")
# Getting the default channel
default_channel = checkChannels()
# Getting the default channel
@bot_has_permissions(send_messages=True)
def checkChannels():
for guild in client.guilds:
for channel in guild.channels:
if str(channel.type) == "text":
return channel