Example #1
0
 def handle_danmu(self, bytes_msg):
     dic = json.loads(bytes_msg.decode('utf-8'))
     cmd = dic['cmd']
     # print(cmd)
     if cmd == 'DANMU_MSG':
         # print(dic)
         printer.print_danmu(dic)
     return True
Example #2
0
    def handle_danmu(self, data: dict) -> bool:
        if 'cmd' in data:
            cmd = data['cmd']
        elif 'msg' in data:
            data = data['msg']
            cmd = data['cmd']
        else:
            return True  # 预防未来sbb站

        if cmd == 'DANMU_MSG':
            print_danmu(data)
        return True
Example #3
0
 def handle_danmu(self, bytes_msg):
     dic = json.loads(bytes_msg.decode('utf-8'))
     cmd = dic['cmd']
     # print(cmd)
     if cmd == 'DANMU_MSG':
         msg = dic['info'][1]
         if '+' in msg:
             try:
                 roomid, raffleid = self.get_origin(msg, '+')
                 printer.info([f'弹幕监控检测到{roomid:^9}的提督/舰长{raffleid}'], True)
                 rafflehandler.Rafflehandler.Put2Queue(
                     (roomid, raffleid), rafflehandler.handle_1_room_guard)
                 Statistics.add2pushed_raffle('YJ推送提督/舰长', 1, 2)
             except ValueError:
                 print(msg)
         printer.print_danmu(dic)
     return True
 def handle_danmu(self, data: dict):
     cmd = data['cmd']
     if cmd == 'DANMU_MSG':
         print_danmu(data)
     return True
Example #5
0
 def handle_danmu(self, body):
     dic = json.loads(body.decode('utf-8'))
     cmd = dic['cmd']
     if cmd == 'DANMU_MSG':
         printer.print_danmu(dic)
     return True
Example #6
0
 def handle_danmu(self, dict_danmu):
     cmd = dict_danmu['cmd']
     if cmd == 'DANMU_MSG':
         printer.print_danmu(dict_danmu)
     return True