当我的 discord.py bot 启用时,我想向特定频道发送消息

时间:2021-07-28 12:32:32

标签: discord.py

如何在我的 discord.py bot 启用时向特定频道发送消息 我正在使用新的 discord.py,其中 (ctx) 是一回事

1 个答案:

答案 0 :(得分:0)

获得频道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!")