Hi in my code for a Python Discord bot i started to try some Cogs. But somehow when I run the code i get the Error that Extension is not defined but in the Toturial i watched he never defined Extension.
extensions = ['cogs.postgres'] if __name__ == "__main__": for extensions in extensions: try: bot.load_extension(extension) except Exception as e: print(f'Error loading {extension}', file=sys.stderr) traceback.print_exc()
The Exact Error is : "NameError: name 'extension' is not defined" Can someone help me?I googled that error but did not found anything to cogs Extensions is not defined.
You're in fact not defining extension, fix:
for extension in extensions:
I think you simply miscopied
2.1m questions
2.1m answers
60 comments
57.0k users