python - 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”
解决方案
推荐阅读
- kotlin - 转换为 Kotlin 时出现编译错误
- android - 无法打开到:localhost/127.0.0.1:5037 的连接,原因是:java.net.ConnectException:连接被拒绝:连接
- android - 尽管初始化,对象在 Kotlin 中仍处于未初始化状态
- vue.js - 一个组件的多个实例被解析为一个
- cassandra - Cassandra 与 ldap 集成
- python-3.x - 无法使用 selenium 选中复选框
- sql-server - 如何在 Azure sql server 中获取会话历史记录?
- json - 什么规则决定了 JSON 中的转义
- android - 应用程序关闭后,由 android webview 中的网页创建的 cookie 将被删除
- c++ - C++ compile-time substring