【发布时间】:2020-09-16 10:48:39
【问题描述】:
所以我有一个同时使用@bot.event 和@bot.command() 的脚本。问题是当我有一个@bot.event 等待时,@bot.command() 将无法运行。
这是我的代码:
@bot.event
async def on_ready():
print("Bot Is Ready And Online!")
async def react(message):
if message.content == "Meeting":
await message.add_reaction("????")
@bot.command()
async def info(ctx):
await ctx.send("Hello, thanks for testing out our bot. ~ techNOlogics")
@bot.command(pass_context=True)
async def meet(ctx,time):
if ctx.message.author.name == "techNOlogics":
await ctx.channel.purge(limit=1)
await ctx.send("**Meeting at " + time + " today!** React if you read.")
@bot.event ##THIS ONE HOLDS UP THE WHOLE SCRIPT
async def on_message(message):
await react(message)
【问题讨论】:
标签: python discord discord.py