Ask coding questions

← Back to all posts
errors
h
jonnyb2244

Traceback (most recent call last):
File "main.py", line 9, in <module>
for cog in filter(lambda x: x.endswith(".py"), listdir("cogs/")):
FileNotFoundError: [Errno 2] No such file or directory: 'cogs/'

still getting errors, how do i fix it?

Voters
jonnyb2244
Comments
hotnewtop
Coder100

did you forget to set up cogs.

jonnyb2244

@Coder100 prob, how do i do that?

Coder100
Coder100

you don't have a cogs folder.

AloegelhiPlaysR

You need a folder called 'cogs' and a file within that folder.

jonnyb2244
AloegelhiPlaysR

Make a folder.. If you don't know basic python, I recommed learning before making a bot.

@jonnyb2244

jonnyb2244

@AloegelhiPlaysR what should i put, in the cog folder?
i tried to run it on pycharm and vsc, but wouldnt work. So i copied it, to replit