Now that we have a basic understanding of what a Telegram bot is and how it works, let’s go ahead and start building one to give us a more practical understanding. Essentially the way we would interact with a Telegram bot is to send it messages or commands through the Telegram chat UI, the bot receives such message or command and interacts with it in a certain way based on how it has been programmed to. Telegram has an existing bot API that allows us to connect bots to their system and also provides ways for us to use this API to control these bots. Users can interact with bots by sending them messages, commands and inline requests. Telegram gives a short and concise explanation:īots are third-party applications that run inside Telegram.
You can get the final code of the application here. If you currently have a lower version you can use nvm to install that version(11.6) alongside your current Node version. It is also important to note that the code in this article uses certain features of ES2019 which requires Node version 11.6 or higher so you may encounter errors if you are using a lower Node version.
NODEBOT COM PORT REDIRECT HOW TO
You’ll also need to have Node and NPM installed, If you don’t have the Node package installed you can get it from the official Node.js website, adequate instructions are provided there on how to get it setup. To follow along with this article, it is expected that you have a basic understanding of Node.js and Javascript.
You’ll also gain a very practical understanding by developing a bot that retrieves an English word from a user and then returns the various dictionary definitions of that word using the Oxford Dictionary API. TL DR In this article you’ll learn how to build a Telegram bot using Node.js.