Roxxers / roxbot

Roxbot: An inclusive modular multi-purpose Discord bot. Built with love (and discord.py)
MIT License
21 stars 5 forks source link

Fix issue related to missing config for servers + add error handling to ;sa #15

Closed valknight closed 6 years ago

valknight commented 6 years ago

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.

valknight commented 6 years ago

ignore the failing check, it's marking the license info as duplicate.

Roxxers commented 6 years ago

Looks good and the code is clean.