Missing config
This issue occurred when the bot user was added to a server while it was offline, or was started for the first time, with the bot user already being in a server. This was caused by the adding of servers happening with the event on_guild_join and on_guild_remove
The fix was while the bot is printing the servers it is in, it tries to load the config for that server. If it cannot, it creates the config, assuming it has just been added.
Error handling
When an incorrect role is passed, role.id results in an attribute error. As such, a try except was added, so instead of an error, the user has some idea what they did wrong.
Missing config This issue occurred when the bot user was added to a server while it was offline, or was started for the first time, with the bot user already being in a server. This was caused by the adding of servers happening with the event
on_guild_join
andon_guild_remove
The fix was while the bot is printing the servers it is in, it tries to load the config for that server. If it cannot, it creates the config, assuming it has just been added.
Error handling
When an incorrect role is passed,
role.id
results in an attribute error. As such, a try except was added, so instead of an error, the user has some idea what they did wrong.