![](/img/trans.png)
[英]How do i make my discord.py bot react to all images sent in a channel
[英]How do I make my discord bot get all text channel id's in all servers?
我基本上希望機器人獲取所有服務器中所有文本頻道的頻道 ID。 我已經找了幾個小時,但我似乎找不到任何東西。 我猜它看起來像這樣:
for server in bot.guilds:
for channel in server.channels(Channeltype=text)
print(channel.id)
discord.Guild
有一個名為text_channels
的屬性。
for guild in bot.guilds:
for text_ch in guild.text_channels:
print(text_ch.id)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.