首页 > 解决方案 > discord.py 子命令给出错误命令未找到

问题描述

这是代码:

 # its inside a cog
 @commands.group()
 async def binary_conv(self, ctx):
        if ctx.invoked_subcommand is None:
            await ctx.send('**An error occured**')

 @binary_conv.command()
 async def encode(self, ctx, test):
        await ctx.send(test)

 @binary_conv.command()
 async def decode(self, ctx, test):
        await ctx.send(test + "1")

在这里,如果我尝试 !binary_conv 编码运行

它给出了这个错误

忽略命令无异常:discord.ext.commands.errors.CommandNotFound:找不到命令“binary_conv”

标签: pythondiscord.py

解决方案


推荐阅读