Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cogs/economy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}!',
Expand Down Expand Up @@ -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):
Expand Down
10 changes: 10 additions & 0 deletions config/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
1 change: 1 addition & 0 deletions database/currency.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"treasury": 10000000000,
"wallet": {},
"bank": {}
}