#No attribute cog

1 messages · Page 1 of 1 (latest)

quiet crystal
#

So this is my error Extension 'cogs.fun' raised an error: AttributeError: 'function' object has no attribute 'Cog'

eternal berry
eternal berry
#

You might be calling it on the wrong object

#

Share your code

quiet crystal
#

K

#

I think its because I didn't import discord in fun.py

eternal berry
#

Could you send the full traceback

quiet crystal
#

I mean i fixed the error my importing discord

quiet crystal
#

raceback (most recent call last):
File "c:\Users\OneDrive\Desktop\Busta Bot\main.py", line 8, in <module>
bot.load_extension(f"cogs.{file[:-3]}")
File "C:\Users\f\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\cog.py", line 787, in load_extension
self._load_from_module_spec(spec, name)
File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\cog.py", line 718, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.errors.ExtensionFailed: Extension 'cogs.fun' raised an error: AttributeError: 'function' object has no attribute 'Cog'

#

I removed my user