Skip to content

Instantly share code, notes, and snippets.

@yanfeng42
Created January 11, 2022 01:13
Show Gist options
  • Save yanfeng42/81e18f91e0ea80ba343c27cb0006e77d to your computer and use it in GitHub Desktop.
Save yanfeng42/81e18f91e0ea80ba343c27cb0006e77d to your computer and use it in GitHub Desktop.
python telegram pomodoro robot
@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