You've already forked XiguaLiveDanmakuHelper
改进部分代码,增加Linux可运行的版本,可自己选择想要进入的房间
Signed-off-by: Jerry Yan <792602257@qq.com>
This commit is contained in:
23
Chat.py
Normal file
23
Chat.py
Normal file
@ -0,0 +1,23 @@
|
||||
from User import User
|
||||
|
||||
class Chat:
|
||||
|
||||
content:str=""
|
||||
user:User=None
|
||||
|
||||
def __init__(self, json=None):
|
||||
if json:
|
||||
self.parse(json)
|
||||
|
||||
def parse(self, json):
|
||||
self.user = User(json)
|
||||
if "Msg" in json:
|
||||
if "content" in json["Msg"]:
|
||||
self.content = json["Msg"]['content']
|
||||
|
||||
def __str__(self):
|
||||
return "{} : {}".format(self.user,self.content)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.__str__()
|
||||
|
Reference in New Issue
Block a user