async def add_sticker(self, data: D) -> None: message = dict(id='w', name=data['user_login'], text='image0') message['replacements'] = [[ 'image0', data['sticker']['sticker_image']['medium'], ]] MESSAGES.append(message)
async def add_message(self, data: D) -> None: if data['to']: text = f'{data["to"]["name"]}, {data["text"]}' else: text = data['text'] message = dict(id='s', name=data['from']['name'], text=text) MESSAGES.append(message)
async def add_test_messages_s(self): message = dict(id='s', name='xxx', text='-t от xxx') MESSAGES.append(message.copy()) message[ 'text'] = '-i https://gals.kindgirls.com/d009/ariel_09328/ariel_09328_8.jpg' MESSAGES.append(message.copy()) message['text'] = '@chaos обращение' MESSAGES.append(message.copy()) message['text'] = ':frog: :uuu: :rainbowfrog:' MESSAGES.append(message.copy())
async def add_test_messages_t(self): import twitch t = twitch.Twitch('sle') m = dict(id='t', name='chaos_soft', color='#ff69b4', text='-t от root') MESSAGES.append(m.copy()) m['text'] = '-i https://gals.kindgirls.com/d009/ariel_25530/ariel_25530_2.jpg' MESSAGES.append(m.copy()) m['text'] = '<] >( ;) #/ <3 <3 <3 xxx <3 <3 <3' m['emotes'] = '555555562:3-4/555555589:6-7/555555584:12-13,15-16,18-19,25-26,28-29,31-32' await t.parse_emotes(m) MESSAGES.append(m.copy()) m['text'] = 'LUL ResidentSleeper SeriousSloth' m['emotes'] = '425618:0-2/245:4-18/81249:20-31' await t.parse_emotes(m) MESSAGES.append(m.copy())
async def add_test_messages_g(self): message = dict(id='g', name='chaos-soft', text='-t от friendly') MESSAGES.append(message.copy()) message[ 'text'] = '-i https://gals.kindgirls.com/d009/ariel_09328/ariel_09328_2.jpg' MESSAGES.append(message.copy()) message['text'] = ':peka: :gta: :bearbush:' MESSAGES.append(message.copy())
async def add_message(self, data: D) -> None: message = dict(id='w', name=data['user_login'], text=data['message']) MESSAGES.append(message)
async def clean_chat(self, **kwargs): MESSAGES.append(dict(id='js', text='clean_chat'))
async def add_tts(self, message, command_text): if command_text: MESSAGES.append(dict(id='tts', text=command_text[:300]))
async def add_secret(self, **kwargs): MESSAGES.append(dict(id='m', text='xxx'))
async def add_test_messages_p(self): message = dict(id='p', name='xxx') message['text'] = '-t xxx задонатил и не сказал ничего.' MESSAGES.append(message.copy())
async def add_test_messages_y(self): message = dict(id='y', name='xxx_timestamp') message[ 'text'] = '-i https://gals.kindgirls.com/d009/ariel_09328/ariel_09328_8.jpg' message['timestamp'] = datetime.now().timestamp() - 28 * 24 * 60 * 60 MESSAGES.append(message.copy())
async def add_premium(self, data: D) -> None: text = CONFIG['goodgame']['text'].format(data['userName']) MESSAGES.append(dict(id='e', text=text))
async def add_payment(self, data: D) -> None: if data['message']: text = self.text[0].format(data['userName'], data['message']) else: text = self.text[1].format(data['userName']) MESSAGES.append(dict(id='p', text=text))
async def add_message(self, data: D) -> None: message = dict(id='g', name=data['user_name'], text=data['text'], premiums=data['premiums']) MESSAGES.append(message)