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

Commit

Permalink
feat:上舰的类型判断
Browse files Browse the repository at this point in the history
同时尝试修复上个commit
  • Loading branch information
luyanci committed Jun 8, 2024
1 parent c0081b1 commit a8d3b59
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions lib/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ def get_danmaku_on_gift(event:str):
contented=content_name.replace(" {gift} ",f"{giftname}")
except:
print(contented)


return contented

def get_danmaku_on_wuser(event:str):
Expand All @@ -38,18 +36,27 @@ def get_danmaku_on_wuser(event:str):
content_name=contents.replace(" {user} ",f"{name}")
except:
print(content_name)


return content_name

def get_danmaku_on_buyguard(event:str):
info = event['data']
print(info)
#giftname=info['gift_name']
giftname=get_guard_type(int(info["guard_level"]))
name= info['username']
try:
contents=str(main.config.roomcfg["chat"]["global"]["events"]['guard'])
contents=str(main.config.roomcfg["chat"]["global"]["events"]['gifts'])
content_name=contents.replace(" {user} ",f"{name}")
#contented=content_name.replace(" {gift} ",f"{giftname}")
contented=content_name.replace(" {type} ",f"{giftname}")
except:
print(content_name)
print(contented)
return contented

def get_guard_type(num:int):
if num == 1:
return "总督"
if num == 2:
return "提督"
if num == 3:
return "舰长"

0 comments on commit a8d3b59

Please sign in to comment.