diff --git a/cogs/economy.py b/cogs/economy.py index af13c18d..7de3a44c 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"]}!', @@ -634,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): 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 } } 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": {} }