Skip to content
Discussion options

You must be logged in to vote

You're overwriting the setup_hook that you created in earlier iterations of the loop with every iteration following it, which is why it loads one of the extensions but will never work for 2 or more.

To properly load multiple extensions you should only define the setup_hook function once and instead move the loop searching and loading extensions into it:

async def setup_hook():
    for filename in os.listdir(...):
        await bot.load_extension(...)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aurkaxi
Comment options

Answer selected by aurkaxi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants