添加粉丝团信息,补充下播消息用法

This commit is contained in:
2022-06-05 15:53:53 +08:00
parent 4f80da70bf
commit 62655df548
5 changed files with 210 additions and 93 deletions

17
messages/fansclub.py Normal file
View File

@ -0,0 +1,17 @@
import time
from protobuf import message_pb2
from messages.base import Base
class FansclubMessage(Base):
def __init__(self):
self.instance = message_pb2.FansclubMessage()
def format_content(self):
return self.instance.content
def __str__(self):
if self.instance.type == 1:
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + '【加入粉丝团】' + self.format_content()
elif self.instance.type == 2:
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + '【粉丝牌升级】' + self.format_content()