在齿轮中滚动命令; discord.ext.commands.errors.CommandNotFound:找不到命令“ roll100” /“ roll500”

时间:2020-10-11 22:23:41

标签: python python-3.x discord discord.py discord.py-rewrite

我正在尝试对这2个roll命令进行编码,我已经随机导入以及导入了选择内容,因此它们应该可以工作。他们在齿轮上。

    @commands.command(aliases=['roll500'])
    async def _roll500(self, ctx):
        n = random.randint(0,500)
        author = ctx.message.author

        embed = discord.Embed(
            colour = discord.Colour.green()
        )

        embed.set_thumbnail(url='https://cdn.discordapp.com/attachments/762430826755260449/764946212527931392/die.png')
        embed.add_field(name='Roll', value=(f'Your random number is {n}/500.'), inline=False)

        await ctx.send(embed=embed)

    @commands.command(name="roll100")
    async def _roll100(self, ctx):
        n = random.randint(0,100)
        author = ctx.message.author

        embed = discord.Embed(
            colour = discord.Colour.green()
        )

        embed.set_thumbnail(url='https://cdn.discordapp.com/attachments/762430826755260449/764946212527931392/die.png')
        embed.add_field(name='Roll', value=(f'Your random number is {n}/100.'), inline=False)

        await ctx.send(embed=embed)

错误是; discord.ext.commands.errors.CommandNotFound:找不到命令“ roll100” /“ roll500”

0 个答案:

没有答案
相关问题