Instead of asking a general or random question, why don’t I ask ChatGPT to create a Telegram bot from scratch without using my knowledge and see how well ChatGPT can develop applications?
I’m very interested in how the challenge turns out because I’ll only give the basic information on the ChatGPT prompt to make the Feedbot app, which should be able to get news articles from a specific RSS feed and show them on my Telegram channel.
This could also be a great opportunity to test ChatGPT’s capabilities in developing customised applications.
I thought to ask ChatGPT to create a basic FeedReader Bot, which will automatically fetch the article from an RSS feed and notify me on Telegram.
After getting result from ChatGPT I’ll discuss if somthing I didn’t understand how to implement, and add feature after testing the code.
So let’s start with the prerequisites needed to create a FeedReader bot in Telegram.
ChatGPT Response: It printed the basic requirement as per my demand, where I asked ChatGPT, “I want to have a Telegram bot where it should automatically fetch the article from the RSS feed and update me on a channel.”
Now I’ll ask ChatGPT that I don’t have any knowledge about Python or any other language, and I’ve never created a bot, so please guide me with the steps and possibly share code too.
It started giving me some steps, but after writing some steps, it automatically stopped. I don’t know why, but when I ask it to continue from where it interrupted, it starts back from there.
Allow me some time to follow the steps that I have received, and I’ll get back to you in a moment.
I’m back, and while reading the steps, I’m not getting steps 3 and 4, so I asked ChatGPT that “I’m not getting steps 3 and 4, so please tell should I add them to a different file or the same file?”
Here is the code; let me run all the steps and get back to you.
I copied and pasted the code into a bot.py file and replaced the content, but I have not found chat_id, and even ChatGPT didn’t mention how to get it.
When I ask how to get the chat_id, I get the following response:
When I run the code, it’s working but not showing any errors or the output, so I cannot confirm the result.
I asked ChatGPT about the solution, and it shared a couple of more codes with me, but all had some kind of error, and after several tries, it gave me a code that finally worked.
When I run the script, it fetches the content and sends it to the bot.
The problem with the script is that I have to manually run the script to fetch an article. Let me ask ChatGPT to make some changes so it can fetch articles every 5 seconds.
Now there is another problem with the script sending the same content at an interval of 5 seconds. Instead of sending old content again, I will ask ChatGPT to share code, which will only send content if the content is new.
After making the following changes everything is working as expected, but few things are needed to implement, which I’ll do later part.
If you want to try this bot you can use the below code.
Stay tuned… In the next part, I’ll add some more features to the bot, such as a dynamic way for the user to give input, such as adding multiple RSS feeds, showing all the feeds that have been added, removing feeds, and many other things.
If you want me to cover something, then let me know so I can bring it up in the next part.
A man with a tech effusive who has explored some of the amazing technology stuff and is exploring more. While moving towards, I had a chance to work on Android development, Linux, AWS, and DevOps with several open-source tools.