![]() ![]() First, we need to make sure to load our modules using Node.js’s require() in the index.js file: const TelegramBot = require('node-telegram-bot-api') const ogs = require('open-graph-scraper') const firebase = require('firebase') Your project should have a node_modules folder containing the required modules. We are all set up now and ready to start programming. He will give you a token which you will need to use the HTTP API. ![]() BotFather will guide you through the process. Add the BotFather to Telegram and start creating a new bot by sending the /newbot command. Luckily Telegram makes it very easy to create and manage bots. Because we will be using Firebase for storing the data you will also need the firebase module. Node-telegram-bot-ap is used to interact with the Telegram API and we will use open-graph-scraper to easily scrap the OG data from our bookmarked websites. In the Terminal go to your project folder, create a package.json using init and add/install the modules we will be using, node-telegram-bot-api, open-graph-scraper and firebase: cd your-project-folder yarn init yarn add node-telegram-bot-api open-graph-scraper firebase The first thing we need to do is creating our project folder, all we need for now is a project folder and a index.js file. You can find the full code for the bot here on GitHub. ![]() Because we will be using Node.js, you will, obviously, need to have it installed. I’m assuming that you have some sort of package manager installed, I will be using Yarn but NPM will work just as fine (however the commands for installing packages will be different). ![]() As you will see, it is actually very easy to create your own bookmark manager which you can access from anywhere by creating a Telegram bot! Before we start In this part, we will take a look at how to build the bot.Įven though browsers are implementing shared bookmarks between devices and there are a bunch of services helping you keep track of your bookmarks, I always found something that I was not satisfied with. This article is part of a series on how to build a Telegram bot and save our bookmarks, deploy the bot, and create a simple interface in Vue.js to manage our bookmarks. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |