ivanursul

chat-bots

Further experiments, writing a Serverless Telegram Chat Bot

In my last article I wrote about how I wrote Telegram Chat for tracking co-working spends. I wrote a chatbot using Java, hosted it on my Raspberry PI 3. Yes, it’s serving its needs, we fully rely on it. However, since this chatbot was written as an experiment, I wanted to proceed with research and investigate how real chatbots are written. Why Raspberry PI 3 is not the the best place for hosting a Chat Bot Since Telegram Chat Bot can use Long-Polling model, we don’t care about a dedicated IP address or DNS record, the only thing we need is the internet connection. So yes, Raspberry PI device is a computer, we can run our program there, so hosting a Telegram Chat with Long-Polling model is an option. However, what if we are writing a Chat Bot with hundreds or thousands of requests/second? Obviously, Long-Polling model could become a bottleneck since it allows to run a single application in a single Raspberry PI which means we can’t spread the load across multiple devices, which means you can’t scale the whole construction horizontally, only vertically, by adding more CPU/RAM power. Long story short, if we want to have a scalable...

How we wrote Telegram ChatBot to keep track of co-working spends

I guess, everyone know knows what are chat bots. Do do I, I was looking for some idea of chat bots for many months and finally, I ended up with an idea for my co-working, which I made with my friends and where I am currently spending most of my life. During the month, we collect a list of expenses, then sum them up, divide by the number of people working in the office and then, finally, reach to every individual and ask to pay for general expenses. We were tracking expenses in the Google Spreadsheet and it was working fine, in general. However, I noticed that in most of the cases, people are too lazy to go into the spreadsheet and put their expenses there. So my obsession of being up to date with modern technologies and a tiny small problem with office expenses met together, I invested 3-4 hours of my time on writing a chat bot and now we are using it. I decided to stick with Telegram, a messenger which became very popular within the last years. I used Java as a programming language. Telegram has an API for chat bots, so I made a research...