{"id":41315,"date":"2020-02-10T12:09:34","date_gmt":"2020-02-10T09:09:34","guid":{"rendered":"https:\/\/prohoster.info\/blog\/blog_prohoster\/stroim-telegram-bot-v-yandeks-oblake"},"modified":"2020-02-10T12:09:34","modified_gmt":"2020-02-10T09:09:34","slug":"stroim-telegram-bot-v-yandeks-oblake","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/stroim-telegram-bot-v-yandeks-oblake","title":{"rendered":"Building a Telegram bot in Yandex Cloud","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/4a758744e4fc6bc797d270fa1bc42ef3.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nToday, using available materials, we will assemble in <noindex><a rel=\"nofollow\" href=\"https:\/\/cloud.yandex.ru\/\"><i>Yandex Cloud<\/i><\/a><\/noindex> <i>Telegram bot<\/i> using <noindex><a rel=\"nofollow\" href=\"https:\/\/cloud.yandex.ru\/services\/functions\"><i>Yandex Cloud Functions<\/i><\/a><\/noindex> (or <i>Yandex functions<\/i> \u2014 for brevity) and <noindex><a rel=\"nofollow\" href=\"https:\/\/cloud.yandex.ru\/services\/storage\"><i>Yandex Object Storage<\/i><\/a><\/noindex> (or <i>Object Storage<\/i> \u2014 for clarity). The code will be in <i>Node.js<\/i>. However, there is one delicate circumstance \u2014 an organization called, let's say, <i>Roskomtsenzur<\/i> (censorship is prohibited by Article 29 of the Constitution of the Russian Federation), does not allow internet providers in Russia to send requests to <i>Telegram API<\/i> at the address: <code>https:\/\/api.telegram.org\/<\/code>. Well, we won't \u2014 if it's not possible, it's not possible. After all, in our suitcase we have what's called <i>webhooks<\/i> \u2014 with their help, we don\u2019t make requests to a specific address, but simply send our request as a response to any request made to us. In other words, as they say in Odessa, we answer a question with a question. Therefore, <i>Telegram API<\/i> it will not appear in our code.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\n<b class=\"spoiler_title\">Disclaimer<\/b><i>The names of any government organizations mentioned in this article are fictional, and any potential coincidences with the names of real organizations are coincidental. <\/i> <\/p>\n<p>So, we will create a bot that supplies us with smart thoughts. Just like the one in the picture:<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/t.me\/SmartThoughtsBot\"><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/6b7aca248999621a20f8a0ec29e75c75.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<p>You can try it out \u2014 here\u2019s the name: <b><i>@SmartThoughtsBot<\/i><\/b>. Did you notice the button <i>\u2018Alice's Skill\u2019<\/i>? \u042d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0431\u043e\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c \u00ab\u043a\u043e\u043c\u043f\u0430\u043d\u044c\u043e\u043d\u043e\u043c\u00bb \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u043e\u0433\u043e <i>of Alice's skill<\/i>, i.e., it performs the same functions as <i>Alice's skill<\/i> and, possibly, they will be able to coexist peacefully by promoting each other. How to create <i>Smart Thoughts Skill<\/i> is described in the article <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/465275\/\"><b><i>Alice acquires a skill<\/i><\/b><\/a><\/noindex>. Now (after making some changes post-publication of the aforementioned article), this <i>skill<\/i> will look something like this on your smartphone:<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/alice.ya.ru\/s\/f785af07-4578-4a6b-95ae-485bd803ae20\"><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/e92c340f8d947ba9252e0fcab0511ce6.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<h2>Creating a bot<\/h2>\n<p>\nI hope this tutorial will be useful to everyone, including beginner 'bot builders'. Therefore, in this section, I will describe in detail how to create bots in <i>Telegram<\/i>'of bots. For those who do not need this information \u2014 go to the next sections. <\/p>\n<p>Open the app <i>Telegram<\/i>, call the father of all bots (just like people) \u2014 <b><i>@BotFather<\/i><\/b> \u2014 and first, give him the command \/help to refresh our memory on what we can do. Right now, we will be interested in the command <i>\/newbot<\/i>.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/12a0e84dd712e0c74dee0463f1b44e74.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nSince the bot described here is already created, for demonstration purposes I will create a different bot for a short time (then I will delete it). I will name it <i>DemoHabrBot<\/i>. Names (<i>username<\/i>) of all Telegram bots must end with the word <i>bot<\/i>, for example: <i>MyCoolBot<\/i> or <i>my_cool_bot<\/i> \u2014 this is for bots. But first, we give the bot a name (<i>name<\/i>) \u2014 and this is for people. The name can be in any language, contain spaces, and doesn't have to end with a word <i>bot<\/i>, and it doesn't even have to be unique. In this example, I named this bot <i>Demo Habra<\/i>.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/682ecf64724cabcfef96639d6de87521.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nNow we choose a name for the bot (<i>username<\/i>, the one meant for bots). Let's call it <i>DemoHabrBot<\/i>. Everything related to the bot's name (<i>name<\/i>) has nothing to do with its identity \u2014 <i>username<\/i> (or it does, but in the opposite sense). After successfully creating a unique name for the bot, we need to copy and keep (in strict secrecy!) the token shown in the screenshot with the red arrow. We will use it shortly to set the webhook from <i>Telegram<\/i>'a webhook to our <i>Yandex function<\/i>.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/78254946c9f763d212a1952bac6c706f.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nAnd now let's give a command to the father of all bots: <i>\/mybots<\/i>, and it will show us a list of all the bots we've created. For now, let's leave the freshly minted bot <i>Demo Habra<\/i> (it was created to show how to create bots, but we will still use it today for other demonstration purposes), and let's look at the bot <i>Smart Thoughts<\/i> (<i>@SmartThoughtsBot<\/i>). Click the button with its name in the list of bots.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/98434725cb0d7441ec5f2552b0b508a8.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nHere we can configure our bot. By clicking the button <i>Edit\u2026<\/i> we will go to edit one option or another. For example, by clicking the button <i>Edit Name<\/i> we can change the name of the bot, say instead of <i>Smart Thoughts<\/i>, write <i>Nonsensical Ideas<\/i>. <i>Botpic<\/i> \u2014 this is the bot's avatar, and it should be at least <i>150 x 150 px<\/i>. <i>Description<\/i> \u2014 this is a brief description that the user sees upon the first start of the bot, in response to the question: <i>What can this bot do?<\/i> <i>About<\/i> \u2014 an even shorter description that is transmitted with a link to the bot (<code>https:\/\/t.me\/SmartThoughtsBot<\/code>) or when viewing information about it.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/f15ba92be1bfea827273f79616bd2a3a.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nWe just need to set up the commands. To do this, we click the button <i>Edit Commands<\/i>. To standardize user practice <i>Telegram<\/i> it's recommended to always use two commands: <i>\/start<\/i> and <i>\/help<\/i>, and if the bot needs settings \u2014 an additional command \/settings. Our bot is as simple as a rock, so it doesn't need settings for now. We write down the first two commands, which we will then handle in the code. Now, if the user types a slash (the slash sign: \/) in the input field, a list of commands will appear for quick selection. Just like in the picture: on the left we set commands through the father-bot; on the right, these commands are already available to users in our bot.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/b536b5fe7b8aad3d68877a7693ea0e6f.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<h2>Yandex function<\/h2>\n<p>\nNow that our bot is created, let's proceed to <i>Yandex.Cloud<\/i>, to create a function that will run our bot's code. If you haven't worked with <i>Yandex.Cloud<\/i> , read the material <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/464739\/\"><b><i>Alice in the land of Bitrix<\/i><\/b><\/a><\/noindex>, and then \u2014 <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/440374\/\"><b><i>Yandex functions send emails<\/i><\/b><\/a><\/noindex>. I am almost certain that these relatively small articles will provide you with a good basic understanding of the subject.<\/p>\n<p>So, in the console <i>Yandex.Cloud<\/i> , in the left navigation menu, select <i>Cloud Functions<\/i>, and then click the button <i>Create function<\/i>. Assign it a name and a brief description for yourself.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/67f313c60481c5ef84af8a28b4934621.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nAfter clicking the button <i>Create<\/i> After a couple of seconds, the new function will appear in the list of all functions. Click on its name \u2014 this will take us to the <i>Overview<\/i> of our function. Here you need to turn on (<i>On<\/i>) the switch <i>Public function<\/i>, so that it becomes accessible from the external (to the <i>Yandex.Cloud<\/i>) world, and keep the values of the fields <i>Call link<\/i> and <i>Identifier<\/i> \u2014 keep it a closely guarded secret from everyone except yourself and Telegram, so that various scammers cannot invoke your function.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/3ba45d357965d567ba33ab0ee65d2eb4.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nNow, using the left menu, go to <i>Function editor<\/i> . For now, let's set aside our <i>Smart Thoughts<\/i>, and create a minimal template function to check if our bot works\u2026 In fact, in this context, this function is our bot\u2026 In short, right here and now, we will create a simple bot that will 'mirror' (i.e., send back) user requests. This template can always be used when creating new Telegram bots to make sure the connection with <i>Telegram\u2019<\/i>works properly. Click on <i>Create file<\/i>, name it <i>index.js<\/i>, and in the online <i>Code editor<\/i> , paste the following code into this file:<\/p>\n<pre><code class=\"javascript\">module.exports.bot = async (event) =&gt; {\n  \n  const body = JSON.parse(event.body);\n\n  const msg = {\n    'method': 'sendMessage',\n    'chat_id': body.message.chat.id,\n    'text': body.message.text\n  };\n\n  return {\n    'statusCode': 200,\n    'headers': {\n      'Content-Type': 'application\/json'\n    },\n    'body': JSON.stringify(msg),\n    'isBase64Encoded': false\n  };\n};\n<\/code><\/pre>\n<p>\nIn the Yandex.Cloud console, it should look something like this:<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/f0204be84468c9ae7ec1b9e4ca0dfdd9.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nNext, a bit lower, specify <i>Entry point<\/i> \u2014 <i>index.bot<\/i>, where <i>index<\/i> this is the name of the file (<i>index.js<\/i>), and <i>bot<\/i> \u2014 the name of the function (<i>module.exports.bot<\/i>). Leave all other fields 'as is', and in the upper right corner, click the button <i>Create version<\/i>. After a few seconds, this version of the function will be created. Soon, after testing <i>the webhook<\/i>, we will create a new version \u2014 <i>Smart Thoughts<\/i>.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/48cd898f83bdc29d124600828bf2143f.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<h2>Object Storage<\/h2>\n<p>\nNow that we have created <i>Yandex function<\/i>, let's create a so-called bucket ( <i>Yandex.Cloud<\/i>, i.e., a bucket in Russian, definitely not a bouquet) to store image files that will be used in our bot<i>bucket<\/i>. In the left navigation menu, select the item <i>Smart Thoughts<\/i>, click the button <i>Object Storage<\/i>Create Bucket <i>, come up with a name for it, for example,<\/i>img-bucket <i>, and, most importantly,<\/i>Set Object Access <i>to public \u2014 otherwise Telegram won't see our images. We leave all other fields unchanged. Click the button<\/i> make public \u2014 otherwise, Telegram will not see our images. All other fields remain unchanged. Click the button <i>, come up with a name for it, for example,<\/i>.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/c890a42f7d043e03300434b2c4a0258b.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nNow I suggest clicking on the bucket name and creating a folder inside it to organize the storage of images for your different applications. For example, for the Telegram bot<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/34701231536742a7889b200ff49b08b1.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nI created a folder named <i>Smart Thoughts<\/i> tg-bot-smart-thoughts <i>(no worries, I\u2019ll figure out this cipher). You create something too.<\/i> Now you can click on the folder name, enter it, and upload files:<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/c5707b5ba54fea5b548d62e097328650.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nAnd by clicking on the file name \u2014 get it<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/ead320e587e1d161e2cd54a94b4ea0d4.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nfor use in our bot, and generally \u2014 anywhere (but don\u2019t publish this <i>URL<\/i> unnecessarily, as traffic from <i>URL<\/i> Object Storage <i>is billed).<\/i> That\u2019s basically all about<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/07a833430b0584161423f363f6685306.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nObject Storage <i>. Now you will know what to do when you see a prompt to upload files there.<\/i>Webhook<\/p>\n<h2>Now we will set up the<\/h2>\n<p>\nwebhook <i>\u2014 i.e., when the bot receives an update (for example, a message from a user), a request (<\/i> request <i>Telegram<\/i> ) with the data will be sent from the server <i>Yandex function<\/i> to our<i>webhook<\/i>. Here\u2019s a line you can simply paste into your browser's address bar and then refresh the page (you only need to do this once): <code>https:\/\/api.telegram.org\/bot{bot_token}\/setWebHook?url={webhook_url}<\/code><br \/>\nJust replace <i>{bot_token}<\/i> with the token we received from the parent bot when creating our bot, and <i>{webhook_url}<\/i> \u2014 with <i>URL<\/i> our <i>Yandex functions<\/i>. Wait a minute! But isn\u2019t it <i>Roskomtsenzur<\/i> forbidding providers in Russia to service the address <code>https:\/\/api.telegram.org<\/code>. Yes, that\u2019s correct. But you\u2019ll think of something. After all, you can, for example, ask your grandmother in Ukraine, Israel, or Canada \u2014 there are no 'Russian censorship' there, and only God knows how people live without it. In the end, the request-response when setting up the webhook should look like this:<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/713834a1665520d3e471cd3d1831ac06.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nTesting. It should 'mirror'.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/3ab0e97f9b0ca06295fe7f5f793aab2c.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nAnd it does. Congratulations \u2014 now <i>Yandex function<\/i> is called <i>Telegram<\/i>it's a bot!<\/p>\n<h2>Smart Thoughts<\/h2>\n<p>\nAnd now let's create Smart Thoughts. The code is open and located at <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/stmike\/tg-bot-smart-thoughts\"><b><i>GitHub<\/i><\/b><\/a><\/noindex>. It's well-commented, and it\u2019s just about a hundred lines. Read it as if you were an opera diva reading a libretto! <\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/2ad0e96a2169d0859ccec836f151d3ea.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nClone the project and install the dependencies:<\/p>\n<pre><code class=\"plaintext\">git clone https:\/\/github.com\/stmike\/tg-bot-smart-thoughts.git\ncd tg-bot-smart-thoughts\nnpm i\n<\/code><\/pre>\n<p>\nMake the necessary changes to the file <i>index.js<\/i> (optional; you can leave it unchanged). Create <i>zip<\/i>-archive, containing the file <i>index.js<\/i> and the folder <i>node_modules<\/i> inside, for example, named <i>smart.zip<\/i>.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/c8c97707515338a01f8b8ed7f743c4a5.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nNow navigate to our <i>Yandex functions<\/i>, select the tab <i>ZIP archive<\/i>, click the button <i>Choose file<\/i>, and upload our archive <i>smart.zip<\/i>. Finally, in the upper right corner, click the button <i>Create version<\/i>.<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/96634c132848278ecc00a509e61b13f0.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nAfter a few seconds, when the function updates, let's test our bot again. Now it no longer \"mirrors\" but delivers smart thoughts!<\/p>\n<p><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/0c683826b5ef2bdbbd0253de4691900a.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nThat's all for today. More articles are coming. If you're interested in similar topics, subscribe for notifications about new articles. You can subscribe here, or on <i>Telegram<\/i>-channel <noindex><a rel=\"nofollow\" href=\"https:\/\/t.me\/it_tutorial_zahar\"><i>IT Tutorial Zakhar<\/i><\/a><\/noindex>, or <i>Twitter<\/i> <noindex><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/mikezaharov\"><i>@mikezaharov<\/i><\/a><\/noindex>.<\/p>\n<h2>Links<\/h2>\n<p>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/stmike\/tg-bot-smart-thoughts\"><b><i>Code on GitHub<\/i><\/b><\/a><\/noindex><br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/cloud.yandex.ru\/docs\/functions\/\"><b><i>Yandex Cloud Functions<\/i><\/b><\/a><\/noindex><br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/cloud.yandex.ru\/docs\/storage\/\"><b><i>Yandex Object Storage<\/i><\/b><\/a><\/noindex><br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/core.telegram.org\/bots\"><b><i>Bots: An introduction for developers<\/i><\/b><\/a><\/noindex><br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/core.telegram.org\/bots\/api\"><b><i>Telegram Bot API<\/i><\/b><\/a><\/noindex><\/p>\n<h2>Donations<\/h2>\n<p>\n<noindex><a rel=\"nofollow\" href=\"http:\/\/yasobe.ru\/na\/vui\"><img decoding=\"async\" alt=\"Building a Telegram bot in Yandex Cloud\" src=\"\/wp-content\/uploads\/2020\/02\/250f8765713080fcbbdaf56c04dc882f.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/486876\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0438\u0437 \u043f\u043e\u0434\u0440\u0443\u0447\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043c\u044b \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0435 Telegram-\u0431\u043e\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Yandex Cloud Functions (\u0438\u043b\u0438 \u042f\u043d\u0434\u0435\u043a\u0441-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u0434\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438) \u0438 Yandex Object Storage (\u0438\u043b\u0438 \u041e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u2014 \u0434\u043b\u044f \u044f\u0441\u043d\u043e\u0441\u0442\u0438). \u041a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 Node.js. \u041e\u0434\u043d\u0430\u043a\u043e, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e \u043f\u0438\u043a\u0430\u043d\u0442\u043d\u043e\u0435 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u2014 \u043d\u0435\u043a\u0430\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c, \u0441\u043a\u0430\u0436\u0435\u043c \u0442\u0430\u043a, \u0420\u043e\u0441\u0441\u041a\u043e\u043c\u0426\u0435\u043d\u0437\u0443\u0440 (\u0446\u0435\u043d\u0437\u0443\u0440\u0430 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u0451\u0439 29 \u041a\u043e\u043d\u0441\u0442\u0438\u0442\u0443\u0446\u0438\u0438 \u0420\u0424), \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u043c [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":41316,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-41315","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0438\u0437 \u043f\u043e\u0434\u0440\u0443\u0447\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043c\u044b \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0432.\" \/>\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\/stroim-telegram-bot-v-yandeks-oblake\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\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\u0421\u0442\u0440\u043e\u0438\u043c Telegram-\u0431\u043e\u0442 \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0435 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0438\u0437 \u043f\u043e\u0434\u0440\u0443\u0447\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043c\u044b \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0432.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/stroim-telegram-bot-v-yandeks-oblake\" \/>\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=\"2020-02-10T09:09:34+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-02-10T09:09:34+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\udd47Building a Telegram bot in Yandex.Cloud | ProHoster","description":"Today we will build from available materials in.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/stroim-telegram-bot-v-yandeks-oblake","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\u0421\u0442\u0440\u043e\u0438\u043c Telegram-\u0431\u043e\u0442 \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u0435 | ProHoster","og:description":"\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0438\u0437 \u043f\u043e\u0434\u0440\u0443\u0447\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043c\u044b \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0432.","og:url":"https:\/\/prohoster.info\/en\/blog\/stroim-telegram-bot-v-yandeks-oblake","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":"2020-02-10T09:09:34+00:00","article:modified_time":"2020-02-10T09:09:34+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"41315","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":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 00:19:25","updated":"2022-09-29 21:53:55","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\/41315","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=41315"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/41315\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/41316"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=41315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=41315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=41315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}