{"id":31044,"date":"2019-10-31T21:39:05","date_gmt":"2019-10-31T18:39:05","guid":{"rendered":"https:\/\/prohoster.info\/blog\/rukovodstvo-kak-sdelat-prostogo-bota-dlya-telegram-na-js-dlya-novichka-v-programmirovanii\/"},"modified":"2019-10-31T21:39:05","modified_gmt":"2019-10-31T18:39:05","slug":"rukovodstvo-kak-sdelat-prostogo-bota-dlya-telegram-na-js-dlya-novichka-v-programmirovanii","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/rukovodstvo-kak-sdelat-prostogo-bota-dlya-telegram-na-js-dlya-novichka-v-programmirovanii","title":{"rendered":"Guide: How to Create a Simple Telegram Bot in JS for Programming Newbies","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>I started my journey into the world of IT just three weeks ago. Seriously, three weeks ago, I didn't even understand HTML syntax, and my acquaintance with programming languages ended with a school course on Pascal from ten years ago. However, I decided to go to an IT camp where it would be nice for kids to create a bot. I figured it couldn't be that hard.<\/p>\n<p>This marked the beginning of a long journey during which I:<\/p>\n<ul>\n<li>deployed a cloud server with Ubuntu,<\/li>\n<li>registered on GitHub,<\/li>\n<li>learned the basic syntax of JavaScript,<\/li>\n<li>read a ton of articles in English and Russian,<\/li>\n<li>finally created a bot,<\/li>\n<li>and wrote this article, finally.<\/li>\n<\/ul>\n<p>\nThe final result looked something like this:<\/p>\n<p><img decoding=\"async\" alt=\"Guide: How to Create a Simple Telegram Bot in JS for Programming Newbies\" src=\"\/wp-content\/uploads\/2019\/04\/fc072aaa72b23c95faeaa09be8a652db.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nI'll say right away, this article is for beginners\u2014to simply understand how to do basic things from the absolute starting point.<\/p>\n<p>And also\u2014for advanced programmers\u2014just to make them laugh a little. <\/p>\n<p><b>1. How to write code in JS?<\/b><\/p>\n<p>I understood that I should at least figure out the language's syntax first. I chose JavaScript simply because my next step was to create an application in ReactNative. I started with <noindex><a rel=\"nofollow\" href=\"https:\/\/www.codecademy.com\/learn\/introduction-to-javascript\">of the course<\/a><\/noindex> Codecademy and was very impressed. The first 7 days are free. Real projects. I recommend it. It took about 25 hours to complete. In reality, not everything from it was applicable. Here\u2019s roughly what the course structure looks like and the first module in detail.<\/p>\n<p><img decoding=\"async\" alt=\"Guide: How to Create a Simple Telegram Bot in JS for Programming Newbies\" src=\"\/wp-content\/uploads\/2019\/04\/e63be1e6c7f32cc3c929e0145996d569.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n<b>2. How to register a bot?<\/b><\/p>\n<p>In the beginning, I was greatly helped by this <noindex><a rel=\"nofollow\" href=\"https:\/\/archakov.im\/post\/telegram-bot-on-nodejs.html\">this article.<\/a><\/noindex> blog by someone named Archakov. He explains the very beginning. But the main thing they have is an instruction for registering a bot. I couldn't write it better, and since this is the easiest part, I'll just summarize. You need to create a bot and get its API. This is done through another bot\u2014@BotFather. Find him on Telegram, message him, follow the simple steps, and get (save!) the API key (a set of numbers and letters). I found it useful later.<\/p>\n<p><img decoding=\"async\" alt=\"Guide: How to Create a Simple Telegram Bot in JS for Programming Newbies\" src=\"\/wp-content\/uploads\/2019\/04\/b8181f6ad1c67dd47dd337f8171bf941.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n<b>3. What does the bot's code look like?<\/b><\/p>\n<p>After studying articles for a long time, I realized that it makes sense to use some library (third-party code in module format) to avoid struggling with Telegram's API and creating large chunks of code from scratch. I found the framework <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/telegraf\/telegraf\">telegraf<\/a><\/noindex>, which had to be somehow connected to something via npm or yarn. That\u2019s roughly how I understood the deployment of the bot at the time. Feel free to laugh here. I won\u2019t be offended. The most helpful were the examples at the bottom of the page when I later created the bot:<\/p>\n<p><img decoding=\"async\" alt=\"Guide: How to Create a Simple Telegram Bot in JS for Programming Newbies\" src=\"\/wp-content\/uploads\/2019\/04\/711b252c5118b47a14c52862dd869058.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n<b>3. How to create your own cloud server for 100 rubles<\/b><\/p>\n<p>After a long search, I realized that the 'npm' command from the image above refers to the command line. The command line is everywhere, but to execute it, you need to install Node Package Manager. The problem was that I was programming on a PixelBook with ChromeOS. I'll skip a lengthy section on how I learned Linux \u2014 it's unnecessary for most. If you have Windows or a MacBook, you already have a terminal. <\/p>\n<p>In short, I installed Linux via Crostini. <\/p>\n<p>However, during the process, I realized that for the bot to work constantly (not just when my computer is on), I needed a cloud server. I chose <noindex><a rel=\"nofollow\" href=\"http:\/\/vscale.io\">vscale.io<\/a><\/noindex> I deposited 100 rubles and bought the cheapest Ubuntu server (see the image). <\/p>\n<p><img decoding=\"async\" alt=\"Guide: How to Create a Simple Telegram Bot in JS for Programming Newbies\" src=\"\/wp-content\/uploads\/2019\/04\/74cdc3858900bbd0d95715f5371ef52a.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n<b>4. How to prepare the server to launch the bot<\/b><\/p>\n<p>After that, I realized that I needed to create a folder on the server to place the code file. For this, in the console (you can run it directly on the site by clicking the 'Open Console' button), I typed <\/p>\n<pre><code class=\"plaintext\">mkdir bot<\/code><\/pre>\n<p>\nbot \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0435\u0439 \u043f\u0430\u043f\u043a\u0438. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b npm \u0438 Node.js, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u043d\u0435 \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u0434 \u0438\u0437 \u0444\u0430\u0439\u043b\u0438\u043a\u043e\u0432 \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c *.js<\/p>\n<pre><code class=\"plaintext\">sudo apt update\nsudo apt install nodejs\nsudo apt install npm<\/code><\/pre>\n<p>\nI highly recommend setting up a connection to the server through your console at this stage. Here\u2019s <noindex><a rel=\"nofollow\" href=\"https:\/\/community.vscale.io\/hc\/ru\/community\/posts\/207745269-%D0%9A%D0%B0%D0%BA-%D1%81%D0%B3%D0%B5%D0%BD%D0%B5%D1%80%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D1%8C-SSH-%D0%BA%D0%BB%D1%8E%D1%87-%D0%B4%D0%BB%D1%8F-%D0%B4%D0%BE%D1%81%D1%82%D1%83%D0%BF%D0%B0-%D0%BD%D0%B0-%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80\">the instruction<\/a><\/noindex> This will allow you to work with the server directly through your computer's console.<\/p>\n<p><b>5. How to write the code for your first bot.<\/b><\/p>\n<p>And now, the simplest thing for me. Any program is just lines of text. You can type them anywhere, save them with the correct extension, and that\u2019s it. You\u2019re amazing. I used <noindex><a rel=\"nofollow\" href=\"https:\/\/atom.io\/\">Atom<\/a><\/noindex>, but honestly, you can just write in a standard notepad. The main thing is to save the file with the correct extension afterward. It\u2019s like writing text in Word and saving it. <\/p>\n<p>I created a new file and pasted the code from the telegraf page example into it, saving it as index.js (it's not necessary to name the file that, but it's customary). It\u2019s important to replace BOT_TOKEN with your API key from the second point.<\/p>\n<pre><code class=\"plaintext\">const Telegraf = require('telegraf')\n\nconst bot = new Telegraf(process.env.BOT_TOKEN)\nbot.start((ctx) =&gt; ctx.reply('Welcome!'))\nbot.help((ctx) =&gt; ctx.reply('Send me a sticker'))\nbot.on('sticker', (ctx) =&gt; ctx.reply(''))\nbot.hears('hi', (ctx) =&gt; ctx.reply('Hey there'))\nbot.launch()<\/code><\/pre>\n<p>\n<b>6. How to upload code to the server via GitHub<\/b><\/p>\n<p>Now I needed to somehow upload this code to the server and run it. This became a challenge for me. In the end, after much struggle, I realized it would be easier to create a file on github that allows me to update the code using a command in the console. I registered an account on <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/\">github<\/a><\/noindex> and created <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/b0tank\/bot\">new project<\/a><\/noindex>, where I uploaded the file. After that, I needed to figure out how to set up file uploads from my (public!) account to the server in the bot folder (if you accidentally exited, just type cd bot).<\/p>\n<p><b>7. How to upload files to the server via github part 2<\/b><\/p>\n<p>I needed to install a program on the server that would upload files from git. I installed git on the server by typing in the console <\/p>\n<pre><code class=\"plaintext\">apt-get install git<\/code><\/pre>\n<p>\nAfter that, I needed to set up file uploads. For this, I typed in the command line <\/p>\n<pre><code class=\"plaintext\">git clone git:\/\/github.com\/b0tank\/bot.git bot\n<\/code><\/pre>\n<p>\n\u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0435 \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u0448\u0438\u0431\u043a\u043e\u0439 \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0431\u044b\u043b\u043e, \u0447\u0442\u043e \u044f, \u043f\u043e \u0441\u0443\u0442\u0438, \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0442\u043e\u0440\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u0430\u043f\u043a\u0438 bot. \u0410\u0434\u0440\u0435\u0441 \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043a\u0430\u043a *\/bot\/bot\/index.js<\/p>\n<p>I decided to ignore this issue.<\/p>\n<p>And to load the telegraf library, which we request in the first line of the code, type the command in the console.<\/p>\n<pre><code class=\"plaintext\">npm install telegraf<\/code><\/pre>\n<p>\n<b>8. How to run the bot<\/b><\/p>\n<p>To do this, while in the folder with the file (to switch folders in the console, execute the command in the format <code>cd bot<\/code> To ensure that you are in the right place, you can type a command that will display all files and folders visible in the console<code> ls -a<\/code><\/p>\n<p>To start it, I typed in the console <\/p>\n<pre><code class=\"plaintext\">node index.js\n<\/code><\/pre>\n<p>\nIf there are no errors \u2014 all is well, the bot is running. Look for it on Telegram. If there is an error \u2014 apply your knowledge from step 1.<\/p>\n<p><b>9. How to run the bot in the background<\/b><\/p>\n<p>You will quickly realize that the bot only works when you are sitting at the console. To solve this problem, I used the command <\/p>\n<pre><code class=\"plaintext\">screen<\/code><\/pre>\n<p>\nAfter that, a screen will appear with some text. That means everything is fine. You are on a virtual server in the cloud. To understand better how this all works \u2014 <noindex><a rel=\"nofollow\" href=\"https:\/\/bablofil.ru\/kak-zapustit-bota-na-servere\/\">here's an article<\/a><\/noindex>. Just go into your folder and type the command to start the bot<\/p>\n<pre><code class=\"plaintext\">node index.js<\/code><\/pre>\n<p>\n<b>10. How the bot works and how to expand its functionality<\/b><\/p>\n<p>What can our bot from the example do? It can <\/p>\n<pre><code class=\"plaintext\">bot.start((ctx) =&gt; ctx.reply('Welcome!'))<\/code><\/pre>\n<p>\nsay 'Welcome!' at the moment of starting (try changing the text)<\/p>\n<pre><code class=\"plaintext\">bot.help((ctx) =&gt; ctx.reply('Send me a sticker'))<\/code><\/pre>\n<p>\nsend the message 'Send me a sticker' in response to the standard command \/help<\/p>\n<pre><code class=\"plaintext\">bot.on('sticker', (ctx) =&gt; ctx.reply(''))<\/code><\/pre>\n<p>\nsend approval in response to a sticker<\/p>\n<pre><code class=\"plaintext\">bot.hears('hi', (ctx) =&gt; ctx.reply('Hey there'))<\/code><\/pre>\n<p>\nreply 'Hey there' if someone writes 'hi'<br \/>\nbot.launch()<\/p>\n<p><img decoding=\"async\" alt=\"Guide: How to Create a Simple Telegram Bot in JS for Programming Newbies\" src=\"\/wp-content\/uploads\/2019\/04\/d2a52f8feb46ff67ee39622c56e8ce8e.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nIf you look at the code in <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/b0tank\/bot\/blob\/master\/index.js\">github<\/a><\/noindex>, you'll quickly realize that I haven't strayed far from this functionality. What is actively used is the function <code>ctx.replyWithPhoto<\/code> It allows sending a specified photo or gif in response to a particular text. <\/p>\n<p>A significant part of the code was written by children aged 11-13, to whom I gave access to the bot. They introduced their user cases. I think it's easy to identify which part was made by them.<\/p>\n<p>For instance, when the message 'jake' is sent, a gif featuring a well-known character from the Adventure Time cartoon is received. <\/p>\n<p><img decoding=\"async\" alt=\"Guide: How to Create a Simple Telegram Bot in JS for Programming Newbies\" src=\"\/wp-content\/uploads\/2019\/04\/56bdcb4dde80c032c225726b88417fb4.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nTo further develop the bot, you need to connect the keyboard; look for examples, for instance, <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/telegraf\/telegraf\/tree\/develop\/docs\/examples\">from here<\/a><\/noindex><\/p>\n<p><b>11. How to update the code and restart the bot<\/b><\/p>\n<p>Don't forget that you need to update the code not only on github but also on the server. It's simple to do: stop the bot (press ctrl+c),<\/p>\n<p> \u2014 enter in the console while in the target folder, <code>git pull<\/code><br \/>\n \u2014 restart the bot again with the command <code>node index.js<\/code><\/p>\n<p><b>END<\/b><\/p>\n<p>Many things described in this file will be super obvious to advanced programmers. However, when I myself tried to jump across the gap to the world of bots in one go, I really missed a guide like this. A guide that doesn't skip over things that are obvious and simple for any IT specialist. <\/p>\n<p>In the future, I plan to post about how to create your first application in ReactNative in a similar style, so stay tuned!<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/447006\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u042f \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043c\u0438\u0440 IT \u043b\u0438\u0448\u044c \u0442\u0440\u0438 \u043d\u0435\u0434\u0435\u043b\u0438 \u043d\u0430\u0437\u0430\u0434. \u0421\u0435\u0440\u044c\u0435\u0437\u043d\u043e, \u0442\u0440\u0438 \u043d\u0435\u0434\u0435\u043b\u0438 \u043d\u0430\u0437\u0430\u0434 \u044f \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 HTML, \u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u0448\u043a\u043e\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u043f\u043e Pascal 10-\u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u0440\u0435\u0448\u0438\u043b\u0441\u044f \u043f\u043e\u0435\u0445\u0430\u0442\u044c \u0432 IT-\u043b\u0430\u0433\u0435\u0440\u044c, \u0434\u043b\u044f \u0434\u0435\u0442\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u0442\u0430. \u042f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u0440\u044f\u0434 \u043b\u0438 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e. \u0421 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":23020,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-31044","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u042f \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043c\u0438\u0440 IT \u043b\u0438\u0448\u044c \u0442\u0440\u0438 \u043d\u0435\u0434\u0435\u043b\u0438 \u043d\u0430\u0437\u0430\u0434. \u0421\u0435\u0440\u044c\u0435\u0437\u043d\u043e, \u0442\u0440\u0438 \u043d\u0435\u0434\u0435\u043b\u0438 \u043d\u0430\u0437\u0430\u0434 \u044f \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 HTML, \u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u0448\u043a\u043e\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u043f\u043e Pascal 10-\u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/rukovodstvo-kak-sdelat-prostogo-bota-dlya-telegram-na-js-dlya-novichka-v-programmirovanii\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e: \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u043d\u0430 JS \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u042f \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043c\u0438\u0440 IT \u043b\u0438\u0448\u044c \u0442\u0440\u0438 \u043d\u0435\u0434\u0435\u043b\u0438 \u043d\u0430\u0437\u0430\u0434. \u0421\u0435\u0440\u044c\u0435\u0437\u043d\u043e, \u0442\u0440\u0438 \u043d\u0435\u0434\u0435\u043b\u0438 \u043d\u0430\u0437\u0430\u0434 \u044f \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 HTML, \u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u0448\u043a\u043e\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u043f\u043e Pascal 10-\u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/rukovodstvo-kak-sdelat-prostogo-bota-dlya-telegram-na-js-dlya-novichka-v-programmirovanii\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T18:39:05+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:39:05+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Guide: how to create a simple bot for Telegram on JS for programming beginners | ProHoster","description":"I started immersing myself in the world of IT just three weeks ago. Seriously, three weeks ago I didn't even understand HTML syntax, and my acquaintance with programming languages ended with a school program in Pascal from ten years ago.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/rukovodstvo-kak-sdelat-prostogo-bota-dlya-telegram-na-js-dlya-novichka-v-programmirovanii","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e: \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u043d\u0430 JS \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 | ProHoster","og:description":"\u042f \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043c\u0438\u0440 IT \u043b\u0438\u0448\u044c \u0442\u0440\u0438 \u043d\u0435\u0434\u0435\u043b\u0438 \u043d\u0430\u0437\u0430\u0434. \u0421\u0435\u0440\u044c\u0435\u0437\u043d\u043e, \u0442\u0440\u0438 \u043d\u0435\u0434\u0435\u043b\u0438 \u043d\u0430\u0437\u0430\u0434 \u044f \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 HTML, \u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u0448\u043a\u043e\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u043f\u043e Pascal 10-\u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/rukovodstvo-kak-sdelat-prostogo-bota-dlya-telegram-na-js-dlya-novichka-v-programmirovanii","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T18:39:05+00:00","article:modified_time":"2019-10-31T18:39:05+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"31044","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 04:16:23","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 13:23:43","updated":"2026-01-21 04:16:23","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/31044","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=31044"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/31044\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/23020"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=31044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=31044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=31044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}