Currently when reloading a module, if there is an exception in Bot.load_module, such as on import, the module is improperly restored and left out of Bot._modules (since it gets removed by Bot.unload_module). This causes an issue where you can't load, unload, or reload the module again without restarting the bot. This PR fixes this issue.
Checklist
[x] If code changes were made then they have been tested.
[ ] I have updated the documentation to reflect the changes.
[x] I have updated the changelog with a quick recap of my changes.
[x] This PR fixes an issue.
[ ] This PR adds something new (e.g. new method or parameters).
[ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
[ ] This PR is not a code change (e.g. documentation, README, ...)
Pull request summary
Currently when reloading a module, if there is an exception in
Bot.load_module
, such as on import, the module is improperly restored and left out ofBot._modules
(since it gets removed byBot.unload_module
). This causes an issue where you can't load, unload, or reload the module again without restarting the bot. This PR fixes this issue.Checklist