It's because on_message
is a bot event, which means it does not need to be invoked as a command, you can call the command with ()
, but in your case, you are trying to use the command as a event.
This is an event
@bot.event
async def on_message(message):
channel = message.channel
await message.channel.send('Send me that ?? reaction, mate')
def check(reaction, user):
return user == message.author and str(reaction.emoji) == '??'
try:
reaction, user = await bot.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
await message.channel.send('??')
else:
await message.channel.send('??')
This is a command, a command needs to be invoked with a function, in this case, it would be your prefix + thumbs !thumbs
hope both of these help.
@bot.command()
async def thumbs(ctx):
channel = ctx.channel
await ctx.send('Send me that ?? reaction, mate')
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) == '??'
try:
reaction, user = await bot.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
await ctx.send('??')
else:
await ctx.send('??')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…