修正房间提示信息
This commit is contained in:
parent
e3da5d98b3
commit
414aef7eb3
@ -2,7 +2,7 @@ from User import User
|
|||||||
|
|
||||||
|
|
||||||
class MemberMsg:
|
class MemberMsg:
|
||||||
type:int = -1
|
type:int = 0
|
||||||
content:str = ""
|
content:str = ""
|
||||||
user:User = None
|
user:User = None
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ class MemberMsg:
|
|||||||
return "{} 被禁言了".format(self.user)
|
return "{} 被禁言了".format(self.user)
|
||||||
elif self.type == 4:
|
elif self.type == 4:
|
||||||
return "{} 被取消禁言了".format(self.user)
|
return "{} 被取消禁言了".format(self.user)
|
||||||
elif self.type == 0:
|
elif self.type == 1:
|
||||||
return "{} 进入了房间".format(self.user)
|
return "{} 进入了房间".format(self.user)
|
||||||
else:
|
else:
|
||||||
return self.content
|
return self.content
|
||||||
|
3
api.py
3
api.py
@ -42,7 +42,7 @@ class XiGuaLiveApi:
|
|||||||
print(*args)
|
print(*args)
|
||||||
|
|
||||||
def onPresent(self, gift: Gift):
|
def onPresent(self, gift: Gift):
|
||||||
print("礼物连击:", gift)
|
print("礼物连击 : ", gift)
|
||||||
|
|
||||||
def onPresentEnd(self, gift: Gift):
|
def onPresentEnd(self, gift: Gift):
|
||||||
print("感谢", gift)
|
print("感谢", gift)
|
||||||
@ -121,6 +121,7 @@ class XiGuaLiveApi:
|
|||||||
if "LiveMsgs" not in d["data"]:
|
if "LiveMsgs" not in d["data"]:
|
||||||
return
|
return
|
||||||
for i in d['data']['LiveMsgs']:
|
for i in d['data']['LiveMsgs']:
|
||||||
|
print(i)
|
||||||
if i['Method'] == "VideoLivePresentMessage":
|
if i['Method'] == "VideoLivePresentMessage":
|
||||||
self.onPresent(Gift(i))
|
self.onPresent(Gift(i))
|
||||||
elif i['Method'] == "VideoLivePresentEndTipMessage":
|
elif i['Method'] == "VideoLivePresentEndTipMessage":
|
||||||
|
Reference in New Issue
Block a user