首页 > 解决方案 > 忽略命令无异常: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")

标签: pythondiscord.py

解决方案


推荐阅读