Skip to content

Cogs problembs #21472

Answered by fire-eggs
Dani-D99 asked this question in General
Discussion options

You must be logged in to vote

This error:

FileNotFoundError: [WinError 3] The system cannot find the path specified: ‘./cogs’

is telling you that python cannot find the folder “./cogs”. Here is the code which is looking for it:

for filenamein os.listdir('./cogs'):

In python, paths are relative to the current working directory. I.e. whatever folder your Bot.main is sitting in, you need to have a “cogs” folder in there.

If you have absolutely no reason to have any cogs for your bot, then comment out the following lines:

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

and the script will stop seeking for a “cogs” folder.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants