-
Notifications
You must be signed in to change notification settings - Fork 34
Runtime loading of cogs #95
Comments
Calling https://hexdocs.pm/discord_alchemy/0.6.0/Alchemy.Cogs.html#unload/1, then reloading the module in iex, and then calling |
But that would restart the whole bot, would it not? |
You just need to reload the Cog module, I was a bit unclear. You can do that while keeping the rest of the bot running. |
Huh, nice! I would suggest making it a little more clear in the docs that Cogs load themselves into the Client on module load. |
Yeah Strictly speaking, if you don't change the arity of any of your Cog functions / command handlers, or add new handlers you don't even need to call
TLDR reloading the The docs could use a section explaining how to hot reload things, it definitely isn't super clear atm... |
That makes everything clear, thank you! |
Atm, I don't see a way to start a Cog at runtime. I would like to be able to unload a cog, then load a replacement as needed. Main reasons for this are hotfixes and inconsequential updates that shouldn't necessitate a redeploy.
The text was updated successfully, but these errors were encountered: