top of page

Modifying my telegram bot (part 1)

  • Writer: Nicole Seah
    Nicole Seah
  • May 25, 2021
  • 2 min read

Updated: Jun 12, 2021

Part 1, not because I already have future updates in mind, rather it's more of a 'keep the project open' title.


While having dinner, I suddenly thought of a new idea to implement for my bot. Honestly, after writing the code, I find that it's not very efficient and perhaps counterproductive. But anywho, the process was quite challenging after not using python for a semester, but it was really fulfilling after I managed to implement the new function!


So this 'grand' idea, was to extract dates from a forwarded/copied message - which I would, in turn, send to the bot, and have it send me a compiled list of event dates. Since I'm not sure how to store information within the bot itself, I resorted to using a separate telegram group chat which includes me and the bot.


Basically, when I forward a message to my bot (via direct message), the bot will extract the date, and send it to me in the group chat - which I have conveniently named 'Reminders'. This would help me keep track of all the dates I need to take note of automatically.


Here are a few pictures to explain what I got the bot to do.


ree

In the picture above, I forward/copy messages which include important dates directly to the bot.


ree

The bot extracts the date, and sends it to me in a separate telegram group - which I had to indicate it's chat_id in my code. - I did this by adding the @RawDataBot to the group chat, kudos to whoever made this bot because it made finding the id so much easier.

ree

There are a few flaws and some major second thoughts.

  1. I could just forward these messages to a group with just myself and name it 'Reminders' as well. And I would have more context about what's going on on a particular date as well.

  2. Basic level data cleaning (as you can see from the picture) which I implemented did not take into account the spaces between paragraphs or slashes between dates. Plus some messages included words that would have triggered other functions as well.

It was quite frustrating because nothing was working at the start. But I got it to work (kind of) at least! Although, it probably isn't as helpful as I thought it would be during dinner. Good problem-solving exercise - if I were to be optimistic :)


I realised I didn't include a link to my code before, so here it is. I'm extremely open to feedback and help.

Recent Posts

See All
Our telegram bot for CodeFiesta

With what I learnt from the time I made my first telegram bot, making the second bot for the CodeFiesta hackathon became a lot easier. In...

 
 
 

Comments


©2021 by Nicole Seah. Proudly created with Wix.com

bottom of page