python - 忽略命令无异常:discord.ext.commands.errors.CommandNotFound:找不到命令“test”
问题描述
我正在制作一个 discord.py 机器人,而我刚刚进入了 cogs。当我按照说明运行它时,机器人在线但是当我测试“测试”命令时,它只是给了我Ignoring exception in command None: discord.ext.commands.errors.CommandNotFound: Command "test" is not found
这是代码:
from discord.ext import commands
bot = commands.Bot(command_prefix="cool!")
class itsumi(commands.Cog):
"""sure"""
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name="test")
async def test(self, ctx: commands.Context):
await ctx.send("your skin is freezing")
bot.add_cog(itsumi(bot))
bot.run("TOKEN")
解决方案
推荐阅读
- c++ - C ++“使用tcp = x”与“命名空间tcp = x”有什么区别
- airflow - 如何从脚本错误退出到 Airflow?
- vb.net - 在 Visual Basic 中使用 ArrayList.ToArray(Parameter?)
- angular - ngrx 存储减速器配置(角度 5)
- ios - IOS/Swift:使用 IBOutlet 设置标签文本
- c++ - boost::python::list 得到值段错误
- css - 更改灯箱链接的链接颜色
- javascript - 查找范围开始或结束的元素
- android - javaDatabinding-method 不会在字段更改时自动调用
- javascript - 无法在后端接收 cookie