Created
January 11, 2022 01:13
-
-
Save yanfeng42/81e18f91e0ea80ba343c27cb0006e77d to your computer and use it in GitHub Desktop.
python telegram pomodoro robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@task(alias='bot_p') | |
def bot_pomodoro(): | |
token = $your_robot_token | |
chat_id = $robot_chat_id_with_you | |
now = datetime.datetime.now() | |
minute = now.minute | |
tip = 'unknown error' | |
if minute == 0: | |
tip = 'Fighting 💪' | |
if minute == 25: | |
tip = 'Fun ♨️' | |
if minute == 30: | |
tip = 'Fighting 💪💪' | |
if minute == 55: | |
tip = 'Fun ♨️♨️' | |
msg = f'{tip}' | |
bot = telegram.Bot(token=token) | |
bot.send_message(text=msg, chat_id=chat_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment