From 4a0670db6553d3f2bf64c6c837173ad73da09649 Mon Sep 17 00:00:00 2001 From: Conatum Date: Wed, 22 Sep 2021 14:30:16 +0300 Subject: [PATCH] (Shop): Improve logging. Remove extraneous `await` in the `clear` branch. Improved error message while purchasing colour role. --- bot/modules/economy/shop_core/ColourRole.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/bot/modules/economy/shop_core/ColourRole.py b/bot/modules/economy/shop_core/ColourRole.py index 7970755b..19153923 100644 --- a/bot/modules/economy/shop_core/ColourRole.py +++ b/bot/modules/economy/shop_core/ColourRole.py @@ -143,8 +143,16 @@ class ColourRole(ShopItem): desc = "You have bought {}. Enjoy!".format(to_add.mention) log_str = "{} bought {}.".format(member.mention, to_add.mention) else: - desc = "Something went wrong! Please try again later." - log_str = "{} bought `{}`, but I couldn't add the role!".format(member.mention, self.roleid) + desc = ( + "Something went wrong! Please try again later.\n" + "(I don't have the server permissions to give this role to you!)" + ) + log_str = ( + "{} bought `{}`, but I couldn't add the role!\n" + "Please ensure that I have permission to manage this role.\n" + "(I need to have the `manage_roles` permission, " + "and my top role needs to be above the colour roles.)" + ).format(member.mention, self.roleid) log_error = True # Build and send embeds @@ -365,5 +373,5 @@ class ColourRole(ShopItem): """ if await ctx.ask("Are you sure you want to remove all colour roles from the shop?"): shop_items.delete_where(guildid=ctx.guild.id, item_type=cls.item_type) - await ctx.reply("All colour roles deleted.") - await ctx.guild_settings.event_log.log("{} cleared the colour role shop.".format(ctx.author.mention)) + await ctx.reply("All colour roles removed from the shop.") + ctx.guild_settings.event_log.log("{} cleared the colour role shop.".format(ctx.author.mention))