Discord.py V2.0 Command is not found
С недавних пор после обновления Discord.py до версии 2.0 стали появляться проблемки с когами. Подскажите пожалуйста, как исправить проблему.
main
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='$', intents=discord.Intents.all())
bot.remove_command('help')
async def load_extensions():
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
await bot.load_extension(f"cogs.{filename[:-3]}")
bot.run(os.getenv('TOKEN'))
cog файл
import discord
from discord.ext import commands
class Greetings(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='test')
async def test(self, ctx):
print('readycog')
async def setup(bot):
await bot.add_cog(Greetings(bot))
Сама ошибка:
[2022-09-09 13:17:20] [INFO ] discord.client: logging in using static token
[2022-09-09 13:17:21] [INFO ] discord.gateway: Shard ID None has connected to Gateway (Session ID: ******************).
Bot is running
[2022-09-09 13:17:26] [ERROR ] discord.ext.commands.bot: Ignoring exception in command None
discord.ext.commands.errors.CommandNotFound: Command "test" is not found