我做了一个简单的机器人,在一个不和谐的频道上对来自特定用户的消息进行自动反应,但是现在我想做同样的事情,但是对具有不同表情的多个用户,我尝试了这段代码,但它只在没有elif条件的情况下工作,有什么建议吗
import discord
from discord.ext import commands
from discord.ext.commands import Bot
import asyncio
bot = commands.Bot(command_prefix = ",")
@bot.event
async def on_ready():
print ("Ready...")
@bot.event
async def on_message(message):
if (message.channel.id == channel_id and message.author.id == user_id):
await message.add_reaction("😀")
elif (message.channel.id == channel_id and message.author.id == another_user_id):
await message.add_reaction("🤪")
bot.run("bot_token")
目前没有回答
相关问题 更多 >
编程相关推荐