{"id":305170,"date":"2020-06-10T21:00:28","date_gmt":"2020-06-10T21:00:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305170"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305170","title":{"rendered":"ICQ New: \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0440\u0430\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0431\u043e\u0442\u043e\u0432"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/506206\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hz\/yl\/ac\/hzylac6lisykfejesv6dmsxquok.jpeg\"><\/p>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u0437\u0430\u0445\u043e\u0434\u044f \u0432 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u043d\u0430\u043c \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0431\u043e\u0442\u044b \u0432 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f\u0445. \u041e\u0434\u043d\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u043e \u043f\u043e\u0433\u043e\u0434\u0443, \u0434\u0440\u0443\u0433\u0438\u0435 \u0440\u0430\u0437\u044b\u0433\u0440\u044b\u0432\u0430\u044e\u0442 \u0431\u0443\u0440\u0433\u0435\u0440\u044b, \u0430 \u0442\u0440\u0435\u0442\u044c\u0438 \u0442\u0430\u043a \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043a\u0438\u0434\u0430\u044e\u0442 \u043c\u0435\u043c\u044b \u043f\u043e\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435. \u041d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u0438\u0437 \u0432\u0430\u0441 \u043f\u0440\u043e\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u043b\u0430 \u043c\u044b\u0441\u043b\u044c: \u00ab\u0410 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0438 \u043c\u043d\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u043e\u0442\u0430?\u00bb. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0447\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u0442\u0430\u043a\u0438\u0435 \u043c\u044b\u0441\u043b\u0438 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e \u043d\u0435\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u0442\u0430. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043a\u0440\u0443\u0442\u044b\u043c \u0430\u0439\u0442\u0438\u0448\u043d\u0438\u043a\u043e\u043c \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439? \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0435\u0442. \u0418 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u2014 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u043e\u043b\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u0430, \u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430 \u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u0432 ICQ \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0431\u043e\u0442\u043e\u0432. \u041e\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 \u0431\u043e\u043b\u0435\u0435 \u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u043d\u043e\u0439, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0439. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u043e\u0442\u0430.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c<\/h2>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432 ICQ. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430, \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0432 \u0432\u0435\u0431-\u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0437\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435:<\/p>\n<ol>\n<li>\u041d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/habr.com\/ru\/users\/metabot\/\" class=\"user_link\">metabot<\/a> \u0432 ICQ.<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u043c\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>\/newbot<\/code>.<\/li>\n<li>\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u044f \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u043e\u0442\u0430 (\u0434\u043e\u043b\u0436\u043d\u043e \u043e\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 <i>bot<\/i>).<\/li>\n<\/ol>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e metabot \u043f\u0440\u0438\u0448\u043b\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430:<\/p>\n<ul>\n<li><code>botId<\/code>: \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0431\u043e\u0442\u0430;<\/li>\n<li><code>nick<\/code>: \u0438\u043c\u044f \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430;<\/li>\n<li><code>token<\/code>: \u0442\u043e\u043a\u0435\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443.<\/li>\n<\/ul>\n<p>  \u0412\u0441\u0451, \u0431\u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u043d. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0431\u043e\u0442 \u0431\u044b\u043b \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0438 \u0447\u0442\u043e-\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u043b.<\/p>\n<p>  \u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u0438\u0446\u0435<a href=\"https:\/\/icq.com\/botapi\/#\/\"> https:\/\/icq.com\/botapi\/#\/<\/a> \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 API. \u041e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435. <\/p>\n<p>  \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u2014 <code>\/events\/get<\/code>. \u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0431\u043e\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0431\u043e\u0442\u0443, \u0442\u043e \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 <code>\/events\/get<\/code>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0431\u043e\u0442\u0443 \u043a\u0430\u043a\u043e\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443<a href=\"https:\/\/api.icq.net\/bot\/v1\/events\/get?token=&amp;pollTime=1&amp;lastEventId=0\"> https:\/\/api.icq.net\/bot\/v1\/events\/get?token=\u0412\u0430\u0448 \u0442\u043e\u043a\u0435\u043d&amp;pollTime=1&amp;lastEventId=0<\/a>. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>pollTime<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0443\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u0432\u0435\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 60, \u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 60 \u0441\u0435\u043a\u0443\u043d\u0434 \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043b\u044f \u0431\u043e\u0442\u0430, \u0430 \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0435\u0440\u043d\u0435\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. <code>lastEventId<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0435, \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0441\u0435\u0447\u0435\u043d\u044b.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435: <\/p>\n<pre><code class=\"json\">{  &quot;events&quot;: [   {     &quot;eventId&quot;: 41,      &quot;payload&quot;: {          &quot;chat&quot;: {            &quot;chatId&quot;: &quot;745294945&quot;,             &quot;type&quot;: &quot;private&quot;          },          &quot;from&quot;: {                 &quot;firstName&quot;: &quot;Andrey&quot;,                 &quot;lastName&quot;: &quot;Shvedov&quot;,                 &quot;nick&quot;: &quot;shvedoff&quot;,                 &quot;userId&quot;: &quot;745294945&quot;          },          &quot;msgId&quot;: &quot;6831171945581511151&quot;,          &quot;text&quot;: &quot;\u0430&quot;,          &quot;timestamp&quot;: 1590506161      },      &quot;type&quot;: &quot;newMessage&quot;   }  ],  &quot;ok&quot;: true }<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>\/messages\/sendText<\/code>.<\/p>\n<p>  \u0418\u0437\u0443\u0447\u0430\u0442\u044c \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0430\u044f Python-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442, \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u044f\u0441\u044c \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u043e\u0442\u0430. <\/p>\n<h2>\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434?<\/h2>\n<p>  \u0414\u0430, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 (\u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u041e\u0421 \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/www.python.org\/downloads\/\">https:\/\/www.python.org\/downloads\/<\/a> \u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 pip \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/pip.pypa.io\/en\/stable\/installing\/\">https:\/\/pip.pypa.io\/en\/stable\/installing\/<\/a> ) \u0422\u0430\u043a\u0436\u0435, \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043e\u0442\u0430\u043c\u0438:<\/p>\n<pre><code class=\"bash\">$ pip3 install --upgrade mailru-im-bot <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c.<\/p>\n<h2>\u041f\u0438\u0448\u0435\u043c!<\/h2>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0437\u043d\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a: \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043f\u0438\u0448\u0435\u0442 \u0431\u043e\u0442\u0443 \u043a\u0430\u043a\u043e\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0442\u043e\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0433\u043b\u0430\u0448\u0430\u0435\u0442\u0441\u044f, \u0431\u043e\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438 4 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043d\u0430 \u0432\u044b\u0431\u043e\u0440. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c, \u0431\u043e\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0431\u043e\u0442 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u043f\u043e\u043c\u0438\u043c\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <code>Bot<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"python\">import logging from bot.bot import Bot   logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',                     datefmt='%Y.%m.%d %I:%M:%S %p', level=logging.DEBUG)  TOKEN = &quot;&quot; #your token here  def main():     bot = Bot(token=TOKEN)     bot.start_polling()   if __name__ == '__main__':     main()<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0435. \u0422\u0430\u043a\u0436\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f ICQ-\u0431\u043e\u0442\u043e\u0432, \u0437\u0430\u0434\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>token<\/code>, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <code>Bot<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (<code>bot.start_polling()<\/code>).<\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0448 \u0431\u043e\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043d\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u043c \u0431\u043e\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b:<\/p>\n<pre><code class=\"python\">import json from bot.handler import MessageHandler <\/code><\/pre>\n<p>  <code>json<\/code> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0435\u0439 \u0437\u0430 \u043a\u043d\u043e\u043f\u043a\u0438. <code>MessageHandler<\/code> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u043e\u0432\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. <\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430:<\/p>\n<pre><code class=\"python\">def startup(bot, event):     default_markup = [         [{&quot;text&quot;: &quot;\u041d\u0430\u0447\u0430\u0442\u044c!&quot;, &quot;callbackData&quot;: &quot;start&quot;}]         ]      first_message_text = &quot;\u041f\u0440\u0438\u0432\u0435\u0442! \u042f - \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0431\u043e\u0442. \u041d\u0430\u0447\u043d\u0435\u043c?&quot;     bot.send_text(chat_id=event.from_chat,          text=first_message_text,          inline_keyboard_markup=json.dumps(default_markup))<\/code><\/pre>\n<p>  \u041e\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. <code>default_markup<\/code> \u2014 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043a\u043d\u043e\u043f\u043e\u043a (\u043e\u0431\u044a\u0435\u043a\u0442 \u00ab\u0441\u043f\u0438\u0441\u043e\u043a\u00bb, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u043a\u043d\u043e\u043f\u043e\u043a. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430 <i>\u041d\u0430\u0447\u0430\u0442\u044c!<\/i>). <code>first_message_text<\/code>\u2014 \u0441\u0442\u0440\u043e\u043a\u0430, \u0442\u0435\u043a\u0441\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u041c\u0435\u0442\u043e\u0434 <code>send_text<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442:<\/p>\n<ul>\n<li><code>chat_id<\/code> (\u043f\u043e\u043b\u0435 \u0438\u0437 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f) \u2014 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0447\u0430\u0442\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, <\/li>\n<li>\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, <\/li>\n<li>\u0438 <code>inline_keyboard_markup<\/code> \u2014 \u043d\u0430\u0448\u0438 \u043a\u043d\u043e\u043f\u043a\u0438. <\/li>\n<\/ul>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"python\">bot.dispatcher.add_handler(MessageHandler(callback=startup)) <\/code><\/pre>\n<p>  \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>startup()<\/code> \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u042d\u0442\u043e\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>main()<\/code>. \u0423 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0431\u043e\u0442\u043e\u043c \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">import logging import json from bot.bot import Bot from bot.handler import MessageHandler  logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',                     datefmt='%Y.%m.%d %I:%M:%S %p', level=logging.DEBUG)  TOKEN = \u00ab\u00bb #your token here  def startup(bot, event):     default_markup = [         [{\u00abtext\u00bb: \u00ab\u041d\u0430\u0447\u0430\u0442\u044c!\u00bb, \u00abcallbackData\u00bb: \u00abstart\u00bb}]         ]     first_message_text = \u00ab\u041f\u0440\u0438\u0432\u0435\u0442! \u042f \u2014 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0431\u043e\u0442. \u041d\u0430\u0447\u043d\u0435\u043c?\u00bb     bot.send_text(chat_id=event.from_chat,         text=first_message_text,         inline_keyboard_markup=json.dumps(default_markup))  def main():     bot = Bot(token=TOKEN)     bot.dispatcher.add_handler(MessageHandler(callback=startup))     bot.start_polling()  if __name__ == '__main__':     main() <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6a4\/a51\/4b4\/6a4a514b4e5629c69a6cb9a1f187de4b.png\"><\/div>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043a\u043d\u043e\u043f\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u043b\u0438 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438:<\/p>\n<pre><code class=\"python\">[ [{\u00abtext\u00bb: \u00ab\u041d\u0430\u0447\u0430\u0442\u044c!\u00bb, \u00abcallbackData\u00bb: \u00abstart\u00bb}]]<\/code><\/pre>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0435, \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 <code>callbackData<\/code>. \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441\u0435\u0440\u0432\u0435\u0440 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443. \u0412 \u043d\u0451\u043c \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043a\u0430\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043d\u0430\u0436\u0430\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438. \u0422\u043e \u0435\u0441\u0442\u044c, \u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0443\u0434\u0438\u0442\u044c, \u043a\u0430\u043a\u0443\u044e \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043d\u043e\u043f\u043a\u0443 \u043d\u0430\u0436\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0431\u043e\u0442\u0430 \u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<pre><code class=\"python\">from bot.handler import BotButtonCommandHandler from bot.filter import Filter <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443, \u0432\u0442\u043e\u0440\u0430\u044f \u2014 \u0444\u0438\u043b\u044c\u0442\u0440, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043d\u043e\u043f\u043a\u0430 \u043d\u0430\u0436\u0430\u0442\u0430. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code class=\"python\">def start(bot, event):     question = ''     operands = [&quot;+&quot;, &quot;-&quot;, &quot;*&quot;]     operations_count = randrange(3)+2     for i in range(operations_count):         question += str(randrange(9))         question += choice(operands)     question = question[:-1]     answer = eval(question)     buttons = [         [{'text': str(answer), 'callbackData': &quot;right&quot;},          {'text': str(answer+1), 'callbackData': &quot;wrong&quot;}],         [{'text': str(answer-1), 'callbackData': &quot;wrong&quot;},          {'text': str(answer+2), 'callbackData': &quot;wrong&quot;}]]     shuffle(buttons[0])     shuffle(buttons[1])     shuffle(buttons)     bot.answer_callback_query(         query_id=event.data['queryId'],         text='\u041d\u043e\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441')     bot.send_text(chat_id=event.data['message']['chat']['chatId'],         text=question,         inline_keyboard_markup=json.dumps(buttons)) <\/code><\/pre>\n<p>  \u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b. \u0417\u0430\u0442\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043d\u043e\u043f\u043e\u043a \u0441 \u043e\u0442\u0432\u0435\u0442\u0430\u043c\u0438. \u041e\u0434\u0438\u043d \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443 \u0443 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 <code>callbackData<\/code>. \u0412 \u043a\u043e\u043d\u0446\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>answer_callback_query<\/code> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<ul>\n<li><code>query_id<\/code> \u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443,<\/li>\n<li>\u0438 <code>text<\/code> \u2014 \u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0432\u043e \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0435 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443. <\/li>\n<\/ul>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0447\u0442\u043e \u0431\u043e\u0442 \u043f\u0440\u0438\u043d\u044f\u043b \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443. \u0418\u043d\u0430\u0447\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0435 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0415\u0449\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>send_text<\/code> \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0430\u043c\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u043a\u043d\u043e\u043f\u043a\u0430\u043c\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. <\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">def right(bot, event):     bot.send_text(chat_id=event.data['message']['chat']['chatId'],         text='\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e!')     start(bot, event)   def wrong(bot, event):     bot.send_text(chat_id=event.data['message']['chat']['chatId'],         text='\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:(')     start(bot, event) <\/code><\/pre>\n<p>  \u042d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442\u044b. \u0418 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043d\u043e\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441. <\/p>\n<p>  \u0412\u0441\u0451, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code class=\"python\">    bot.dispatcher.add_handler(BotButtonCommandHandler(         callback=start, filters=Filter.callback_data(\u00abstart\u00bb)))     bot.dispatcher.add_handler(BotButtonCommandHandler(         callback=wrong, filters=Filter.callback_data(\u00abwrong\u00bb)))     bot.dispatcher.add_handler(BotButtonCommandHandler(         callback=right, filters=Filter.callback_data(\u00abright\u00bb))) <\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u0442\u0440\u0435\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e <code>callbackData<\/code> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>filters=Filter.callback_data(\u00abstart\u00bb)<\/code>) \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430. <\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">import logging import json from bot.bot import Bot from bot.handler import BotButtonCommandHandler from bot.handler import MessageHandler from bot.filter import Filter from random import randrange, choice, random, shuffle  logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',         datefmt='%Y.%m.%d %I:%M:%S %p', level=logging.DEBUG)  TOKEN = &quot;&quot; #your token here   def startup(bot, event):     default_markup = [         [{&quot;text&quot;: &quot;\u041d\u0430\u0447\u0430\u0442\u044c!&quot;, &quot;callbackData&quot;: &quot;start&quot;}]         ]      first_message_text = &quot;\u041f\u0440\u0438\u0432\u0435\u0442! \u042f - \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0431\u043e\u0442. \u041d\u0430\u0447\u043d\u0435\u043c?&quot;     bot.send_text(chat_id=event.from_chat,         text=first_message_text,         inline_keyboard_markup=json.dumps(default_markup))   def start(bot, event):     question = ''     operands = [&quot;+&quot;, &quot;-&quot;, &quot;*&quot;]     operations_count = randrange(3)+2     for i in range(operations_count):         question += str(randrange(9))         question += choice(operands)     question = question[:-1]     answer = eval(question)     buttons = [         [{'text': str(answer), 'callbackData': &quot;right&quot;},          {'text': str(answer+1), 'callbackData': &quot;wrong&quot;}],         [{'text': str(answer-1), 'callbackData': &quot;wrong&quot;},          {'text': str(answer+2), 'callbackData': &quot;wrong&quot;}]]     shuffle(buttons[0])     shuffle(buttons[1])     shuffle(buttons)     bot.answer_callback_query(         query_id=event.data['queryId'],         text='\u041d\u043e\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441')     bot.send_text(chat_id=event.data['message']['chat']['chatId'],         text=question,         inline_keyboard_markup=json.dumps(buttons))   def right(bot, event):     bot.send_text(chat_id=event.data['message']['chat']['chatId'],         text='\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e!')     start(bot, event)   def wrong(bot, event):     bot.send_text(chat_id=event.data['message']['chat']['chatId'],         text='\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:(')     start(bot, event)   def main():     bot = Bot(token=TOKEN)     bot.dispatcher.add_handler(MessageHandler(callback=startup))     bot.dispatcher.add_handler(BotButtonCommandHandler(         callback=start, filters=Filter.callback_data(&quot;start&quot;)))     bot.dispatcher.add_handler(BotButtonCommandHandler(         callback=wrong, filters=Filter.callback_data(&quot;wrong&quot;)))     bot.dispatcher.add_handler(BotButtonCommandHandler(         callback=right, filters=Filter.callback_data(&quot;right&quot;)))     bot.start_polling()   if __name__ == '__main__':     main()<\/code><\/pre>\n<p>  \u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0432 \u043d\u0435\u043c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0439 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0441\u0432\u043e\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \ud83d\ude42<\/p>\n<h2>\u0413\u0434\u0435 \u0438 \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c?<\/h2>\n<p>  \u0411\u043e\u0442\u0430 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u0430\u043c\u0438, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434. \u0420\u0430\u0437 \u0443\u0436 \u043c\u044b Mail.ru, \u0442\u043e \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Mail.ru Cloud Solutions. \u0422\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u043e\u0439 \u043a\u0430\u0440\u0442\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0435\u0439. <\/p>\n<ol>\n<li>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0430 <a href=\"https:\/\/mcs.mail.ru\/\">https:\/\/mcs.mail.ru\/<\/a>.<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b. \u0412\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0438\u0445 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. <\/li>\n<li>\u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c.<\/li>\n<li>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0441\u0432\u043e\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443: <code>ssh -i .\/xxx.pem user@ip<\/code>\n<p>  \u0433\u0434\u0435 <code>.\/xxx.pem<\/code> \u2014 \u043f\u0443\u0442\u044c \u0434\u043e \u0441\u043a\u0430\u0447\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043f\u0430\u043a\u0435\u0442\u044b:\n<pre><code class=\"bash\">$ sudo curl https:\/\/raw.githubusercontent.com\/dvershinin\/apt-get-centos\/master\/apt-get.sh -o \/usr\/local\/bin\/apt-get $ chmod 0755 \/usr\/local\/bin\/apt-get $ sudo apt-get install python3 $ curl https:\/\/bootstrap.pypa.io\/get-pip.py -o get-pip.py $ python3 get-pip.py $ pip3 install --upgrade mailru-im-bot<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 Python \u0438 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430. <\/li>\n<li>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e. \u0418\u0437 \u043f\u0430\u043f\u043a\u0438 \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c: <code>scp -i .\/xxx.pem .\/path\/to_bot.py user@ip:~<\/code>\n<ul>\n<li><code>.\/xxx.pem<\/code> \u2014 \u043f\u0443\u0442\u044c \u0434\u043e \u043a\u043b\u044e\u0447\u0430;<\/li>\n<li><code>.\/path\/to_bot.py<\/code> \u2014 \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 \u0431\u043e\u0442\u043e\u043c;<\/li>\n<li><code>user@ip:~<\/code> \u2014 \u043b\u043e\u0433\u0438\u043d, \u0430\u0434\u0440\u0435\u0441 \u0438 \u043f\u0443\u0442\u044c, \u043a\u0443\u0434\u0430 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u0442\u0430.<\/li>\n<\/ul>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b \u0441 \u0431\u043e\u0442\u043e\u043c \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435. <\/li>\n<li>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c: <code>python3 ~\/file_name.py<\/code>, \u0433\u0434\u0435 <code>file_name.py<\/code> \u2014 \u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 \u0431\u043e\u0442\u043e\u043c.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0431\u043e\u0442, \u043b\u0435\u0436\u0430\u0449\u0438\u0439 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u043b\u0438\u0447\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u043e\u0442\u043e\u0432 \u0434\u043b\u044f \u0430\u0441\u044c\u043a\u0438, \u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e API \u0431\u043e\u0442\u043e\u0432 \u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430. \u0410 \u0435\u0449\u0435 \u0432 ICQ \u0435\u0441\u0442\u044c \u0447\u0430\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0431\u043e\u0442\u0430\u043c: <a href=\"https:\/\/icq.im\/botapi_faq\">https:\/\/icq.im\/botapi_faq<\/a>.<\/p>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <a href=\"https:\/\/icq.com\/botapi\/#\/\">https:\/\/icq.com\/botapi\/#\/<\/a> \u2014 ICQ bot API.<\/p>\n<p>  <a href=\"https:\/\/github.com\/mail-ru-im\/bot-python\">https:\/\/github.com\/mail-ru-im\/bot-python<\/a> \u2014 Python-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f ICQ-\u0431\u043e\u0442\u043e\u0432.<\/p>\n<p>  <a href=\"https:\/\/icq.im\/metabot\">https:\/\/icq.im\/metabot<\/a> \u2014 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0438 \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u0442\u0430.<\/p>\n<p>  <a href=\"https:\/\/github.com\/shvedoff\/Icq_buttons\">https:\/\/github.com\/shvedoff\/Icq_buttons<\/a> \u2014 \u0431\u043e\u0442, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043a\u043d\u043e\u043f\u043a\u0430\u043c\u0438.<\/p>\n<p>  <a href=\"https:\/\/icq.im\/AoLE1J5Ecm5DIjZh1gg\">https:\/\/icq.im\/AoLE1J5Ecm5DIjZh1gg<\/a> \u2014 \u0447\u0430\u0442 \u0434\u043b\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u0431\u043e\u0442\u0430\u043c.<\/div>\n<p> \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\/company\/mailru\/blog\/506206\/\"> https:\/\/habr.com\/ru\/company\/mailru\/blog\/506206\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/506206\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hz\/yl\/ac\/hzylac6lisykfejesv6dmsxquok.jpeg\"><\/p>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u0437\u0430\u0445\u043e\u0434\u044f \u0432 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u043d\u0430\u043c \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0431\u043e\u0442\u044b \u0432 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f\u0445. \u041e\u0434\u043d\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u043e \u043f\u043e\u0433\u043e\u0434\u0443, \u0434\u0440\u0443\u0433\u0438\u0435 \u0440\u0430\u0437\u044b\u0433\u0440\u044b\u0432\u0430\u044e\u0442 \u0431\u0443\u0440\u0433\u0435\u0440\u044b, \u0430 \u0442\u0440\u0435\u0442\u044c\u0438 \u0442\u0430\u043a \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043a\u0438\u0434\u0430\u044e\u0442 \u043c\u0435\u043c\u044b \u043f\u043e\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435. \u041d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u0438\u0437 \u0432\u0430\u0441 \u043f\u0440\u043e\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u043b\u0430 \u043c\u044b\u0441\u043b\u044c: \u00ab\u0410 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0438 \u043c\u043d\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u043e\u0442\u0430?\u00bb. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0447\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u0442\u0430\u043a\u0438\u0435 \u043c\u044b\u0441\u043b\u0438 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e \u043d\u0435\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u0442\u0430. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043a\u0440\u0443\u0442\u044b\u043c \u0430\u0439\u0442\u0438\u0448\u043d\u0438\u043a\u043e\u043c \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439? \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0435\u0442. \u0418 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u2014 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u043e\u043b\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u0430, \u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430 \u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u0432 ICQ \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0431\u043e\u0442\u043e\u0432. \u041e\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 \u0431\u043e\u043b\u0435\u0435 \u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u043d\u043e\u0439, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0439. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u043e\u0442\u0430.  <\/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-305170","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305170","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=305170"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305170\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}