改善代码兼容性

This commit is contained in:
2019-04-07 16:01:27 +08:00
committed by JerryYan
parent 00190468a8
commit 5fa4ee929e
8 changed files with 56 additions and 39 deletions

View File

@ -4,9 +4,9 @@ from .Lottery import Lottery
class Chat:
content: str =""
user: User=None
filterString:list = ["",]
content =""
user=None
filterString = ["",]
isFiltered = False
def __init__(self, json=None, lottery:Lottery = None):

View File

@ -3,12 +3,12 @@ from .User import User
class Gift:
ID:int = 0
count:int = 0
roomID:int = 0
giftList:dict = {}
amount:int = 0
user:User = None
ID = 0
count = 0
roomID = 0
giftList = {}
amount = 0
user = None
def __init__(self, json=None):
if json:

View File

@ -5,14 +5,14 @@ from .LuckyUser import LuckyUser
class Lottery:
ID: int = 0
ID = 0
isActive = False
content = ""
isFinished = False
luckyUsers = []
joinedUserCount = 0
prizeName = ""
finish:int = 0
finish = 0
def __init__(self, json=None):
if json:

View File

@ -2,9 +2,9 @@ from .User import User
class MemberMsg:
type:int = 0
content:str = ""
user:User = None
type = 0
content = ""
user = None
def __init__(self, json=None):
if json:

View File

@ -1,11 +1,11 @@
class User:
ID: int = 0
name: str = ""
brand: str = ""
level: int = 0
type: int = 0
block: bool = False
mute: bool = False
ID = 0
name = ""
brand = ""
level = 0
type = 0
block = False
mute = False
def __init__(self, json=None):
if json:
@ -47,8 +47,7 @@ class User:
else:
if self.type != 0:
return "[{}{}]{}".format(self.brand, self.level, self.name)
return "<{}{}>{}".format(self.brand,self.level,self.name)
return "<{}{}>{}".format(self.brand, self.level, self.name)
def __unicode__(self):
return self.__str__()