[Topgg][Admin][Economy] Implement addCoins cb
This commit is contained in:
@@ -61,10 +61,10 @@ async def cmd_set(ctx):
|
||||
# Postgres `coins` column is `integer`, sanity check postgres int limits - which are smalled than python int range
|
||||
target_coins_to_set = target_lion.coins + amount
|
||||
if target_coins_to_set >= 0 and target_coins_to_set <= POSTGRES_INT_MAX:
|
||||
target_lion.addCoins(amount)
|
||||
target_lion.addCoins(amount, ignorebonus=True)
|
||||
elif target_coins_to_set < 0:
|
||||
target_coins_to_set = -target_lion.coins # Coins cannot go -ve, cap to 0
|
||||
target_lion.addCoins(target_coins_to_set)
|
||||
target_lion.addCoins(target_coins_to_set, ignorebonus=True)
|
||||
target_coins_to_set = 0
|
||||
else:
|
||||
return await ctx.embed_reply("Member coins cannot be more than {}".format(POSTGRES_INT_MAX))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
from codecs import ignore_errors
|
||||
import logging
|
||||
import traceback
|
||||
import datetime
|
||||
@@ -500,7 +501,7 @@ class ReactionRoleMessage:
|
||||
if price and refund:
|
||||
# Give the user the refund
|
||||
lion = Lion.fetch(self.guild.id, member.id)
|
||||
lion.addCoins(price)
|
||||
lion.addCoins(price, ignorebonus=True)
|
||||
|
||||
# Notify the user
|
||||
embed = discord.Embed(
|
||||
|
||||
Reference in New Issue
Block a user