From 4c2b3f589f9e7a6b518e942b5e59952e99a29044 Mon Sep 17 00:00:00 2001 From: w Date: Tue, 3 Jun 2025 22:55:08 -0300 Subject: [PATCH] db_utils weigh change test --- bot/db_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/db_utils.py b/bot/db_utils.py index 6f8ae28..6159129 100644 --- a/bot/db_utils.py +++ b/bot/db_utils.py @@ -26,14 +26,14 @@ def get_random_character() -> Character | None: if not characters: return None - weights = [c['weight'] for c in characters] + weights = [config.RARITY_TO_WEIGHT[c['rarity']] for c in characters] chosen = choices(characters, weights=weights, k=1)[0] return { 'id': chosen['id'], 'name': chosen['name'], 'rarity': chosen['rarity'], - 'weight': chosen['weight'], + 'weight': config.RARITY_TO_WEIGHT[chosen['rarity']], 'image_url': chosen['file_id'] }