My directory goes like this: bob (folder) -> main (folder) -> commands (folder) -> test (folder) test.py (file)
This code seems to work fine
async def load1():
for filename in os.listdir("main/commands"):
if filename.endswith(".py"):
await client.load_extension(f"commands.{filename[:-3]}")
but i want my code to go through another folder like this
async def load1():
for filename in os.listdir("main/commands/testfolder"):
if filename.endswith(".py"):
await client.load_extension(f"testfolder.{filename[:-3]}")
when i run this, it gives me the error: ModuleNotFoundError: No module named 'testfolder'
Basically, i want my code to load folders which would contain something like this commandFolder -> command.py, command.json, command.txt