You've already forked Douyin_Web_Live
添加粉丝团信息,补充下播消息用法
This commit is contained in:
17
messages/fansclub.py
Normal file
17
messages/fansclub.py
Normal 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()
|
Reference in New Issue
Block a user