@Reaper_sds

В чём проблема AttributeError: module 'cogs.verifycation' has no attribute 'setup'?

я просто хотел сделать красивый отчёт команде мута и мне выдаёт ошибку
Traceback (most recent call last):
  File "C:\Users\vc631\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\ext\commands\common_bot_base.py", line 447, in _load_from_module_spec
    setup = lib.setup
            ^^^^^^^^^
AttributeError: module 'cogs.verifycation' has no attribute 'setup'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\vc631\OneDrive\Рабочий стол\Sun and Moon bot\bot.py", line 30, in <module>
    bot.load_extension(f"cogs.{filename[:-3]}")
  File "C:\Users\vc631\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\ext\commands\common_bot_base.py", line 512, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\vc631\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\ext\commands\common_bot_base.py", line 450, in _load_from_module_spec
    raise errors.NoEntryPointError(key)
disnake.ext.commands.errors.NoEntryPointError: Extension 'cogs.verifycation' has no 'setup' function.

хотя я не вижу ни каких ошибок в коде где ошибка?
пишет что на 30 строке но я там не вижу ни каких проблем с токеном
код:
import disnake
from disnake.ext import commands
import os

bot = commands.Bot(command_prefix=("!"), intents=disnake.Intents.all())


@bot.command()
@commands.is_owner()
async def load(ctx, extension):
    bot.load_extension(f"cogs.{extension}")


@bot.command()
@commands.is_owner()
async def unload(ctx, extension):
    bot.unload_extension(f"cogs.{extension}")


@bot.command()
@commands.is_owner()
async def reload(ctx, extension):
    bot.reload_extension(f"cogs.{extension}")


for filename in os.listdir("cogs"):
    if filename.endswith(".py"):
        bot.load_extension(f"cogs.{filename[:-3]}")

bot.run("ТОКЕН")

где ошибка?
код команды мута:
@commands.slash_command(name="mute", description="затыкает пользователя на некоторое то время")
    async def mute(self, interaction, member: disnake.Member, time: str, reason: str):
        embed = disnake.Embed(title="Mute", description=f"⛔| {member.mention} был успешно заглушен", color=0xff0000)
        embed.add_field(name="Длительность:", value=f"{cool_time}")
        embed.add_field(name="Причина:", value=f"{reason}")
        embed.set_thumbnail(url=self.bot.user.avatar.url)
        await interaction.response.send_message(embed=embed, ephemeral=True)
        time = datetime.datetime.now() + datetime.timedelta(minutes=int(time))
        await member.timeout(reason=reason, until=time)
        cool_time = disnake.utils.format_dt(time, style="R")
  • Вопрос задан
  • 64 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы