Repository: Cog-Creators/Red-DiscordBot

Issue:
[Bank] Allow to reset ` rolepaydayamount` for a certain role
<!-- 
Please be sure to use the correct template, 
if your report doesn't have the correct template please open an issue describing your issue in detail
For support regarding the bot itself please visit the discord server over at https://discord.gg/red
-->

**Describe the enhancement**
Allow a command to reset a specific role (or multiple roles at once) from the command `[p]economyset rolepaydayamount role amount`. There is not currently a way to effectively do this.

**Does this enhancement break existing functionality?**
 Yes
 **No**


Discussion:

Resolving patch:
diff --git a/redbot/cogs/economy/economy.py b/redbot/cogs/economy/economy.py
--- a/redbot/cogs/economy/economy.py
+++ b/redbot/cogs/economy/economy.py
@@ -976,6 +976,7 @@ async def paydayamount(self, ctx: commands.Context, creds: int):
     @economyset.command()
     async def rolepaydayamount(self, ctx: commands.Context, role: discord.Role, creds: int):
         """Set the amount earned each payday for a role.
+        Set to `0` to remove the payday amount you set for that role.
 
         Only available when not using a global bank.
 
@@ -989,23 +990,37 @@ async def rolepaydayamount(self, ctx: commands.Context, role: discord.Role, cred
         """
         guild = ctx.guild
         max_balance = await bank.get_max_balance(ctx.guild)
-        if creds <= 0 or creds > max_balance:
+        if creds >= max_balance:
             return await ctx.send(
-                _("Amount must be greater than zero and less than {maxbal}.").format(
-                    maxbal=humanize_number(max_balance)
-                )
+                _(
+                    "The bank requires that you set the payday to be less than"
+                    " its maximum balance of {maxbal}."
+                ).format(maxbal=humanize_number(max_balance))
             )
         credits_name = await bank.get_currency_name(guild)
         if await bank.is_global():
             await ctx.send(_("The bank must be per-server for per-role paydays to work."))
         else:
-            await self.config.role(role).PAYDAY_CREDITS.set(creds)
-            await ctx.send(
-                _(
-                    "Every payday will now give {num} {currency} "
-                    "to people with the role {role_name}."
-                ).format(num=humanize_number(creds), currency=credits_name, role_name=role.name)
-            )
+            if creds <= 0:  # Because I may as well...
+                default_creds = await self.config.guild(guild).PAYDAY_CREDITS()
+                await self.config.role(role).clear()
+                await ctx.send(
+                    _(
+                        "The payday value attached to role has been removed. "
+                        "Users with this role will now receive the default pay "
+                        "of {num} {currency}."
+                    ).format(num=humanize_number(default_creds), currency=credits_name)
+                )
+            else:
+                await self.config.role(role).PAYDAY_CREDITS.set(creds)
+                await ctx.send(
+                    _(
+                        "Every payday will now give {num} {currency} "
+                        "to people with the role {role_name}."
+                    ).format(
+                        num=humanize_number(creds), currency=credits_name, role_name=role.name
+                    )
+                )
 
     @economyset.command()
     async def registeramount(self, ctx: commands.Context, creds: int):


Test patch: