#Setting up cogs

1 messages · Page 1 of 1 (latest)

leaden elbow
#

Can someone tell me how to setup cogs again, im not familiar with the new changes. I get this error:
4: RuntimeWarning: coroutine 'setup' was never awaited
setup(self)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Ignoring exception in on_ready
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/disnake/client.py", line 703, in _run_event
await coro(*args, **kwargs)
File "/Users/tenuka/Documents/Projects/word bot/main.py", line 13, in on_ready
await bot.load_extension('cogs.words')
TypeError: object NoneType can't be used in 'await' expression

leaden elbow
#

but now i get this

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/disnake/client.py", line 703, in _run_event
await coro(*args, **kwargs)
File "/Users/tenuka/Documents/Projects/word bot/main.py", line 13, in on_ready
bot.load_extension('cogs.words')
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/disnake/ext/commands/common_bot_base.py", line 523, in load_extension
self._load_from_module_spec(spec, name)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/disnake/ext/commands/common_bot_base.py", line 455, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
disnake.ext.commands.errors.ExtensionFailed: Extension 'cogs.words' raised an error: ImportError: attempted relative import beyond top-level package

strong tapir
#

show the code

#

and dont load extensions in on_ready

leaden elbow
#

where i have main.py and all_funcs.py in the directory and then a folder with a file words.py

strong tapir
leaden elbow
#

oh okay

#

thank you very much

#

also last thing, when you said dont load exts on on_ready: this is fine right:

@bot.event
asnyc def on_ready():
...

bot.load_extensions(...)