<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: BotMaker</title>
    <description>The latest articles on DEV Community by BotMaker (@gersonfreire).</description>
    <link>https://dev.to/gersonfreire</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1103878%2F37df9afe-04fa-41bb-8fc1-9c2cd73ca3e7.jpg</url>
      <title>DEV Community: BotMaker</title>
      <link>https://dev.to/gersonfreire</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gersonfreire"/>
    <language>en</language>
    <item>
      <title>ZapDrive - Validating the concept</title>
      <dc:creator>BotMaker</dc:creator>
      <pubDate>Thu, 24 Oct 2024 13:04:22 +0000</pubDate>
      <link>https://dev.to/gersonfreire/zapdrive-validating-the-concept-4p95</link>
      <guid>https://dev.to/gersonfreire/zapdrive-validating-the-concept-4p95</guid>
      <description>&lt;p&gt;Hello entrepreneurial Devs!&lt;/p&gt;

&lt;p&gt;I had an idea some time ago and would like to validate the concept with the audience here at Dev.to. And I'll tell you right now, this is not just another "miracle SaaS" :-)&lt;/p&gt;

&lt;p&gt;Among the various instant messaging apps that I use and for which I have already developed products, this one in particular was born from a pain that bothers me and I believe other users as well, especially when using WhatsApp.&lt;/p&gt;

&lt;p&gt;That's why I decided to share it with the aim of not only gathering suggestions and opinions but also so that, if validated, this idea can be developed in a collaborative, open source and open model.&lt;/p&gt;

&lt;p&gt;When using WhatsApp, I noticed that, unlike several other apps, it always stores all files, attachments and images locally on the user's device, without exception, unless I'm mistaken, and feel free to correct me.&lt;/p&gt;

&lt;p&gt;This has several advantages and disadvantages, but in my humble opinion, it is more disadvantageous than advantageous, because, in addition to taking up space on the device, it exposes the user to the loss of these assets in cases of device problems or lack of space. It is true that it is possible to make a backup, but even so, I would like local storage to be optional, like, for example, in Telegram, where the default is cloud storage, automatically.&lt;/p&gt;

&lt;p&gt;So, I thought, why not create a platform integrated with Zap, since I am somewhat fluent in integrations with this app, so that the "backup" and, more than that, the main storage location would be in the cloud, free of charge and with other advantages, such as direct sharing from the cloud, and other facilities, such as editing, interaction with files via AI and other functionalities (which I will gradually explain here, in possible future articles)?&lt;/p&gt;

&lt;p&gt;With this platform, the user could, via a bot that would be developed, automatically store a copy of their files in the cloud, with all the security, of course, and then eventually delete them from the device and then selectively download them again. With this, they could afford to delete them locally and bring them back whenever they wanted and "if" they wanted.&lt;/p&gt;

&lt;p&gt;But, you might say, I can already do this today with other virtual "drives". Yes, but you have to, somehow, manually take files back and forth from Whatsapp to the virtual drive. The idea here is to do this automatically in the app itself, for which the user would simply need to register on the ZapDrive web platform. ZapDrive itself would maintain the entire flow automatically.&lt;/p&gt;

&lt;p&gt;As for the technical details, I will not address them in this article, because first I need to know, with the help of the community here, what they think about this. Then, I intend to immediately create a repository and a public project on Github and build this in a shared way as well. I already have idle resources, such as space and others, such as cloud space, without any burden for development.&lt;/p&gt;

&lt;p&gt;But let's go, since this is a democratic space, the challenge and consultation are launched. Feel free to give your opinion, but remember, don't come just to give "-", please explain your reasons too, because I have been constantly "demoted" without knowing the reasons, but let it go, it's part of the culture.&lt;/p&gt;

&lt;p&gt;Thank you in advance to everyone and let's make it happen!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Monitoring servers with Telegram</title>
      <dc:creator>BotMaker</dc:creator>
      <pubDate>Tue, 22 Oct 2024 23:17:46 +0000</pubDate>
      <link>https://dev.to/gersonfreire/monitor-servers-with-telegram-e7e</link>
      <guid>https://dev.to/gersonfreire/monitor-servers-with-telegram-e7e</guid>
      <description>&lt;p&gt;The new framework for Telegram that we are developing has already produced its first usable offspring.&lt;/p&gt;

&lt;p&gt;I used the Framework to create the HostWatchBot chatbot on Telegram, which allows me to monitor my servers, in other words, it already addresses my "pain", which I believe is the same as many others, which is why I am sharing it here.&lt;/p&gt;

&lt;p&gt;All of this is in open source code on Github, within the Framework repository, and I decided to share it for those who want to learn more about the advantages of using the Telegram platform as a true "app store", without spending anything and without much effort to adapt to those things that only Google&lt;br&gt;
and Apple require from developers. In other words, your "app" will be within Telegram in the form of a "bot", quickly and free of charge, with no annual fees and with the ease of using any language and even creating web "mini-apps".&lt;/p&gt;

&lt;p&gt;All of this on mobile, web and desktop platforms, since Telegram runs on all of them!&lt;/p&gt;

&lt;p&gt;Here is a description of how I created the HostWatchBot example chatbot using the open source framework: Telegram Bot Framework&lt;/p&gt;

&lt;p&gt;You will need to know Python to analyze the host_monitor_by_user.py script, which is a bot written by reusing the TlgBotFwk class. This is the first practical example of how to use this framework quickly and easily, using its base class to inherit all the standard commands that we would have to implement if we started from scratch. This frees the bot developer to focus only on the features that really add value, as in this case, where the goal was to create a Telegram bot that would act as a Watchdog, monitoring servers that might go down.&lt;/p&gt;

&lt;p&gt;See the source code, which is much simpler, because all that was needed was to implement the scheduling and host on and off check using "ping".&lt;/p&gt;

&lt;p&gt;With this, the end user can add, delete or check the progress of automatic checks with just a few commands in the chatbot:&lt;/p&gt;

&lt;p&gt;To add a host to be monitored (where 60 is the time in seconds between ping checks):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/pingadd host.com.br 60
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To toggle whether on/off ping results loggin displayed at chat:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/pinglog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To delete a host from the watchlist, use the command in the chatbot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/pingdelete host.com.br
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To list all your monitored hosts, use just the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/pinglist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When one of the monitored hosts stops responding to pings, the chatbot immediately sends a warning.&lt;/p&gt;

&lt;p&gt;With this, I was able to get this chatbot up and running in record time and I am already benefiting from it to "monitor" my servers; obviously, these servers have to accept responding to pings.&lt;/p&gt;

&lt;p&gt;If you want to see the bot live and in color already running on Telegram, click on the link below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://t.me/HostWatchBot" rel="noopener noreferrer"&gt;https://t.me/HostWatchBot&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or go to Github to see the source code, which is in the framework's examples folder:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/gersonfreire/telegram-bot-framework/blob/main/examples/host_monitor_by_user.py" rel="noopener noreferrer"&gt;https://github.com/gersonfreire/telegram-bot-framework/blob/main/examples/host_monitor_by_user.py&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading, make good use of it and if you want, join us in this endeavor open to the community!&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>python</category>
      <category>l</category>
    </item>
    <item>
      <title>A Python Framework for Telegram Bots</title>
      <dc:creator>BotMaker</dc:creator>
      <pubDate>Tue, 22 Oct 2024 00:15:31 +0000</pubDate>
      <link>https://dev.to/gersonfreire/a-python-framework-for-telegram-bots-238f</link>
      <guid>https://dev.to/gersonfreire/a-python-framework-for-telegram-bots-238f</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;A Python Framework for Telegram Bots: Simplifying Development and Inviting Contributors&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hello, developers! This article introduces the Telegram Bot Framework, an open source project that aims to simplify the development of bots for the Telegram platform. The main goal of this article is to attract new contributors to the project and increase the visibility of the repository on GitHub, making the framework even more robust and complete.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why a New Framework?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are several libraries and modules available for creating bots on Telegram, but none of them cover the basic functionalities that are almost indispensable, such as creating a help menu, commands to manage users, and others. The proposal of the Telegram Bot Framework is to fill these gaps and provide a solid foundation so that developers can create powerful, stable, and secure bots quickly and efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does the Framework Work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The framework is built around a base class called TlgBotFwk, which inherits from the Application class implemented by the python-telegram-bot library (version 21 or higher). This base class implements standard commands that would otherwise have to be implemented manually, freeing the developer to focus on the specific functionality of their bot.&lt;/p&gt;

&lt;p&gt;To use the framework, simply create a simple Python script and run the run() method of the TlgBotFwk class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if __name__ == "__main__":
    app = TlgBotFwk()
    app.run()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The framework loads configurations, such as the bot token and admin ID, from a .env file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features and Functionalities&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Telegram Bot Framework already has a number of functionalities implemented, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Administration commands: user management, viewing system persistence files, logs for Telegram, etc.&lt;/li&gt;
&lt;li&gt;User functionalities: help menu, useful commands, pagination of long messages, etc.&lt;/li&gt;
&lt;li&gt;Plugins: plugin system to extend the functionalities of the framework.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;HostWatchBot: A Real Use Case&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;HostWatchBot, a bot that monitors remote hosts via ping, is the first practical example of using the framework. It demonstrates how to use the framework quickly and easily, inheriting from the base class and focusing only on the functionalities that add value. HostWatchBot allows you to monitor servers, checking if they are online via pings. The source code is available on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HostWatchBot Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add a host for monitoring with a user-defined ping interval.&lt;/li&gt;
&lt;li&gt;Delete a host from the monitoring list.&lt;/li&gt;
&lt;li&gt;Enable/disable notifications for successful pings.&lt;/li&gt;
&lt;li&gt;Immediate notification to the user if a host stops responding to pings.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The HostWatchBot source code is available in the framework's GitHub repository, serving as a practical example of how to use the framework.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Invitation to Collaboration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Telegram Bot Framework is still under development and needs your help to become even better! If you are interested in contributing to the project, access the repository on GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/gersonfreire/telegram-bot-framework" rel="noopener noreferrer"&gt;https://github.com/gersonfreire/telegram-bot-framework&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Contributions in code, documentation, tests or even suggestions for new features are very welcome. Join the community and help build a powerful and complete framework for bot development on Telegram!&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>python</category>
      <category>chatbot</category>
      <category>flask</category>
    </item>
  </channel>
</rss>
