小编tec*_*ics的帖子

Discord.py @bot.event

@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)
Run Code Online (Sandbox Code Playgroud)

python discord discord.py

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

discord ×1

discord.py ×1

python ×1