Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
feat(on_blind):make the message to simply.
Browse files Browse the repository at this point in the history
  • Loading branch information
luyanci committed Jul 20, 2024
1 parent efb211c commit d5a3003
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/blind.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ async def on_blind(event:str):
gift_name=event['data']['data']['giftName']
user_name=event['data']['data']['uname']
action=event["data"]['data']['action']
totals=gift_price - price
num=int(event["data"]['data']['num'])
totals=(gift_price - price)*num

text1=_check_total(totals)
final_text=f'{user_name}{action}{origin_gift}{origin_action}{gift_name},{text1}' #懒得写到roomcfg里了
final_text=f'{user_name}{origin_action}{gift_name}x{num},{text1}' #懒得写到roomcfg里了
await live.send_danmu(text=final_text)


def _check_total(total:int):
if total > 0:
return f'赚{total:0.2f}元'
return f'赚{total:0.1f}元'
elif total < 0:
return f'亏{abs(total):0.2f}元'
return f'亏{abs(total):0.1f}元'
else:
return ''

0 comments on commit d5a3003

Please sign in to comment.