intro pymongo

This commit is contained in:
耿伦伦
2021-11-29 18:27:02 +08:00
parent 3fc3035cdf
commit 3f608c3510
30 changed files with 37974 additions and 95 deletions

View File

@ -7,8 +7,12 @@ class MemberMessage(Base):
def __init__(self):
self.instance = message_pb2.MemberMessage()
def __str__(self):
def format_content(self):
template = self.instance.common.displayText.defaultPattern
nickname = self.user().nickname
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + '【进入直播间】' + template.replace('{0:user}', nickname).replace('{1:string}', '')
return template.replace('{0:user}', nickname).replace('{1:string}', '')
def __str__(self):
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + '【进入直播间】' + self.format_content()