我想在replit上制作一个dc机器人,就像这个 我的代码是:
import discord
import os
client = discord.Client(intents=discord.Intents.default())
@client.event
async def on_ready():
print("This is user {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("Hello!")
my_secret = os.environ['TOKEN']
client.run(my_secret)
我的机器人没有响应我的命令,但它在线并且我检查了权限
您很可能没有在特权网关意图中启用消息内容意图。您可以在 Discord 开发门户网站上找到它。
如果这不起作用,请仔细检查您的服务器和机器人权限。
我有同样的问题,我启用了消息内容意图,并且权限很好,如果我在我的计算机上运行程序,机器人工作正常,但如果我在replt上运行,我就会遇到这个问题