add cap for emeralds lost via begging
@@ -555,6 +555,9 @@ class Econ(commands.Cog):
amount = 9 + math.ceil(math.log(db_user['emeralds']+1, 1.3)) + random.randint(1, 5)
amount = random.randint(1, 4) if amount < 1 else amount
+ if db_user['emeralds'] < amount:
+ amount = db_user['emeralds']
+
await self.db.balance_sub(ctx.author.id, amount)
await self.bot.send(ctx, random.choice(self.d.begging['negative']).format(amount))
