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

Commit

Permalink
fix(on_blind):not await error
Browse files Browse the repository at this point in the history
  • Loading branch information
luyanci committed Jul 18, 2024
1 parent 366d5a7 commit 2419c12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async def on_gift(event):
logger.debug(json.dumps(event,ensure_ascii=False))

if event['data']['data']['blind_gift'] != None:
blind.on_blind(event=event)
await blind.on_blind(event=event)
logger.info('The gift was blind gift,it will replace.')
return
text = content.get_danmaku_on_gift(event=event)
Expand Down
4 changes: 2 additions & 2 deletions plugins/blind.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from bilibili_api import sync
from .libs import live,config

def on_blind(event:str):
async def on_blind(event:str):
blind=event['data']['data']['blind_gift']
origin_gift=blind['original_gift_name']
price=int(blind['original_gift_price'])/1000 #int后转成金额
Expand All @@ -15,7 +15,7 @@ def on_blind(event:str):

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


def _check_total(total:int):
Expand Down

0 comments on commit 2419c12

Please sign in to comment.