back to blog

Managing the distance with Python and Telegram Bots

Long distance sucks! I created a telegram bot with Python to help the distance feel less far :)

2 min readAnselm Long
personalpythontelegram bot

Context

I'm doing my semester exchange programme in New Orleans from Aug - Dec 2025, and my girlfriend is doing hers in Prague at around the same time! And long distance sucks - we have a time difference of 7 hours and when I wake up, it's usually near the end of her day. With long distance coming up, I decided to make something to help us cope with the distance.

After some brainstorming, I came up with the idea of a telegram bot! I've always wanted to make one, and as Telegram is our main form of communication, using Telegram would be easy to integrate into our routines.

Features

introductory message

I decided on a list of features:

  • Some pick up lines chosen at random (so we can get a laugh)
  • Motivational quotes and messages
  • Pictures that you can submit and your partner can see at random (main feature)
  • Telegram bubbles on demand (same as above)
  • Relationship stats: how many days till we see each other!
  • Reminders: I ran into technical issues on this sadly, so this isn't done

Tech Used

The entire bot was coded with Python, along with the Telegram Bot API. It was honestly shocking how easy it was to create a telegram bot with @BotFather. After creating the bot, I hosted it on DigitalOcean (for free! Shoutout to Jensen for putting me on that).

Reflections

I'm glad to say my girlfriend loved it! As we went about our LDR, the need for the bot became less and less as we got used to life overseas, but there were days where I was really comforted by the pictures I received in the bot. This also helped me realise that creating something isn't very hard, and inspired me to make something else for my girlfriend on her birthday (see this blog!).

Edit: Unfortunately, we're no longer together - but this was still a project that meant a lot to me so I'm not deleting this!