【发布时间】:2021-10-04 04:46:50
【问题描述】:
当我的 discord.py 机器人启用时如何向特定频道发送消息 我正在使用新的 discord.py,其中 (ctx) 是一个东西
【问题讨论】:
标签: discord.py
当我的 discord.py 机器人启用时如何向特定频道发送消息 我正在使用新的 discord.py,其中 (ctx) 是一个东西
【问题讨论】:
标签: discord.py
获取频道ID后,即可使用
channel = discord.utils.get(ctx.guild.channels, id = channelID) #or name if you want by name
await channel.send("This is a test message!")
【讨论】:
bot.get_channel(12345) 从缓存中获取它。没有得到公会对象