Esempio n. 1
0
            if keyword in text:
                index = 0
                if len(ks[1]) > 1:
                    index = randint(0, len(ks[1]) - 1)
                send_message(ks[1][index], chat_id, com)
                break


if __name__ == '__main__':
    com = Communication()
    com.on_receive_msg(process_msg)

    t = datetime.datetime.now(tz=pytz.utc)
    t = t.astimezone(pytz.timezone('US/Pacific'))
    t = t.replace(hour=9, minute=55)
    com.schedule_every_day_msg(t, 'Ora do mitim peçoal', GROUP_CHAT_ID)

    t = t.astimezone(pytz.timezone('US/Pacific'))
    t = t.replace(hour=10, minute=10)
    com.schedule_every_day_msg(t, 'Como vai o mitin? Muita fulerage?',
                               GROUP_CHAT_ID)

    t = t.astimezone(pytz.timezone('America/Sao_Paulo'))
    t = t.replace(hour=7, minute=55)
    com.schedule_every_day_msg(t, 'Mais um dia de labuta', GROUP_CHAT_ID)

    t = t.astimezone(pytz.timezone('America/Sao_Paulo'))
    t = t.replace(hour=11, minute=30)
    com.schedule_every_day_msg(t, 'Bora cume?', GROUP_CHAT_ID)

    t = t.astimezone(pytz.timezone('America/Sao_Paulo'))