Pizza Server Bot

Pizza Server Bot

Project Description

I created a pizza telegram bot by modifying the tutorial created by Baeldung. I added a few more options of pizza toppings to order and drinks as well. The model is stateful, I had to add a new state for drinks, which is similar to the toppings state that was created by Baeldung already. It's interesting to see how the library uses reflection to find the methods inside the registered ability bot class that return Ability — class provided by the library to simplify the using of Telegram Bot API, and facilitate using webhooks instead of polling.

The algorithm of the messages the bot interact with the user works the following way. You have to be an ADMIN to use that command, I can promote people if they write me a comment. The state machine of the new command is in the picture on the left. I created the diagrams of state machines using Mermaid.js. Mermaid.js is a library that enables us to draw diagrams like state machine, ERD, pie chart, gantt diagram, git branching diagram, flow chart, sequence diagram, and a few more in Markdown. Markdown is a file format that is designed to be at the same time easy to write, easy to read even without a processor, and pretty to read code, divide it into sections, or even input LaTeX. The last one requires KaTeX support. Some places that support Markdown support KaTeX as well, like Obsidian or Mathematics Stack Exchange, but for example Stack Overflow or Github don't currently. I often use chatGPT to generate a stub of a mermaid diagram. It says it cannot draw diagrams if I use the word draw, that's why I have to tell it to just prepare mermaid diagram or likewise.

Pizza Server Bot

Technologies Used

  • Maven
  • Java
  • Telegram API

Project Links