{"id":291964,"date":"2019-07-11T15:01:20","date_gmt":"2019-07-11T15:01:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=291964"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=291964","title":{"rendered":"Telegram \u2014 \u0431\u043e\u0442 | \u041f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 \u043c\u0435\u043d\u044e"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c6c\/b90\/8bf\/c6cb908bf54852219fe0026aa89e8409.jpg\" alt=\"image\"><\/div>\n<p>   \u0420\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e, \u0432 \u0436\u0438\u0437\u043d\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c-\u0431\u043e\u0442\u043e\u0432 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0447\u0451\u0442\u043a\u043e\u0435 \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435, \u0442\u043e\u0433\u043e \u0447\u0442\u043e <s>\u0432\u0441\u0451 \u0431\u0440\u0435\u043d\u043d\u043e<\/s> \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u043d\u044e \u0434\u043b\u044f \u0431\u043e\u0442\u043e\u0432. <\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a:<\/p>\n<p>  \u0410) \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e<br \/>  \u0411) \u0423\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438*<\/p>\n<blockquote><p>\u041d\u0438\u043a\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u043b &#171;\/\u043a\u043e\u043c\u0430\u043d\u0434\u044b&#187;, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435<\/p><\/blockquote>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0421\u0443\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>  \u0421 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u0434\u0430 \u2014 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u043e\u0441\u0442\u0430, \u043d\u043e \u043a\u0430\u043a \u0431\u044b \u043d\u0435 \u0442\u0430\u043a. \u0412\u0441\u044f <i>\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/i> \u0432 \u0441\u0430\u043c\u043e\u043c <a href=\"https:\/\/core.telegram.org\/bots\/api#update\">API, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 Update<\/a>.  <\/p>\n<blockquote><p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 getUpdate \u2014 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 Update, \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0436\u0435! \u0422\u0430\u043a \u0432\u043e\u0442, \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c. \u0412 \u044d\u0442\u043e\u043c \u0438 \u0437\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u0430<\/p><\/blockquote>\n<p> \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0432\u044b\u0448\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u0432\u0435\u0431\u0445\u0443\u043a\u0443, \u0431\u0435\u0437 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043c \u043d\u0435 \u0441\u0432\u0435\u0442\u0438\u0442\u2026<\/p>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435, \u0443\u043c\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u0438 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<h3><s>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/s> \u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 <\/h3>\n<p>  \u0412 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434 \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043b\u0430\u0441\u0441.<\/p>\n<p>  NEW! \u0422\u0435\u043f\u0435\u0440\u044c \u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/s0d3s\/tg-long-req\">\u0433\u0438\u0442\u0445\u0430\u0431<\/a>)<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435 \u0442\u0435\u0440\u043f\u0438\u0442\u0441\u044f, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u044d\u043a\u0441\u043a\u0443\u0440\u0441.<\/p>\n<h4>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c<\/h4>\n<p><a name=\"RequestForInquiry\"><\/a><br \/>  \u041a\u043b\u0430\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 <abbr title=\"\u041f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0448\u0435\u043d\u0438\u044f, \u0437\u0430 \u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u0443. \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\">\u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441<\/abbr>  <\/p>\n<blockquote><p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435: \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043f\u043e \u043c\u0435\u043d\u044e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <a href=\"#RequestForInquiry\">\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/a>. \u0412\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u0435\u0433\u043e \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0438 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 <abbr title=\"\u041d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u0441 \u043b\u0443\u0437\u0435\u0440\u043e\u043c!\">\u044e\u0437\u0435\u0440\u0430<\/abbr>, \u0431\u0430\u0446, \u0438 \u043e\u043d \u0432 \u00ab\u043c\u0435\u043d\u044e\u00bb.<\/p><\/blockquote>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u0435\u043d, \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f, \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0439 \u043d\u0435 \u0441\u0442\u0430\u043b\u0430\u2026 \u041f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0440\u0430\u0437\u044a\u044f\u0441\u043d\u0438\u0442\u044c. \u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043d\u0435\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0447\u0442\u043e \u0432\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0431\u043e\u0442\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u043d\u044e, \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u044e\u0437\u0435\u0440(\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u044e \u0441 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430). \u041f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0431\u043e\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u00ab\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0435\u043d\u044e\u00bb, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0439\u0442\u0438, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432 \u043c\u0435\u043d\u044e \u00ab\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u00bb, \u00ab\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f\u00bb, \u0438 \u0442\u0434.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/8ac\/c6b\/9e8\/8acc6b9e878f93bba2862a004a007507.gif\" alt=\"image\"><\/p>\n<p>  \u0418 \u0442\u0430\u043a, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0431\u043e\u0442\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435:<\/p>\n<p>  \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<p>  \u0414\u0410 ) \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u00ab\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u00bb \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<br \/>  \u041d\u0415\u0422) \u041e\u0441\u0442\u0430\u0451\u043c\u0441\u044f \u0432 \u00ab\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0435\u043d\u044e\u00bb, \u0441\u0432\u0435\u0440\u044f\u0435\u043c \u043e\u0442\u0432\u0435\u0442 \u044e\u0437\u0435\u0440\u0430 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438.<\/p>\n<p>  *\u044d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u0431\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u043e\u043b\u043a\u0443. \u0421 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0440\u043e\u0449\u0435.<\/p>\n<h4>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c..?<\/h4>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <a href=\"https:\/\/getcomposer.org\/\">compser<\/a>-\u043e\u043c(\u0441\u043e\u0437\u0434\u0430\u0451\u043c \u00abcomposer.json\u00bb, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0438\u0436\u0435, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0432 \u043e\u0444\u0444. \u0434\u043e\u043a\u0430\u0445)<\/p>\n<pre><code class=\"json\">{   \"require\" : {   \t\"s0d3s\/tg-long-req\": \"&gt;=1\"      } }<\/code><\/pre>\n<p>  \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c<\/p>\n<pre><code class=\"php\">include_once('path\/to\/autoload.php'); use TgLongReq\\TgLongReq;<\/code><\/pre>\n<p>  <b>\u0418\u041b\u0418<\/b> \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e(\u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c)<\/p>\n<pre><code class=\"php\">include_once('TgLongReq.php'); use TgLongReq\\TgLongReq;<\/code><\/pre>\n<p>  <b>\u0421\u041e\u0417\u0414\u0410\u0401\u041c \u041e\u0411\u042a\u0415\u041a\u0422<\/b><\/p>\n<pre><code class=\"php\"> function SOMTH($tg_res, $long_req_obj, $tab_key){ \techo \"EveryForEveryone\"; \treturn; }  $BOT_FUNC_ASSO_TAB = arrray(\"ECHO_SOMETHING\" =&gt; \"SOMTH\"); \/\/\u041a\u043b\u044e\u0447 - \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 - \u0438\u043c\u044f \u0444-\u0446\u0438\u0438\\\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432  $tgreq = new TgLongReq\t(\t \t\t\t\t\t$usr_id,\t\t\t\t\/\/(STR)\u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c-id \u044e\u0437\u0435\u0440\u0430 \t\t\t\t\t$BOT_FUNC_ASSO_TAB,\t\/\/(ARRAY) \t\t\t\t\t$BOT_req_dir , \t\t\t\/\/[OPT](STR) \t\t\t\t\t$tapi,  \t\t\t\t\/\/[OPT](ANY*)  \t\t\t\t\t$result\t\t\t\t\/\/[OPT](ANY**) \t\t\t\t\t); \/\/ * \u0434\u043e\u043f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 $this-&gt;tg_api \/\/ ** \u0434\u043e\u043f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 <\/code><\/pre>\n<p>  <b>\u0421\u041e\u0417\u0414\u0410\u0401\u041c \u0417\u0410\u041f\u0420\u041e\u0421, \u041f\u0420\u041e\u0412\u0415\u0420\u042f\u0415\u041c \u0415\u0413\u041e \u041d\u0410\u041b\u0418\u0427\u0418\u0415 \u0418 \u0417\u0410\u041f\u0423\u0421\u041a\u0410\u0415\u041c \u041e\u0411\u0420\u0410\u0411\u041e\u0422\u041a\u0423<\/b><\/p>\n<pre><code class=\"php\"> \t$tgreq -&gt; ReqCreate('SOMTH');\/\/\u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \tif($tgreq -&gt; ReqCheck()){ \t\t\/\/\u0435\u0441\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \t\t$tgreq -&gt; ReqHand();\/\/\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \t} <\/code><\/pre>\n<p>  <b>\u041f\u0420\u042f\u0427\u0415\u041c \u0418 \u0414\u041e\u0421\u0422\u0410\u0401\u041c \u0412\u0420\u0415\u041c\u0415\u041d\u041d\u042b\u0415 \u0414\u0410\u041d\u041d\u042b\u0415<\/b><\/p>\n<p>  \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c:<\/p>\n<pre><code class=\"php\"> $tgreq -&gt; SaveToTemp('HiHabr');\/\/\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 json-\u0441\u0442\u0440\u043e\u043a\u0438 <\/code><\/pre>\n<p>  \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c:<\/p>\n<pre><code class=\"php\"> $tgreq -&gt; GetFromTemp(false);\/\/\u0435\u0441\u043b\u0438 \u0438\u0441\u0442\u0438\u043d\u0430 - \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043b\u043e\u0436\u044c \/\/\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u0443\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SaveToTemp() <\/code><\/pre>\n<p>  <b>\u0420\u0415\u0417\u0423\u041b\u042c\u0422\u0410\u0422 \u0424\u0423\u041d\u041a\u0426\u0418\u0418<\/b><\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f[\u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c GetFromTemp(),GetError(),ReqCheck() \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430] \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<pre><code class=\"php\"> \t\/*$function_result = array(\t \t\t'func_res'\t\t=&gt;\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\t \t\t'error'\t\t=&gt;true, \u0435\u0441\u043b\u0438 \u0431\u044b\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \t\t'err_discript'\t=&gt;\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0441\u043b\u0438 \u0431\u044b\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \t\t);\t \t*\/ <\/code><\/pre>\n<p>  <b>\u041e\u0428\u0418\u0411\u041a\u0418<\/b><\/p>\n<p>  \u041a\u0430\u0436\u0434\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f [\u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c GetFromTemp(),GetError(),ReqCheck() \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430], \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e:<\/p>\n<pre><code class=\"php\"> \t$error_arr = $tgreq -&gt; GetError(); \t\/*$error_arr = array( \t\t'error'\t\t=&gt;true, \u0435\u0441\u043b\u0438 \u0431\u044b\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \t\t'err_discript'\t=&gt;\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0441\u043b\u0438 \u0431\u044b\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \t\t);\t \t*\/ <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0412\u0441\u0451 \u0441\u043e\u0431\u0440\u0430\u043b\u0438, \u0432 \u043f\u0443\u0442\u044c!<\/h3>\n<p>  \u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0442\u043e \u0432\u044b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c-\u0431\u043e\u0442\u043e\u0432, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u2014 %<a href=\"https:\/\/habr.com\/ru\/post\/347482\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a>%, \u0434\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0434\u043e \u043f\u0443\u043d\u043a\u0442\u0430 &#171;<u>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0431\u043e\u0442\u0430<\/u>&#187; \u2014 \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u0432 \u0433\u0443\u0433\u043b\u0435 \u043f\u043e \u0441\u0430\u0431\u0436\u0443, \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0441\u0430\u043c\u0438, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0443\u0437\u043d\u0430\u0439\u0442\u0435 \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u0432 \u0441\u0430\u043c\u043e\u043c \u0442\u0433, \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u0430\u043f\u0438\u0448\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0435\u0431\u0445\u0443\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c(~NEW! \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0431\u0445\u043e\u0434\u0430 \u00ab\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b\u00bb \u0441 https).<\/p>\n<p>  \u0412\u043e\u043f\u043b\u043e\u0442\u0438\u043c \u0432 \u0436\u0438\u0437\u043d\u044c, \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0430 \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u00abbotmain.php\u00bb(\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430) \u0438 \u00abvarfunc.php\u00bb(\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432). \u0414\u043b\u044f \u043b\u0451\u0433\u043a\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/irazasyed\/telegram-bot-sdk\">telegram-bot-sdk<\/a>(\u0445\u043e\u0440\u043e\u0448\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0439 \u0438 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044e;). <\/p>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c, <i>\u043b\u0438\u0441\u0442\u0438\u043d\u0433<\/i>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">composer.json<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"json\"> {   \"require\" : {   \t\"irazasyed\/telegram-bot-sdk\": \"&gt;=3\", \t\"s0d3s\/tg-long-req\": \"&gt;=1\", \t\"php\":\"&gt;=7.1\"       } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u2026<\/p>\n<pre><code class=\"bash\">&gt;composer install ... <\/code><\/pre>\n<p>  <b>UPD<\/b>: \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0425\u0430\u0431\u0440\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c, \u0431\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u0430\u0432\u043a\u0438. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431.<\/p>\n<p>  <a href=\"https:\/\/github.com\/s0d3s\/tg-long-req\/tree\/master\/exmp\/def_menu\">\u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b<\/a> | <a href=\"https:\/\/github.com\/s0d3s\/tg-long-req\/tree\/master\/exmp\/def_sample\">\u0423\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f<\/a>.<\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041f\u043e\u0434 \u043a\u043e\u043d\u0435\u0446 \u043c\u043e\u0433\u0443 \u043b\u0438\u0448\u044c \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u041c\u0415\u041d\u042f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u0432\u043e\u0440\u0438\u0442\u043e\u043c.<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/459604\/\"> https:\/\/habr.com\/ru\/post\/459604\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c6c\/b90\/8bf\/c6cb908bf54852219fe0026aa89e8409.jpg\" alt=\"image\"><\/div>\n<p>   \u0420\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e, \u0432 \u0436\u0438\u0437\u043d\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c-\u0431\u043e\u0442\u043e\u0432 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0447\u0451\u0442\u043a\u043e\u0435 \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435, \u0442\u043e\u0433\u043e \u0447\u0442\u043e <s>\u0432\u0441\u0451 \u0431\u0440\u0435\u043d\u043d\u043e<\/s> \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u043d\u044e \u0434\u043b\u044f \u0431\u043e\u0442\u043e\u0432. <\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a:<\/p>\n<p>  \u0410) \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e<br \/>  \u0411) \u0423\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438*<\/p>\n<blockquote><p>\u041d\u0438\u043a\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u043b &#171;\/\u043a\u043e\u043c\u0430\u043d\u0434\u044b&#187;, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435<\/p><\/blockquote>\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-291964","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291964","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=291964"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291964\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}