Experience of development a flexible and an easy-to-configure for your needs open-source MQTT client Telegram bot. Obtaining information and controlling IoT devices via the MQTT protocol.
Experience of development a flexible and an easy-to-configure for your needs open-source MQTT client Telegram bot.
Today I will be sharing my experience in developing a flexible Telegram-bot. His purpose: obtaining information and controlling IoT devices via the MQTT protocol.
What’s so special? Because this is not just a bot with two-three hardcoded buttons to operate a light bulb (there are many examples of that on the Internet), but a bot that supports flexible subscriptions and commands to operate directly from the menu, without any changes introduced to the source code. It’s a ‘NoCode solution’, so to speak.
The bot is based on Go and the source code is made freely available on GitHab under MIT license. In this article, I’m talking about some technical aspects of implementation and the resulting functionality with usage samples.
Several factors have been pieced together. First of all, I have long wanted to transfer my smart intercom (sorry, it’s in russian) to something lighter and more universal than IoTManager. One Telegram-bot covers the entire multitude of devices and operating systems. Leave compatibility issues to comrade Durov. At last, I can open the intercom from my laptop.
Secondly, I really wanted to practice bot-writing, and I am very attracted to the very idea of managing something by means of a messenger. This is how Vas3k in his club made an admin panel via Telegram, isn’t that cool?
Writing a bot with a few hardcoded buttons is tedious. I decided to make a more versatile solution with a customized user menu and display graphics support.
The following functionally was the basic goal:
All the functionality is available directly from the bot menu without the need to change the source code. Edit the menu on the go and use it:
You can give a try to my copy of the bot at @mqtg-bot. Notice that there may be some crashes because he is deployed on the free Heroku dyno. If he doesn’t respond to /start, now you know the reason. You can run your bot by consulting the README instruction.
Hire dedicated GoLang developers from WebClues Infotech to build applications using Go language. Get best GoLang developers for your web development projects.
Launch a message app like Telegram by subscribing to our white label Telegram clone app development service.
Golang Web Development is the new trend globally. Get all the details about the Golang development here. Hire Golang Developers.
In this lesson, we are going to learn how to Creating an Image Recognizer on Golang Telegram Bot. We will go over a project on image recognition using Go. We will also create a Telegram bot, through which we can send images for recognition.
A bot to do your regular tasks… Introduction to Bot and Bot API