From 287a1abaf5b0248739e72f19644f2d262047a6e9 Mon Sep 17 00:00:00 2001 From: LWR Date: Mon, 3 Jul 2023 01:04:37 +0800 Subject: [PATCH] fix: Accurately calculating the profit of 'Lucky Key' gift --- starbot/core/room.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/starbot/core/room.py b/starbot/core/room.py index 7b9d80f..038028f 100644 --- a/starbot/core/room.py +++ b/starbot/core/room.py @@ -303,6 +303,10 @@ class Up(BaseModel): num = base["num"] price = float("{:.1f}".format((base["discount_price"] / 1000) * num)) + # 幸运之钥主播收益为 1% + if base["giftId"] == 31709: + price = price * 0.01 + # 礼物统计 if base["total_coin"] != 0 and base["discount_price"] != 0: await redis.incr_room_gift_profit(self.room_id, price)