From 1cb30e4f77026c07d11c7ebaef69616c8ccfb0cf Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Sun, 12 Mar 2023 05:36:09 +0000 Subject: [PATCH 1/4] Add base 10 billion coins to isobot treasury --- database/currency.json | 1 + 1 file changed, 1 insertion(+) diff --git a/database/currency.json b/database/currency.json index 45a51530..0b8c97ac 100644 --- a/database/currency.json +++ b/database/currency.json @@ -1,4 +1,5 @@ { + "treasury": 10000000000, "wallet": {}, "bank": {} } From 08d4fbb7f4809af58e785cbb503633fb5eeee3d5 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Sun, 12 Mar 2023 05:40:15 +0000 Subject: [PATCH 2/4] Move taxable amounts to isobot treasury upon transaction in `/buy` --- cogs/economy.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cogs/economy.py b/cogs/economy.py index af13c18d..68f58503 100644 --- a/cogs/economy.py +++ b/cogs/economy.py @@ -363,6 +363,7 @@ async def buy(self, ctx: ApplicationContext, name: str, quantity: int=1): total_amount = amt + rounded_taxable_amount currency['wallet'][str(ctx.author.id)] -= int(total_amount) items[str(ctx.author.id)][str(name)] += quantity + currency["treasury"] += rounded_taxable_amount save() localembed = discord.Embed( title=f'You just bought {quantity} {shopitem[name]["stylized name"]}!', From eece845443937527e07910467798eb3b51f8bbc0 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Sun, 12 Mar 2023 05:44:00 +0000 Subject: [PATCH 3/4] Add `/treasury` command to view the amount of coins in the isobot treasury --- cogs/economy.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cogs/economy.py b/cogs/economy.py index 68f58503..7de3a44c 100644 --- a/cogs/economy.py +++ b/cogs/economy.py @@ -635,6 +635,14 @@ async def balance(self, ctx: ApplicationContext, user=None): await ctx.respond(embed=e) except: await ctx.respond('Looks like that user is not indexed in our server. Try again later.', ephemeral=True) except Exception as e: await ctx.respond(f'An error occured: `{e}`. This has automatically been reported to the devs.') + + @commands.slash_command( + name="treasury", + description="See the amount of coins in the isobot treasury." + ) + async def treasury(ctx: ApplicationContext): + localembed = discord.Embed(description="There are currently {currency['treasury']} coins in the isobot treasury.") + await ctx.respond(embed=localembed) # Initialization def setup(bot): From 35d898846681b292f447ed83f4a4b71541bf92d5 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Sun, 12 Mar 2023 05:47:28 +0000 Subject: [PATCH 4/4] Add `/treasury` to the commands db --- config/commands.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/commands.json b/config/commands.json index 501754c4..4acc2888 100644 --- a/config/commands.json +++ b/config/commands.json @@ -638,5 +638,15 @@ "usable_by": "the developer", "disabled": false, "bugged": false + }, + "treasury": { + "name": "Treasury", + "description": "View the amount of coins in the isobot treasury.", + "type": "economy system", + "cooldown": null, + "args": null, + "usable_by": "everyone", + "disabled": false, + "bugged": false } }