{"id":391806,"date":"2024-06-29T10:02:27","date_gmt":"2024-06-29T10:02:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=391806"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T10:02:27","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=391806","title":{"rendered":"<span>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 Apps Script<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u043e\u0441\u0442 \u043f\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 \u0433\u0443\u0433\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0447\u0435\u0433\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u0413\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/45d\/1b4\/fc4\/45d1b4fc496078f0f1aef6db2e9a5024.png\" width=\"1268\" height=\"944\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/45d\/1b4\/fc4\/45d1b4fc496078f0f1aef6db2e9a5024.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043b\u044e\u0431\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f. \u042f \u043d\u0430\u043f\u0438\u0448\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0438\u0441\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u043e \u043a\u043b\u044e\u0447\u0443.<\/p>\n<pre><code class=\"javascript\">function getInd(key,sheet,col) {     let lr = sheet.getLastRow();   let chat_id_arr = sheet.getRange(1,col,lr).getValues();   chat_id_arr = chat_id_arr.flat();   let ind = chat_id_arr.indexOf(key);      return ind; } <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043b\u044e\u0447, \u043b\u0438\u0441\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0434\u043e \u0438\u0441\u043a\u0430\u0442\u044c, \u0438 \u043d\u043e\u043c\u0435\u0440 \u043a\u043e\u043b\u043e\u043d\u043a\u0438.<\/p>\n<p>\u041b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043d\u043e \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0435.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439:<\/p>\n<pre><code class=\"javascript\">\/**  * Returns an index of the key in the sheet's column  *   * @param  {number} key The key for searching  * @param  {SpreadsheetApp.Sheet} sheet The variable containing link to the sheet  * @param  {number} col The number of the column for searching  * @return {number} ind index of the key in the table if table includes a header or index of position in the array  *\/ <\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442. \u0414\u0430\u043b\u0435\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: \u0442\u0438\u043f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438, \u0437\u0430 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438 &#8212; \u0438\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0434\u0430\u043b\u0435\u0435 &#8212; \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0441\u043b\u0435\u0434\u0443\u044f \u0442\u043e\u0439 \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0435, \u0447\u0442\u043e \u0438 \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e:<\/p>\n<pre><code class=\"javascript\">\/**  * Returns an index of the key in the sheet's column  *   * @param  {number} key The key for searching  * @param  {SpreadsheetApp.Sheet} sheet The variable containing link to the sheet  * @param  {number} col The number of the column for searching  * @return {number} ind index of the key in the table if table includes a header or index of position in the array  *\/ function getInd(key,sheet,col) {     let lr = sheet.getLastRow();   let chat_id_arr = sheet.getRange(1,col,lr).getValues();   chat_id_arr = chat_id_arr.flat();   let ind = chat_id_arr.indexOf(key);      return ind; }<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u0434 \u0438 \u0434\u0435\u043f\u043b\u043e\u0438\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/93d\/3f2\/9cd\/93d3f29cdcac8bbd87b04784f07cdd70.png\" width=\"1919\" height=\"936\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/93d\/3f2\/9cd\/93d3f29cdcac8bbd87b04784f07cdd70.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e New deployment. \u0417\u0434\u0435\u0441\u044c \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u043d\u0430 \u0448\u0435\u0441\u0442\u0435\u0440\u0435\u043d\u043a\u0443 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Library<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b49\/1bd\/09d\/b491bd09dda2e0bff20c352f413193fb.png\" width=\"984\" height=\"784\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b49\/1bd\/09d\/b491bd09dda2e0bff20c352f413193fb.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Deploy<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5b0\/eef\/147\/5b0eef14757bf3f7069840899c80f156.png\" width=\"1002\" height=\"798\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5b0\/eef\/147\/5b0eef14757bf3f7069840899c80f156.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u0435\u043f\u043b\u043e\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0435\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b7f\/36d\/cfe\/b7f36dcfea561100b2163fcf1fcc7a6a.png\" width=\"1002\" height=\"788\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7f\/36d\/cfe\/b7f36dcfea561100b2163fcf1fcc7a6a.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e URL \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e id (\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u0432 \u0441\u0441\u044b\u043b\u043a\u0435)<\/p>\n<p><a href=\"https:\/\/script.google.com\/macros\/library\/d\/1M_paTo_LwVBlOddB-agAG015Sa-zP0a7k2IipmDrxOnERQPKNyxP9EBY\/1\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/script.google.com\/macros\/library\/d\/<\/u><strong><u>1M_paTo_LwVBlOddB-agAG015Sa-zP0a7k2IipmDrxOnERQPKNyxP9EBY<\/u><\/strong><u>\/1<\/u><\/a><\/p>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h2>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0445\u043e\u0442\u0438\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0412\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Libraries \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u043d\u0430 &#171;+&#187;<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/549\/555\/448\/54955544874eebed44f3758131d373e9.png\" width=\"1486\" height=\"409\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/549\/555\/448\/54955544874eebed44f3758131d373e9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0422\u041e\u041b\u042c\u041a\u041e id \u0438\u0437 URL \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Look up.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a90\/211\/566\/a90211566d8f182d8d06fd4ef44ea982.png\" width=\"832\" height=\"705\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a90\/211\/566\/a90211566d8f182d8d06fd4ef44ea982.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0432\u0438\u0434\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u0434\u0432\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/148\/a6d\/878\/148a6d878c3dd3b310872b8994749f8d.png\" width=\"728\" height=\"692\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/148\/a6d\/878\/148a6d878c3dd3b310872b8994749f8d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043a \u043d\u0435\u0439 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3b8\/8ba\/3a1\/3b88ba3a19eebafcb35d0358f35a2720.png\" width=\"678\" height=\"641\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3b8\/8ba\/3a1\/3b88ba3a19eebafcb35d0358f35a2720.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0443. \u0421\u043b\u0435\u0432\u0430 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Libraries \u0432\u0438\u0434\u0438\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041a\u043e\u0433\u0434\u0430 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0432 \u043a\u043e\u0434\u0435, \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u0443 \u043d\u0430\u0441 \u043e\u043d\u0430 \u043f\u043e\u043a\u0430 \u043e\u0434\u043d\u0430)<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/834\/2e6\/87f\/8342e687ff1ff30bab44066c69d26fe6.png\" width=\"1214\" height=\"432\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/834\/2e6\/87f\/8342e687ff1ff30bab44066c69d26fe6.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u043c \u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/79f\/016\/adc\/79f016adce4779b5ddc60389907d3c8c.png\" width=\"1296\" height=\"471\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/79f\/016\/adc\/79f016adce4779b5ddc60389907d3c8c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432 \u044d\u0442\u0443 \u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a \u043d\u0438\u043c.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0434\u043b\u044f \u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u043e\u0441\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \ud83d\ude42 \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0436\u0434\u0443 \u0444\u0438\u0434\u0431\u0435\u043a\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/586744\/\"> https:\/\/habr.com\/ru\/articles\/586744\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u043e\u0441\u0442 \u043f\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 \u0433\u0443\u0433\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0447\u0435\u0433\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u0413\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043b\u044e\u0431\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f. \u042f \u043d\u0430\u043f\u0438\u0448\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0438\u0441\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u043e \u043a\u043b\u044e\u0447\u0443.<\/p>\n<pre><code class=\"javascript\">function getInd(key,sheet,col) {     let lr = sheet.getLastRow();   let chat_id_arr = sheet.getRange(1,col,lr).getValues();   chat_id_arr = chat_id_arr.flat();   let ind = chat_id_arr.indexOf(key);      return ind; } <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043b\u044e\u0447, \u043b\u0438\u0441\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0434\u043e \u0438\u0441\u043a\u0430\u0442\u044c, \u0438 \u043d\u043e\u043c\u0435\u0440 \u043a\u043e\u043b\u043e\u043d\u043a\u0438.<\/p>\n<p>\u041b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043d\u043e \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0435.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439:<\/p>\n<pre><code class=\"javascript\">\/**  * Returns an index of the key in the sheet's column  *   * @param  {number} key The key for searching  * @param  {SpreadsheetApp.Sheet} sheet The variable containing link to the sheet  * @param  {number} col The number of the column for searching  * @return {number} ind index of the key in the table if table includes a header or index of position in the array  *\/ <\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442. \u0414\u0430\u043b\u0435\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: \u0442\u0438\u043f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438, \u0437\u0430 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438 &#8212; \u0438\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0434\u0430\u043b\u0435\u0435 &#8212; \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0441\u043b\u0435\u0434\u0443\u044f \u0442\u043e\u0439 \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0435, \u0447\u0442\u043e \u0438 \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e:<\/p>\n<pre><code class=\"javascript\">\/**  * Returns an index of the key in the sheet's column  *   * @param  {number} key The key for searching  * @param  {SpreadsheetApp.Sheet} sheet The variable containing link to the sheet  * @param  {number} col The number of the column for searching  * @return {number} ind index of the key in the table if table includes a header or index of position in the array  *\/ function getInd(key,sheet,col) {     let lr = sheet.getLastRow();   let chat_id_arr = sheet.getRange(1,col,lr).getValues();   chat_id_arr = chat_id_arr.flat();   let ind = chat_id_arr.indexOf(key);      return ind; }<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u0434 \u0438 \u0434\u0435\u043f\u043b\u043e\u0438\u043c.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e New deployment. \u0417\u0434\u0435\u0441\u044c \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u043d\u0430 \u0448\u0435\u0441\u0442\u0435\u0440\u0435\u043d\u043a\u0443 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Library<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Deploy<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u0435\u043f\u043b\u043e\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0435\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e URL \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e id (\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u0432 \u0441\u0441\u044b\u043b\u043a\u0435)<\/p>\n<p><a href=\"https:\/\/script.google.com\/macros\/library\/d\/1M_paTo_LwVBlOddB-agAG015Sa-zP0a7k2IipmDrxOnERQPKNyxP9EBY\/1\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/script.google.com\/macros\/library\/d\/<\/u><strong><u>1M_paTo_LwVBlOddB-agAG015Sa-zP0a7k2IipmDrxOnERQPKNyxP9EBY<\/u><\/strong><u>\/1<\/u><\/a><\/p>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h2>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0445\u043e\u0442\u0438\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0412\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Libraries \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u043d\u0430 &#171;+&#187;<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0422\u041e\u041b\u042c\u041a\u041e id \u0438\u0437 URL \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Look up.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0432\u0438\u0434\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u0434\u0432\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u044f.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043a \u043d\u0435\u0439 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0443. \u0421\u043b\u0435\u0432\u0430 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Libraries \u0432\u0438\u0434\u0438\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041a\u043e\u0433\u0434\u0430 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0432 \u043a\u043e\u0434\u0435, \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u0443 \u043d\u0430\u0441 \u043e\u043d\u0430 \u043f\u043e\u043a\u0430 \u043e\u0434\u043d\u0430)<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u043c \u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432 \u044d\u0442\u0443 \u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a \u043d\u0438\u043c.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0434\u043b\u044f \u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u043e\u0441\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \ud83d\ude42 \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0436\u0434\u0443 \u0444\u0438\u0434\u0431\u0435\u043a\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/586744\/\"> https:\/\/habr.com\/ru\/articles\/586744\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-391806","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/391806","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=391806"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/391806\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=391806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=391806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=391806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}