我正在尝试通过检查消息的作者ID是否等于我想要的用户,来使Discord机器人回复特定的用户。我在做什么错了?
我正在尝试使用最后一个discord.py制作机器人。我看了很多教程,但我仍然不知道该怎么办。
import discord
import asyncio
from discord.ext import commands
from discord.ext.commands import Bot
token = [Redacted]
bot = commands.Bot(command_prefix='##')
@bot.event
async def on_message(message):
if(message.author.id == [Redacted]):
print("se detecto el user: ",message.author.id) #early testing the code
await bot.add_reaction(message, ":virgo:") #this is where i get the problem
bot.run(token)
我试图让服务器做出反应,但出现此错误:
File "bot.py", line 21, in on_message
await bot.add_reaction(message, ":virgo:")
AttributeError: 'Bot' object has no attribute 'message'