2024-03-25 12:46:55 +00:00
|
|
|
from config.parser import JsonCache
|
2024-06-20 10:34:03 +00:00
|
|
|
from services.stats_service import BlackJackStats, SlotsStats
|
|
|
|
from services.currency_service import Currency
|
2024-03-17 18:49:12 +00:00
|
|
|
|
2024-03-25 12:46:55 +00:00
|
|
|
strings = JsonCache.read_json("strings")
|
|
|
|
resources = JsonCache.read_json("resources")
|
2024-03-17 18:49:12 +00:00
|
|
|
|
2024-03-29 17:17:51 +00:00
|
|
|
|
2024-03-17 18:49:12 +00:00
|
|
|
async def cmd(self, ctx, game):
|
|
|
|
output = ""
|
|
|
|
|
|
|
|
if game == "BlackJack":
|
|
|
|
stats = BlackJackStats.get_user_stats(ctx.author.id)
|
|
|
|
|
|
|
|
# amount formatting
|
|
|
|
total_bet = Currency.format_human(stats["total_bet"])
|
|
|
|
total_payout = Currency.format_human(stats["total_payout"])
|
|
|
|
|
2024-06-15 22:45:24 +00:00
|
|
|
# output = f"{ctx.author.name}'s lumi stats\n\n"
|
2024-03-17 18:49:12 +00:00
|
|
|
output = strings["stats_blackjack"].format(
|
|
|
|
stats["amount_of_games"],
|
|
|
|
total_bet,
|
|
|
|
stats["winning_amount"],
|
|
|
|
total_payout
|
|
|
|
)
|
|
|
|
|
|
|
|
elif game == "Slots":
|
|
|
|
stats = SlotsStats.get_user_stats(ctx.author.id)
|
|
|
|
|
|
|
|
# amount formatting
|
|
|
|
total_bet = Currency.format_human(stats["total_bet"])
|
|
|
|
total_payout = Currency.format_human(stats["total_payout"])
|
|
|
|
|
|
|
|
output = strings["stats_slots"].format(stats["amount_of_games"], total_bet, total_payout)
|
|
|
|
output += "\n\n"
|
|
|
|
|
2024-03-25 12:46:55 +00:00
|
|
|
pair_emote = self.client.get_emoji(resources["slots"]["emotes"]["slots_0_id"])
|
|
|
|
three_emote = self.client.get_emoji(resources["slots"]["emotes"]["slots_4_id"])
|
|
|
|
diamonds_emote = self.client.get_emoji(resources["slots"]["emotes"]["slots_5_id"])
|
|
|
|
seven_emote = self.client.get_emoji(resources["slots"]["emotes"]["slots_6_id"])
|
2024-03-17 18:49:12 +00:00
|
|
|
|
|
|
|
output += f"{pair_emote} | **{stats['games_won_pair']}** pairs.\n"
|
|
|
|
output += f"{three_emote} | **{stats['games_won_three_of_a_kind']}** three-of-a-kinds.\n"
|
|
|
|
output += f"{diamonds_emote} | **{stats['games_won_three_diamonds']}** triple diamonds.\n"
|
|
|
|
output += f"{seven_emote} | **{stats['games_won_jackpot']}** jackpots."
|
|
|
|
|
|
|
|
output += "\n\n *This command is still in beta, stats may be slightly inaccurate.*"
|
|
|
|
await ctx.respond(content=output)
|