{"id":388782,"date":"2024-06-29T08:10:05","date_gmt":"2024-06-29T08:10:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=388782"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=388782","title":{"rendered":"<span>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430 \u043a \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440\u0430\u0432\u0447\u0430\u043d\u0435!<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0441\u0442 \u043d\u0430 \u044d\u0442\u043e\u0439 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0435, \u0446\u0435\u043b\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043c\u043c\u044c\u044e\u043d\u0438\u0442\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0440\u0435\u043c\u0430\u0440\u043e\u043a \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0434\u0430, \u0435\u0441\u043b\u0438 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0441\u0432\u043e\u0439 \u043f\u0443\u0442\u044c \u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0431\u043e\u0442\u043e\u0432 \u043b\u044e\u0434\u0435\u0439 \ud83d\ude42<\/p>\n<p>\u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0433\u043e\u0434 \u044f \u0443\u0437\u043d\u0430\u043b\u0430 \u043e\u0431 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0435\u0439 \u0433\u0443\u0433\u043b-\u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0430. \u0422\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u0430\u043a \u0443\u0447\u0435\u0442 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432, \u0442\u0430\u0439\u043c-\u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442, \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 \u0442.\u043f. \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u0433\u0443\u0433\u043b\u0430 \u0438 \u0442\u0435\u043b\u0435\u0433\u0438. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 Apps Script. \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0431\u043e\u0442\u0430<\/h2>\n<p>\u041e\u0442\u043a\u0443\u0434\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0431\u043e\u0442\u044b \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0435? \u041e\u043f\u044b\u0442\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e \u043f\u0443\u043d\u043a\u0442, \u043d\u0443 \u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441 <a class=\"mention\" href=\"\/users\/botfather\">@BOTFATHER<\/a><\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/89c\/3cd\/630\/89c3cd6304e794554f92b8e75eac9648.png\" width=\"400\" height=\"516\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/89c\/3cd\/630\/89c3cd6304e794554f92b8e75eac9648.png\"\/><\/figure>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u0442\u0446\u0430 \u0432\u0441\u0435\u0445 \u0431\u043e\u0442\u043e\u0432 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u0442\u0435\u043b\u0435\u0433\u0438 \u0438 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0431\u043e\u0442 \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442.<\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8bf\/a78\/232\/8bfa7823256ce81dc8dd64cbc918e42f.png\" alt=\"\" title=\"\" width=\"494\" height=\"262\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8bf\/a78\/232\/8bfa7823256ce81dc8dd64cbc918e42f.png\"\/><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0440\u0442\u0430 \u044d\u0442\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/152\/2b4\/0da\/1522b40da4daf1e572f8a2f6bbc82738.png\" alt=\"\" title=\"\" width=\"783\" height=\"743\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/152\/2b4\/0da\/1522b40da4daf1e572f8a2f6bbc82738.png\"\/><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \/newbot, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u043e\u0442\u0430.<\/p>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0435\u0437\u0430\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u0442\u044b\u0439: \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u043e\u0442\u0430 \u043f\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \/newbot, \u0434\u0430\u0435\u043c \u0435\u043c\u0443 \u0432\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0435 \u0438\u043c\u044f \u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u0435\u043c\u0443 username \u0441 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435\u043c bot. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c API \u0442\u043e\u043a\u0435\u043d \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0431\u0443\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/beb\/6be\/877\/beb6be87736483f3e8d8da30f35f5b22.png\" width=\"963\" height=\"645\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/beb\/6be\/877\/beb6be87736483f3e8d8da30f35f5b22.png\"\/><\/figure>\n<p>\u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u043f\u0435\u0440\u0435\u0439\u0434\u044f \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 URL:<\/p>\n<p>https:\/\/api.telegram.org\/bot<strong>2011183802:AAEW7ZNRVvlr1TG1N0DNkRB9G4FmvkBUUUU<\/strong>\/getMe<\/p>\n<p><em>\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0436\u0438\u0440\u043d\u044b\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430 \u0430\u043f\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u043e\u0442\u0430<\/em><\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 \u0432\u0435\u0440\u043d\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u044d\u0442\u043e:<\/p>\n<pre><code class=\"json\">{\"ok\":true,\"result\":{\"id\":2011183802,\"is_bot\":true,\"first_name\":\"Demo for Habr\",\"username\":\"DemoForHabr_bot\",\"can_join_groups\":true,\"can_read_all_group_messages\":false,\"supports_inline_queries\":false}}<\/code><\/pre>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0433\u0443\u0433\u043b-\u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0430\u043c \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u043a.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043f\u0443\u043d\u043a\u0442 \u043c\u0435\u043d\u044e \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b\/Tools -> \u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\/ Script editor.\u00a0<\/p>\n<p>\u0414\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0432\u043e\u0442 \u044d\u0442\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1a2\/36a\/fc3\/1a236afc306ab710b20d1a3d27760ca8.png\" width=\"1436\" height=\"826\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1a2\/36a\/fc3\/1a236afc306ab710b20d1a3d27760ca8.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fd3\/e11\/bf0\/fd3e11bf04d1655bf4602fdff290462d.png\" width=\"1218\" height=\"437\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fd3\/e11\/bf0\/fd3e11bf04d1655bf4602fdff290462d.png\"\/><\/figure>\n<p>\u0417\u0430\u0442\u0440\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 JavaScript. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0433\u0443\u0433\u043b\u0430 (\u043a\u043b\u0430\u0441\u0441\u044b, \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0442.\u043f.), \u0447\u0442\u043e \u043c\u044b \u0434\u0430\u043b\u0435\u0435 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0423 \u043d\u0430\u0441 \u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0435 &#8212; API \u0431\u043e\u0442\u0430 \u0438 App_link.<\/p>\n<pre><code class=\"javascript\">const API = \"2011183802:AAEW7ZNRVvlr1TG1N0DNkRB9G4FmvkBUUUU\";  \/\/\u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0432\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0430\u043f\u0438 const App_link = \"\"; \/\/\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u0441\u0442\u044b\u043c<\/code><\/pre>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0410\u041f\u0418 \u0431\u043e\u0442\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432 \u0434\u0438\u0430\u043b\u043e\u0433\u0435 \u0441 botfather.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e send, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0447\u0430\u0442 \u0441 \u043d\u0430\u0448\u0438\u043c \u0431\u043e\u0442\u043e\u043c.<\/p>\n<pre><code class=\"javascript\">function send (msg, chat_id) {   let payload = {   'method': 'sendMessage',   'chat_id': String(chat_id),   'text': msg,   'parse_mode': 'HTML'   }   let data = {     'method': 'post',     'payload': payload   }     UrlFetchApp.fetch('https:\/\/api.telegram.org\/bot' + API + '\/', data); } <\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>send()<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u043e \u0441\u0442\u0440\u043e\u043d\u0438\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8212; \u0441 \u0442\u0435\u043b\u0435\u0433\u043e\u0439. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/developers.google.com\/apps-script\/reference\/url-fetch\/url-fetch-app\" rel=\"noopener noreferrer nofollow\">Class UrlFetchApp<\/a>.<\/p>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8212; \u0442\u0435\u043a\u0441\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0438\u0434 \u0447\u0430\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>send()<\/code>. \u041e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u043c \u044d\u0442\u043e \u0438\u0437 \u0442\u0435\u043b\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>doPost():<\/code><\/p>\n<pre><code class=\"javascript\">function doPost(e) {   let update = JSON.parse(e.postData.contents);   \/\/\u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f \"\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\"   if (update.hasOwnProperty('message')) {     let msg = update.message;     let chat_id = msg.chat.id;     let text = msg.text;     let user = msg.from.username;     if (text == \"\/hello\") {       send(\"Hello World\", chat_id)     }   } } <\/code><\/pre>\n<p>\u042d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0442 \u0431\u043e\u0442\u0430 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0447\u0430\u0442 \u0441 \u043d\u0438\u043c.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u043e\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c &#171;\/hello&#187; \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>send()<\/code>\u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438. \u042d\u0442\u043e \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u041a\u043b\u0438\u043a\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 Deploy -> New deployment.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1fc\/a90\/38d\/1fca9038dfca1ad783c97fbd3d87d857.png\" width=\"1696\" height=\"557\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1fc\/a90\/38d\/1fca9038dfca1ad783c97fbd3d87d857.png\"\/><\/figure>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e New deployment, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e \u0448\u0435\u0441\u0442\u0435\u0440\u0435\u043d\u043a\u0435 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c Web app.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/76d\/fde\/5ae\/76dfde5aeda460e38c9c8e8ed9f346b3.png\" width=\"970\" height=\"784\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/76d\/fde\/5ae\/76dfde5aeda460e38c9c8e8ed9f346b3.png\"\/><\/figure>\n<p>\u0412 \u043f\u043e\u043b\u0435 Who has access \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Anyone, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0431\u0435\u0437 \u0432\u0430\u0448\u0435\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5c5\/f95\/e4e\/5c5f95e4ee74fe3f03d85c80841c32f7.png\" width=\"948\" height=\"459\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c5\/f95\/e4e\/5c5f95e4ee74fe3f03d85c80841c32f7.png\"\/><\/figure>\n<p>\u0418 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Deploy.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ce4\/555\/5b7\/ce45555b728fa48672beb64b0cb8b089.png\" width=\"980\" height=\"773\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ce4\/555\/5b7\/ce45555b728fa48672beb64b0cb8b089.png\"\/><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d URL \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435. \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435 <em>Copy<\/em> \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 App_link, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0443\u0441\u0442\u044b\u043c.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u043e\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443:<\/p>\n<pre><code class=\"javascript\">function api_connector () {   UrlFetchApp.fetch(\"https:\/\/api.telegram.org\/bot\"+API+\"\/setWebHook?url=\"+App_link);  } <\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0431\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 API \u0438 App_link, \u0442\u0430\u043a \u0447\u0442\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>\u0421\u043d\u043e\u0432\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u0434 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e api_connector:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/837\/ac4\/3ba\/837ac43ba703271b29db05aa4917663f.png\" width=\"1285\" height=\"449\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/837\/ac4\/3ba\/837ac43ba703271b29db05aa4917663f.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ffe\/35d\/cca\/ffe35dcca500f9e20ddd652285e28757.png\" width=\"1338\" height=\"418\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ffe\/35d\/cca\/ffe35dcca500f9e20ddd652285e28757.png\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0430\u0441\u044c \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a, \u0438\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0442\u0435\u043b\u0435\u0433\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9d6\/eef\/8a0\/9d6eef8a0e1f14e45c120e64bcbab087.png\" width=\"1357\" height=\"1021\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d6\/eef\/8a0\/9d6eef8a0e1f14e45c120e64bcbab087.png\"\/><\/figure>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &#171;\/hello&#187; \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043e, \u043d\u0430 \u0447\u0442\u043e \u043d\u0430\u0448 \u0431\u043e\u0442 \u043e\u0442\u0432\u0435\u0442\u0438\u043b &#171;Hello world&#187;.<\/p>\n<hr\/>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"javascript\">const API = \"2011183802:AAEW7ZNRVvlr1TG1N0DNkRB9G4FmvkBUUUU\"; \/\/\u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0432\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0430\u043f\u0438  const App_link = \"https:\/\/script.google.com\/macros\/s\/AKfycbyS0k0r1VF0T1O1y8b_oElTXWzWNJKUiQDXS2HWdZT9q-ODieKgLoNXGQTtRoi6a8fo\/exec\"; \/\/\u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u043f\u043b\u043e\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439   function send (msg, chat_id) {   let payload = {   'method': 'sendMessage',   'chat_id': String(chat_id),   'text': msg,   'parse_mode': 'HTML'   }   let data = {     \"method\": \"post\",     \"payload\": payload   }     UrlFetchApp.fetch('https:\/\/api.telegram.org\/bot' + API + '\/', data); }  function doPost(e) {   let update = JSON.parse(e.postData.contents);   \/\/\u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f \"\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\"   if (update.hasOwnProperty('message')) {     let msg = update.message;     let chat_id = msg.chat.id;     let text = msg.text;     let user = msg.from.username;     if (text == \"\/hello\") {       send(\"Hello World\", chat_id)     }   } }  function api_connector () {   UrlFetchApp.fetch(\"https:\/\/api.telegram.org\/bot\"+API+\"\/setWebHook?url=\"+App_link);  }  <\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0433\u0443\u0433\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043e\u043c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0435\u043c\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430, \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u044e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\/\u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/585456\/\"> https:\/\/habr.com\/ru\/articles\/585456\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440\u0430\u0432\u0447\u0430\u043d\u0435!<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0441\u0442 \u043d\u0430 \u044d\u0442\u043e\u0439 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0435, \u0446\u0435\u043b\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043c\u043c\u044c\u044e\u043d\u0438\u0442\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0440\u0435\u043c\u0430\u0440\u043e\u043a \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0434\u0430, \u0435\u0441\u043b\u0438 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0441\u0432\u043e\u0439 \u043f\u0443\u0442\u044c \u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0431\u043e\u0442\u043e\u0432 \u043b\u044e\u0434\u0435\u0439 \ud83d\ude42<\/p>\n<p>\u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0433\u043e\u0434 \u044f \u0443\u0437\u043d\u0430\u043b\u0430 \u043e\u0431 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0435\u0439 \u0433\u0443\u0433\u043b-\u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0430. \u0422\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u0430\u043a \u0443\u0447\u0435\u0442 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432, \u0442\u0430\u0439\u043c-\u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442, \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 \u0442.\u043f. \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u0433\u0443\u0433\u043b\u0430 \u0438 \u0442\u0435\u043b\u0435\u0433\u0438. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 Apps Script. \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0431\u043e\u0442\u0430<\/h2>\n<p>\u041e\u0442\u043a\u0443\u0434\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0431\u043e\u0442\u044b \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0435? \u041e\u043f\u044b\u0442\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e \u043f\u0443\u043d\u043a\u0442, \u043d\u0443 \u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441 <a class=\"mention\" href=\"\/users\/botfather\">@BOTFATHER<\/a><\/p>\n<figure class=\"\"><\/figure>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u0442\u0446\u0430 \u0432\u0441\u0435\u0445 \u0431\u043e\u0442\u043e\u0432 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u0442\u0435\u043b\u0435\u0433\u0438 \u0438 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0431\u043e\u0442 \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442.<\/p>\n<figure class=\"float\"><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0440\u0442\u0430 \u044d\u0442\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434. <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \/newbot, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u043e\u0442\u0430.<\/p>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0435\u0437\u0430\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u0442\u044b\u0439: \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u043e\u0442\u0430 \u043f\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \/newbot, \u0434\u0430\u0435\u043c \u0435\u043c\u0443 \u0432\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0435 \u0438\u043c\u044f \u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u0435\u043c\u0443 username \u0441 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435\u043c bot. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c API \u0442\u043e\u043a\u0435\u043d \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0431\u0443\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u043f\u0435\u0440\u0435\u0439\u0434\u044f \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 URL:<\/p>\n<p>https:\/\/api.telegram.org\/bot<strong>2011183802:AAEW7ZNRVvlr1TG1N0DNkRB9G4FmvkBUUUU<\/strong>\/getMe<\/p>\n<p><em>\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0436\u0438\u0440\u043d\u044b\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430 \u0430\u043f\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u043e\u0442\u0430<\/em><\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 \u0432\u0435\u0440\u043d\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u044d\u0442\u043e:<\/p>\n<pre><code class=\"json\">{\"ok\":true,\"result\":{\"id\":2011183802,\"is_bot\":true,\"first_name\":\"Demo for Habr\",\"username\":\"DemoForHabr_bot\",\"can_join_groups\":true,\"can_read_all_group_messages\":false,\"supports_inline_queries\":false}}<\/code><\/pre>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0433\u0443\u0433\u043b-\u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0430\u043c \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u043a.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043f\u0443\u043d\u043a\u0442 \u043c\u0435\u043d\u044e \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b\/Tools -> \u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\/ Script editor.\u00a0<\/p>\n<p>\u0414\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0432\u043e\u0442 \u044d\u0442\u043e:<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u0417\u0430\u0442\u0440\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 JavaScript. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0433\u0443\u0433\u043b\u0430 (\u043a\u043b\u0430\u0441\u0441\u044b, \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0442.\u043f.), \u0447\u0442\u043e \u043c\u044b \u0434\u0430\u043b\u0435\u0435 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0423 \u043d\u0430\u0441 \u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0435 &#8212; API \u0431\u043e\u0442\u0430 \u0438 App_link.<\/p>\n<pre><code class=\"javascript\">const API = \"2011183802:AAEW7ZNRVvlr1TG1N0DNkRB9G4FmvkBUUUU\";  \/\/\u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0432\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0430\u043f\u0438 const App_link = \"\"; \/\/\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u0441\u0442\u044b\u043c<\/code><\/pre>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0410\u041f\u0418 \u0431\u043e\u0442\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432 \u0434\u0438\u0430\u043b\u043e\u0433\u0435 \u0441 botfather.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e send, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0447\u0430\u0442 \u0441 \u043d\u0430\u0448\u0438\u043c \u0431\u043e\u0442\u043e\u043c.<\/p>\n<pre><code class=\"javascript\">function send (msg, chat_id) {   let payload = {   'method': 'sendMessage',   'chat_id': String(chat_id),   'text': msg,   'parse_mode': 'HTML'   }   let data = {     'method': 'post',     'payload': payload   }     UrlFetchApp.fetch('https:\/\/api.telegram.org\/bot' + API + '\/', data); } <\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>send()<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u043e \u0441\u0442\u0440\u043e\u043d\u0438\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8212; \u0441 \u0442\u0435\u043b\u0435\u0433\u043e\u0439. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/developers.google.com\/apps-script\/reference\/url-fetch\/url-fetch-app\" rel=\"noopener noreferrer nofollow\">Class UrlFetchApp<\/a>.<\/p>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8212; \u0442\u0435\u043a\u0441\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0438\u0434 \u0447\u0430\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>send()<\/code>. \u041e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u043c \u044d\u0442\u043e \u0438\u0437 \u0442\u0435\u043b\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>doPost():<\/code><\/p>\n<pre><code class=\"javascript\">function doPost(e) {   let update = JSON.parse(e.postData.contents);   \/\/\u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f \"\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\"   if (update.hasOwnProperty('message')) {     let msg = update.message;     let chat_id = msg.chat.id;     let text = msg.text;     let user = msg.from.username;     if (text == \"\/hello\") {       send(\"Hello World\", chat_id)     }   } } <\/code><\/pre>\n<p>\u042d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0442 \u0431\u043e\u0442\u0430 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0447\u0430\u0442 \u0441 \u043d\u0438\u043c.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u043e\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c &#171;\/hello&#187; \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>send()<\/code>\u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438. \u042d\u0442\u043e \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u041a\u043b\u0438\u043a\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 Deploy -> New deployment.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e New deployment, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e \u0448\u0435\u0441\u0442\u0435\u0440\u0435\u043d\u043a\u0435 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c Web app.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u043f\u043e\u043b\u0435 Who has access \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Anyone, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0431\u0435\u0437 \u0432\u0430\u0448\u0435\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u0438\u044f.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Deploy.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d URL \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435. \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435 <em>Copy<\/em> \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 App_link, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0443\u0441\u0442\u044b\u043c.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u043e\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443:<\/p>\n<pre><code class=\"javascript\">function api_connector () {   UrlFetchApp.fetch(\"https:\/\/api.telegram.org\/bot\"+API+\"\/setWebHook?url=\"+App_link);  } <\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0431\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 API \u0438 App_link, \u0442\u0430\u043a \u0447\u0442\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>\u0421\u043d\u043e\u0432\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u0434 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e api_connector:<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0430\u0441\u044c \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a, \u0438\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0442\u0435\u043b\u0435\u0433\u0435.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &#171;\/hello&#187; \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043e, \u043d\u0430 \u0447\u0442\u043e \u043d\u0430\u0448 \u0431\u043e\u0442 \u043e\u0442\u0432\u0435\u0442\u0438\u043b &#171;Hello world&#187;.<\/p>\n<hr\/>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"javascript\">const API = \"2011183802:AAEW7ZNRVvlr1TG1N0DNkRB9G4FmvkBUUUU\"; \/\/\u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0432\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0430\u043f\u0438  const App_link = \"https:\/\/script.google.com\/macros\/s\/AKfycbyS0k0r1VF0T1O1y8b_oElTXWzWNJKUiQDXS2HWdZT9q-ODieKgLoNXGQTtRoi6a8fo\/exec\"; \/\/\u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u043f\u043b\u043e\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439   function send (msg, chat_id) {   let payload = {   'method': 'sendMessage',   'chat_id': String(chat_id),   'text': msg,   'parse_mode': 'HTML'   }   let data = {     \"method\": \"post\",     \"payload\": payload   }     UrlFetchApp.fetch('https:\/\/api.telegram.org\/bot' + API + '\/', data); }  function doPost(e) {   let update = JSON.parse(e.postData.contents);   \/\/\u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f \"\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\"   if (update.hasOwnProperty('message')) {     let msg = update.message;     let chat_id = msg.chat.id;     let text = msg.text;     let user = msg.from.username;     if (text == \"\/hello\") {       send(\"Hello World\", chat_id)     }   } }  function api_connector () {   UrlFetchApp.fetch(\"https:\/\/api.telegram.org\/bot\"+API+\"\/setWebHook?url=\"+App_link);  }  <\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0433\u0443\u0433\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043e\u043c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0435\u043c\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430, \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u044e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\/\u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/585456\/\"> https:\/\/habr.com\/ru\/articles\/585456\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-388782","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/388782","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=388782"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/388782\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=388782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=388782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=388782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}