python—如何发送命令在discord.py中排队的错误消息

nbysray5  于 2021-09-08  发布在  Java
关注(0)|答案(0)|浏览(155)

我正在使用此命令对命令进行排队 @commands.max_concurrency(1, per=BucketType.guild, wait=True) 我有没有办法发送消息说你已经排队了。
如果我将其设置为false,我可以发送一条错误消息,但用户将不得不再次发送该命令,因为它不会排队。

@bot.event
async def on_command_error(context, error):
    if isinstance(error, commands.MaxConcurrencyReached):
        embed = discord.Embed(
            title="Error!",
            description="Please wait for the previous job to finish!",
            color=0xE02B2B
        )
        await context.send(embed=embed)

我希望它发送一条消息“请等待上一个作业完成!”然后将其添加到队列中。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题