def execute(message): chat = message['chat'] chat_id = chat['id'] text = message['text'] if text.startswith('/test'): text = text.lstrip('/test') voice_prob = 0.2 resp = Response(mood=Mood.NEUTRAL, voice_probability=voice_prob) resp.add_msg_or_voice(text) main.send_to_group(resp) else: main.send_response(str(chat_id), responder.reply_to(message))
def test(inp): fr = { 'first_name' : 'Tommi', 'id' : 1000 } chat = { 'type' : 'group', 'id' : 11, 'title' : 'uelftest' } message = { 'date' : 1465221757, 'text' : inp, 'from' : fr, 'message_id' : 1, 'chat' : chat } response = responder.reply_to(message) if response.is_empty(): print 'Response is empty' return main.send_to_admin(response)