Api使用Android app弹幕协议

This commit is contained in:
2019-01-28 18:54:24 +08:00
parent e46e4ec0d7
commit 5da70e81f9
7 changed files with 77 additions and 64 deletions

10
Chat.py
View File

@ -2,8 +2,8 @@ from User import User
class Chat:
content:str=""
user:User=None
content: str =""
user: User=None
def __init__(self, json=None):
if json:
@ -11,9 +11,9 @@ class Chat:
def parse(self, json):
self.user = User(json)
if "Msg" in json:
if "content" in json["Msg"]:
self.content = json["Msg"]['content']
if "extra" in json:
if "content" in json["extra"]:
self.content = json["extra"]['content']
def __str__(self):
return "{} : {}".format(self.user,self.content)