![](/img/trans.png)
[英]Sending messages from only 1 channel in Discord (discord.py bot)
[英]discord.py bot not sending messages
import discord
client = discord.Client(intents=discord.Intents.default())
@client.event
async def on_ready():
print("Logged in as {0.user}".format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith("Hello"):
await message.channel.send("Hi")
client.run("Token")
这是我基本上从教程中复制的代码,即使它是显示的代码的 1 对 1 副本,它仍然不发送消息
Go 到https://discord.com/developers/applications/YOUR_BOT_ID/bot并启用消息内容意图
您也可以尝试用discord.Intents.default()
discord.Intents.all()
希望能帮助到你!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.