This repository has been archived on 2022-05-30. You can view files and clone it, but cannot push or open issues or pull requests.
2019-01-20 23:10:35 +08:00

24 lines
475 B
Python

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__()