mirror of
https://github.com/xfgryujk/blivedm.git
synced 2024-12-25 20:30:08 +08:00
更新开放平台模型礼物价格的注释
This commit is contained in:
parent
4351881f2e
commit
4da27950c8
@ -135,7 +135,7 @@ class GiftMessage:
|
|||||||
gift_num: int = 0
|
gift_num: int = 0
|
||||||
"""赠送道具数量"""
|
"""赠送道具数量"""
|
||||||
price: int = 0
|
price: int = 0
|
||||||
"""支付金额(1000 = 1元 = 10电池),盲盒:爆出道具的价值"""
|
"""(礼物单价)支付金额(1000 = 1元 = 10电池),盲盒:爆出道具的价值""" # 这个B 站文档又不写清楚是单价还是总价
|
||||||
paid: bool = False
|
paid: bool = False
|
||||||
"""是否是付费道具"""
|
"""是否是付费道具"""
|
||||||
fans_medal_level: int = 0
|
fans_medal_level: int = 0
|
||||||
|
@ -51,8 +51,9 @@ class MyHandler(blivedm.BaseHandler):
|
|||||||
|
|
||||||
def _on_open_live_gift(self, client: blivedm.OpenLiveClient, message: open_models.GiftMessage):
|
def _on_open_live_gift(self, client: blivedm.OpenLiveClient, message: open_models.GiftMessage):
|
||||||
coin_type = '金瓜子' if message.paid else '银瓜子'
|
coin_type = '金瓜子' if message.paid else '银瓜子'
|
||||||
|
total_coin = message.price * message.gift_num
|
||||||
print(f'[{message.room_id}] {message.uname} 赠送{message.gift_name}x{message.gift_num}'
|
print(f'[{message.room_id}] {message.uname} 赠送{message.gift_name}x{message.gift_num}'
|
||||||
f' ({coin_type}x{message.price})')
|
f' ({coin_type}x{total_coin})')
|
||||||
|
|
||||||
def _on_open_live_buy_guard(self, client: blivedm.OpenLiveClient, message: open_models.GuardBuyMessage):
|
def _on_open_live_buy_guard(self, client: blivedm.OpenLiveClient, message: open_models.GuardBuyMessage):
|
||||||
print(f'[{message.room_id}] {message.user_info.uname} 购买 大航海等级={message.guard_level}')
|
print(f'[{message.room_id}] {message.user_info.uname} 购买 大航海等级={message.guard_level}')
|
||||||
|
Loading…
Reference in New Issue
Block a user