{"id":373284,"date":"2024-05-21T05:32:40","date_gmt":"2024-05-21T05:32:40","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=373284"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=373284","title":{"rendered":"<span>\u041f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442 \u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0431\u043e\u0442\u044b \u0441\u0442\u0430\u043b\u0438 \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043d\u0430\u0448\u0435\u0439 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438. \u041e\u043d\u0438 \u0441\u0442\u0430\u043b\u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u043c\u0438 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430\u043c\u0438 \u0432 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u2013 \u043e\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0441\u043e\u043a\u043e\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c.<\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0431\u043e\u0442\u0430. \u041c\u0435\u043d\u044f \u0442\u043e\u0436\u0435 \u043a\u043e\u0441\u043d\u0443\u043b\u0441\u044f \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442. \u041d\u0430\u0447\u0430\u0432 \u0438\u0441\u043a\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c: \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043d\u0435\u0442, \u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<p>\u041d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e! \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441 \u0432\u0430\u043c\u0438 \u0432\u0441\u0435\u043c\u0438 \u044d\u0442\u0430\u043f\u0430\u043c\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0431\u043e\u0442\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c C#.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u043e\u0442 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430. \u0418\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c long-polling \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u043c\u0435\u0441\u0442\u043e webhooks. \u0411\u043e\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 <a href=\"http:\/\/asp.net\" rel=\"noopener noreferrer nofollow\">asp.net<\/a>. \u041d\u0443\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0440\u0438\u043a \u0438\u043b\u0438 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0411\u043e\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0439\u0434\u0435\u043c \u043f\u043e \u043f\u0443\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p><span class=\"habrahidden\">\u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u043e\u0442\u043e\u0432 \u043d\u0430 c# \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0438 \u0431\u043b\u0430\u0433\u043e\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/span><\/p>\n<p>\u041a\u0430\u043a \u043e\u043f\u043e\u0440\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/TelegramBots\/Telegram.Bot\" rel=\"noopener noreferrer nofollow\">Telegram.Bot<\/a>, \u043a\u0430\u043a \u0441\u0430\u043c\u0443 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0443\u044e \u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 API \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u043e\u0432. \u0417\u0430\u0439\u0434\u0435\u043c \u043d\u0430 github \u0438 \u043f\u043e\u0438\u0449\u0435\u043c \u043a\u0442\u043e \u0438 \u043a\u0430\u043a \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442.<\/p>\n<p>\u0421\u044e\u0440\u043f\u0440\u0438\u0437, \u043d\u043e c# \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u043e\u0432. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043d\u0430\u0448\u0435\u043b, \u044d\u0442\u043e \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u0438\u0433\u0440\u0430 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0430 <a href=\"https:\/\/www.tgwerewolf.com\/\" rel=\"noopener noreferrer nofollow\">tgwerewolf<\/a> <a href=\"https:\/\/github.com\/GreyWolfDev\/Werewolf\" rel=\"noopener noreferrer nofollow\">github<\/a>, \u043d\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0449\u0430\u044f\u0441\u044f. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0447\u0438\u0441\u0442\u044b\u0439 Telegram.Bot, \u0447\u0442\u043e-\u0442\u043e \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438, \u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0442\u044f\u0436\u0435\u043b\u043e.<\/p>\n<p>C \u0444\u0440\u0435\u0439\u043c\u043e\u0440\u043a\u0430\u043c\u0438 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u0447\u0443\u0442\u044c \u043b\u0443\u0447\u0448\u0435. \u042f \u043d\u0430\u0448\u0435\u043b \u0430\u0436 2 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<br \/> \u041d\u0430\u0447\u043d\u0435\u043c \u0441 <a href=\"https:\/\/github.com\/MajMcCloud\/TelegramBotFramework\" rel=\"noopener noreferrer nofollow\">TelegramBotFramework<\/a> \u2014 \u043d\u0430\u0447\u0430\u043b\u0438 \u0437\u0430 \u0437\u0434\u0440\u0430\u0432\u0438\u0435, \u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u0437\u0430 \u0443\u043f\u043e\u043a\u043e\u0439.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0432\u044f\u043b\u043e\u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0445\u043e\u0442\u044c \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0441\u044f \u0431\u043e\u0434\u0440\u043e: \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c. \u0418\u0437 \u043f\u043b\u044e\u0441\u043e\u0432, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f\u043c \u0438 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u0441 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0438 \u0432\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u0441\u043c\u0438\u0440\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0437\u0430\u0439\u0442\u0438. \u0414\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0430\u0431\u043e\u0440 &#171;ui&#187; \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0447\u0442\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u043e.<\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0435\u0441\u0442\u044c, \u043d\u043e \u043e\u043d\u043e \u043a\u043e\u0441\u0442\u044b\u043b\u044c\u043d\u043e\u0435 \u0438 \u043b\u0443\u0447\u0448\u0435 \u0434\u0430\u0436\u0435 \u043f\u0430\u043b\u043a\u043e\u0439 \u043d\u0435 \u0442\u044b\u043a\u0430\u0442\u044c, \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e.<\/p>\n<p>\u041d\u0443 \u0438 \u0438\u0437 \u043c\u0438\u043d\u0443\u0441\u043e\u0432: \u0442\u044f\u0436\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0443 <a href=\"http:\/\/asp.net\" rel=\"noopener noreferrer nofollow\">asp.net<\/a>; \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439; \u0442\u044f\u0436\u0435\u043b\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u0435\u0431\u044f. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440, \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>\u0418 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u0441\u0430\u043c\u043e\u0435 \u0432\u043a\u0443\u0441\u043d\u043e\u0435 \u2014 <a href=\"https:\/\/github.com\/TgBotFramework\/TgBotFramework\" rel=\"noopener noreferrer nofollow\">TgBotFramework<\/a> \u2014 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0442 \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0435\u0440\u0430 Telegram.Bot. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d, \u0434\u0440\u0443\u0436\u0438\u0442 \u0441 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430. \u041d\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0437\u043a\u0430, \u0431\u0435\u0440\u0435\u043c \u0438 \u0438\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430.<\/p>\n<p>\u0423\u0432\u044b, \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u0443\u0436\u0435 \u0431\u044b\u043b \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442, \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0431\u0435\u0440\u0435\u0442, \u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 \u043c\u0435\u0434\u0438\u0430\u0442\u043e\u0440\u0435, \u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0438\u043a\u043b \u0436\u0438\u0437\u043d\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0442 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430, \u043c\u043e\u0436\u0435\u0442 \u043a\u0430\u043a-\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0432\u043e\u0435\u0433\u043e Processor, \u043d\u043e \u044f \u043d\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b.<\/p>\n<p>\u041e\u0431\u0438\u0434\u043d\u043e, \u0447\u0442\u043e c# \u0438 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 .NET \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u044f\u0437\u044b\u043a\u0438 \u2014 <a href=\"https:\/\/github.com\/python-telegram-bot\/python-telegram-bot\" rel=\"noopener noreferrer nofollow\">python-telegram-bot<\/a> \u0438 <a href=\"https:\/\/github.com\/LonamiWebs\/Telethon\" rel=\"noopener noreferrer nofollow\">Telethon<\/a>,  go \u2014 <a href=\"https:\/\/github.com\/go-telegram-bot-api\/telegram-bot-api\" rel=\"noopener noreferrer nofollow\">telegram-bot-api<\/a> \u0438 \u0441\u0430\u043c\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 rust\u2014 <a href=\"https:\/\/github.com\/teloxide\/teloxide\" rel=\"noopener noreferrer nofollow\">teloxide<\/a><\/p>\n<p>\u0425\u043e\u0442\u044f \u043c\u043e\u0436\u0435\u0442 \u044f \u043f\u043b\u043e\u0445\u043e \u0438\u0441\u043a\u0430\u043b. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434, \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430 \u043d\u0430 c#.<\/p>\n<p>\u041d\u0443, \u0440\u0430\u0437 \u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u0442\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a \u0432\u044b\u0431\u043e\u0440\u0443, \u0442\u043e \u043d\u0435 \u043e\u0442\u0447\u0430\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u2014 \u0440\u0443\u043a\u0438 \u0432 \u043d\u043e\u0433\u0438 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0437 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u0441\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442 \u043c\u0435\u0434\u0438\u0430\u0442\u043e\u0440. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0438\u0445 \u043a\u0430\u043a scoped.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u043e\u043d\u043e\u0432\u0443\u044e \u0441\u043b\u0443\u0436\u0431\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0442 \u0431\u043e\u0442\u0430:<\/p>\n<pre><code class=\"cs\">public class PollingServiceBase : BackgroundService {     private readonly ITelegramBotClient botClient;     private readonly IUpdateHandler handler;      private readonly ReceiverOptions receiverOptions = new()     {         AllowedUpdates = [UpdateType.Message, UpdateType.CallbackQuery],         ThrowPendingUpdates = true,     };      public PollingServiceBase(ITelegramBotClient botClient, IUpdateHandler handler, IOptions&lt;AcadeMarketConfiguration> options, ILogger&lt;PollingServiceBase> logger)     {         this.botClient = botClient;         this.handler = handler;     }      protected override async Task ExecuteAsync(CancellationToken stoppingToken)     {         while (!stoppingToken.IsCancellationRequested)         {         try         {         await botClient.ReceiveAsync(updateHandler: handler, receiverOptions: receiverOptions, cancellationToken: stoppingToken);         }         catch         {         }         }     } <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u041a\u0440\u0443\u0442\u0438\u043c \u0432 \u0444\u043e\u043d\u0435 \u0432 \u0446\u0438\u043a\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0412 ReceiveAsync, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u0432 DefaultUpdateReceiver, \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043d\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 while \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0437\u0436\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435, \u043a\u0430\u043a \u0438 \u0441\u0430\u043c\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a. \u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u043a UpdateHandler.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0443\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u044f \u043c\u0430\u0433\u0438\u044f!<\/p>\n<pre><code class=\"cs\">public class UpdateHandler(IServiceProvider serviceProvider) : IUpdateHandler, IDisposable {     internal readonly Dictionary&lt;long, (string command, IServiceScope scope)> UsersCommand = [];      public UpdateHandler(         Dictionary&lt;long, (string command, IServiceScope scope)> dictionary,         IServiceProvider serviceProvider) :          this(serviceProvider)     {         UsersCommand = dictionary;     }      public async Task HandleUpdateAsync(ITelegramBotClient botClient, Update update, CancellationToken cancellationToken)     {         await using var scope = serviceProvider.CreateAsyncScope();         var publisher = scope.ServiceProvider.GetRequiredService&lt;IPublisher>();          var chat = update.GetChat();         ArgumentNullException.ThrowIfNull(chat);          var getCommand = new GetBotCommandNotification { Update = update };         await publisher.Publish(getCommand, cancellationToken);          var tuple = ChooseCommand(chat.Id, getCommand.Command);         if (!tuple.HasValue) return;          var provider = tuple.Value.scope;         var command = tuple.Value.command;          var scopeMediator = provider.ServiceProvider.GetRequiredKeyedService&lt;IMediator>(nameof(CustomTelegramMediator));         IBotCommandContext updateReceived = new BotCommandContext(update, chat, command);          try         {             await scopeMediator.Publish(updateReceived, cancellationToken);                         ArgumentException.ThrowIfNullOrWhiteSpace(updateReceived.Command);         }         catch (Exception e)         {             var asyncServiceScope = new AsyncServiceScope(provider);             await asyncServiceScope.DisposeAsync();              UsersCommand.Remove(chat.Id);              throw;         }          if (updateReceived.NeedRefresh)         {             provider.Dispose();             UsersCommand.Remove(chat.Id);         }     }      private (IServiceScope scope, string command)? ChooseCommand(long chatId, string botCommand)     {         var exist = UsersCommand.TryGetValue(chatId, out var tuple);          IServiceScope provider;         var command = botCommand;          if (string.IsNullOrWhiteSpace(command) &amp;&amp; !exist) return null;         if (!string.IsNullOrWhiteSpace(command) &amp;&amp; !exist)         {             provider = serviceProvider.CreateScope();             UsersCommand.Add(chatId, (command, provider));         }         else if (string.IsNullOrWhiteSpace(command) &amp;&amp; exist)         {             provider = tuple.scope;             command = tuple.command;         }         else         {             if (tuple.command != command)             {                 tuple.scope.Dispose();                  provider = serviceProvider.CreateScope();                 UsersCommand[chatId] = (command, provider);             }             else             {                 provider = tuple.scope;                 command = tuple.command;             }         }          return (provider, command);     } } <\/code><\/pre>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0435\u0442: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0437\u0430\u0432\u043e\u0434\u0438\u043c scope \u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0435\u0441\u0442\u044c \u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043c\u0435\u043d\u044f\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u0443; \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u0435\u0440\u043d\u0443\u043b\u0430 <code>NeedRefresh<\/code> \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043c\u0443\u0442\u0438\u0442\u044c \u2014  <code>var scopeMediator = provider.ServiceProvider.GetRequiredKeyedService&lt;IMediator>(nameof(CustomTelegramMediator))<\/code>, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 <code>GetBotCommandNotification<\/code>, \u043d\u0435 \u0437\u043d\u0430\u044e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0447\u0442\u043e notification \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u0435\u0433\u043e \u0432 <code>GetBotCommandNotification<\/code>. \u0421\u0430\u043c <code>GetBotCommandHandler<\/code> \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439:<\/p>\n<pre><code class=\"cs\">public abstract class GetBotCommandHandler : INotificationHandler&lt;GetBotCommandNotification> {     public abstract UpdateType Type { get; }      public ValueTask Handle(GetBotCommandNotification command, CancellationToken cancellationToken)     {         if (command.Update.Type != Type) return ValueTask.CompletedTask;         if (!CanHandle(command)) return ValueTask.CompletedTask;          SetCommand(command);         return ValueTask.CompletedTask;     }      protected internal abstract bool CanHandle(GetBotCommandNotification notification);      protected internal abstract void SetCommand(GetBotCommandNotification notification); } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u043c\u0430\u043d\u0434. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439: \u043c\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u0437 Telegram. \u0417\u0430\u0442\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f\u043c. \u0415\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435 \u0438\u043c\u0435\u0435\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f \u0434\u043b\u044f \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439, \u0430 \u0435\u0449\u0435 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c IPipelineBehavior <a href=\"https:\/\/github.com\/jbogard\/MediatR\/issues\/353\" rel=\"noopener noreferrer nofollow\">\u043a \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u043c<\/a>.<\/p>\n<p>\u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. \u0412 Mediatr \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u0435\u0434\u0438\u0430\u0442\u043e\u0440\u0430 \u0438 <a href=\"https:\/\/github.com\/jbogard\/MediatR\/pull\/431\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u043c \u043f\u0440\u0438 \u0438\u0445 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438<\/a>. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c  \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u043e \u043a\u043b\u044e\u0447\u0443 (<a href=\"https:\/\/learn.microsoft.com\/en-us\/aspnet\/core\/fundamentals\/dependency-injection?view=aspnetcore-8.0#keyed-services\" rel=\"noopener noreferrer nofollow\">AddKeyed \u0438 \u0435\u0433\u043e \u0434\u0440\u0443\u0437\u044c\u044f<\/a>), \u043a\u0430\u043a \u0432\u0441\u0435 \u0443\u0434\u0430\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c. \u041f\u043e-\u044d\u0442\u043e\u043c\u0443 \u0438\u0434\u0435\u043c \u0438 \u043f\u0438\u0448\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0434\u0438\u0430\u0442\u0440 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"cs\">public class CustomTelegramMediator : MediatR.Mediator {     private readonly IServiceProvider serviceProvider;      public CustomTelegramMediator(IServiceProvider serviceProvider) : base(serviceProvider)     {         this.serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));     }      public CustomTelegramMediator(IServiceProvider serviceProvider, INotificationPublisher publisher) : base(serviceProvider, publisher)     {         this.serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));     }      protected override async Task PublishCore(IEnumerable&lt;NotificationHandlerExecutor> handlerExecutors, INotification notification, CancellationToken cancellationToken)     {         if (notification is not IBotCommandContext botCommandContext) return;          var handler = handlerExecutors.Single(handlerExecutor =>             handlerExecutor.HandlerInstance is TelegramCommandHandler commandHandler &amp;&amp;             commandHandler.Command.Equals(botCommandContext.Command));          var wrapperType = typeof(NotificationHandlerWrapperImpl&lt;>).MakeGenericType(notification.GetType());         var wrapper = Activator.CreateInstance(wrapperType, [handler.HandlerCallback]) ?? throw new InvalidOperationException($\"Could not create wrapper type for {notification.GetType()}\");         var handlerBase = (NotificationHandlerBase)wrapper;          await handlerBase.Handle(notification, serviceProvider, cancellationToken);     } }<\/code><\/pre>\n<p>\u0418 \u0434\u0430, \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435, \u043e\u0441\u0442\u0430\u043b\u0441\u044f <code>NotificationHandlerWrapperImpl<\/code> \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0435\u0435 \u0432 <code>IPipelineBehavior<\/code><\/p>\n<pre><code class=\"cs\">public class NotificationHandlerWrapperImpl&lt;TRequest>(Func&lt;TRequest, CancellationToken, Task> handlerCallback) : NotificationHandlerBase     where TRequest : INotification {     public Task Handle(TRequest request, IServiceProvider serviceProvider, CancellationToken cancellationToken)     {         return serviceProvider             .GetServices&lt;IPipelineBehavior&lt;TRequest, Unit>>()             .Reverse()             .Aggregate((RequestHandlerDelegate&lt;Unit>)Handler,                 (next, pipeline) => () => pipeline.Handle(request, next, cancellationToken))();          async Task&lt;Unit> Handler()         {             await handlerCallback(request, cancellationToken);             return Unit.Value;         }     }      public override Task         Handle(object request, IServiceProvider serviceProvider, CancellationToken cancellationToken) =>         Handle((TRequest)request, serviceProvider, cancellationToken); }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0434\u043b\u044f \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u044b \u0438\u0437 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430<\/p>\n<pre><code class=\"cs\">public interface IBotCommandContext : INotification {     public Update Update { get; }      public Chat Chat { get; }      public string Command { get; }      public Message? Message { get; }      public IReadOnlyCollection&lt;string>? Args { get; }      public bool NeedRefresh { get;  }      public void AddMessage(Message? message);      public void AddArgs(IEnumerable&lt;string> args);      public void SetNeedRefresh(); }<\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d <code>IPipelineBehavior<\/code> \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u044b, \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c <code>where TRequest : IBotCommandContext<\/code>. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u043e\u0442\u043e\u043c.<\/p>\n<pre><code class=\"cs\">public class AddUserBehaviour&lt;TRequest, TResponse>(IDistributedCache cache) : IPipelineBehavior&lt;TRequest, TResponse>     where TRequest : IBotCommandContext {     public async Task&lt;TResponse> Handle(TRequest request, RequestHandlerDelegate&lt;TResponse> next, CancellationToken cancellationToken)     {         var value = await cache.GetStringAsync(request.Chat.Id.ToString(), cancellationToken);         if (!string.IsNullOrWhiteSpace(value)) return await next();          await cache.SetAsync(request.Chat.Id.ToString(), Encoding.ASCII.GetBytes(request.Chat.Id.ToString()), cancellationToken);          return await next();     } }<\/code><\/pre>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 <code>IPipelineBehavior<\/code>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 <code>IBotCommandContext<\/code> \u043c\u0430\u0440\u043a\u0435\u0440. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 <code>RequestPerformanceBehaviour<\/code> \u0441 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u043c <code>IRequestPerformance<\/code><\/p>\n<pre><code class=\"cs\">public class RequestPerformanceBehaviour&lt;TRequest, TResponse>(     TimeProvider timeProvider,     ILogger&lt;RequestPerformanceBehaviour&lt;TRequest, TResponse>> logger)     : IPipelineBehavior&lt;TRequest, TResponse>     where TRequest : IRequestPerformance {     private readonly ILogger&lt;RequestPerformanceBehaviour&lt;TRequest, TResponse>> logger = logger ?? throw new ArgumentNullException(nameof(logger));     private readonly TimeProvider timeProvider = timeProvider ?? throw new ArgumentNullException(nameof(timeProvider));      public async Task&lt;TResponse> Handle(TRequest request, RequestHandlerDelegate&lt;TResponse> next, CancellationToken cancellationToken)     {         var start = timeProvider.GetTimestamp();          var response = await next();          var diff = timeProvider.GetElapsedTime(start);          if (diff.TotalMilliseconds &lt; 500) return response;          var name = typeof(TRequest).Name;          logger.LongRunningRequest(name, diff, request);          return response;     } }  internal static partial class LoggerExtensions {     [LoggerMessage(EventId = 1, EventName = nameof(LongRunningRequest), Level = LogLevel.Warning, Message = \"Long Running Request: {Name} ({Elapsed} milliseconds) {Request}\")]     public static partial void LongRunningRequest(this ILogger logger, string name, TimeSpan elapsed, object request); }  public interface IRequestPerformance;<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <code>IRequestPerformance<\/code> \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>IBotCommandContext<\/code> \u0438 \u0432\u0441\u0435.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043c\u043c\u0430\u043d\u0434, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043e\u0431\u0449\u0438\u0439 <code>TelegramCommandHandler<\/code><\/p>\n<pre><code class=\"cs\">public abstract class TelegramCommandHandler : INotificationHandler&lt;IBotCommandContext> {     public abstract string Description { get; }      public abstract string Command { get; }      public virtual int Calls { get; protected set; }      public virtual async Task Handle(IBotCommandContext notification, CancellationToken cancellationToken)     {         if (string.IsNullOrWhiteSpace(notification.Command)) return;         if (string.IsNullOrWhiteSpace(Command)) return;         if (!string.Equals(notification.Command, Command)) return;          Calls++;          await Core(notification, cancellationToken).ConfigureAwait(false);          if (await IsLastStage())         {             notification.SetNeedRefresh();         }     }      protected abstract Task Core(IBotCommandContext notification, CancellationToken cancellationToken);      public virtual Task&lt;bool> IsLastStage() => new(true); }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0435\u043f\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u043a\u0430 \u0433\u043e\u0440\u044f\u0447\u043e.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"cs\">public class TestCommandHandler : TelegramCommandHandler {     public override string Description { get; }     public override string Command => \"\/hi\";      private readonly ITelegramBotClient botClient;      public TestCommandHandler(ITelegramBotClient botClient)     {         this.botClient = botClient;     }      protected override async Task Core(IBotCommandContext notification, CancellationToken cancellationToken)     {         await botClient.SendTextMessageAsync(notification.Chat, \"Hi\", cancellationToken: cancellationToken);     } }<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u044d\u0442\u0430\u043f\u0430\u043c\u0438, \u044d\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442:<\/p>\n<pre><code class=\"cs\">public class SignupCommandHandler(IMediator mediator, ITelegramBotClient botClient) : TelegramCommandHandler {     public const string CommandValue = \"\/signup\";     public const string DescriptionValue = \"\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f\";      public override string Description => DescriptionValue;     public override string Command => CommandValue;      private readonly IMediator mediator = mediator ?? throw new ArgumentNullException(nameof(mediator));     private readonly ITelegramBotClient botClient = botClient ?? throw new ArgumentNullException(nameof(botClient));      private string Firstname;     private string Surname;     private string Age;      protected override Task Core(IBotCommandContext notification, CancellationToken cancellationToken)     {         ArgumentException.ThrowIfNullOrWhiteSpace(notification.Message?.Text);          switch (Calls)         {             case 2:                 Firstname = notification.Message.Text;                 break;             case 3:                 Surname = notification.Message.Text;                 break;             case 4:                 Age = notification.Message.Text;                 break;         }          return Calls switch         {             1 => EnterFirstname(notification, cancellationToken),             2 => EnterSurname(notification, cancellationToken),             3 => EnterAge(notification, cancellationToken),             4 => AddNewUser(notification, cancellationToken),             _ => Task.CompletedTask,         };     }      private async Task EnterFirstname(IBotCommandContext notification, CancellationToken cancellationToken)     {         const string text = \"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0412\u0430\u0448\u0435 \u0438\u043c\u044f\";         await botClient.SendTextMessageAsync(chatId: notification.Chat, text: text, cancellationToken: cancellationToken);     }      private async Task EnterSurname(IBotCommandContext notification, CancellationToken cancellationToken)     {         const string text = \"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0412\u0430\u0448\u0443 \u0444\u0430\u043c\u0438\u043b\u0438\u044e\";         await botClient.SendTextMessageAsync(chatId: notification.Chat, text: text, cancellationToken: cancellationToken);     }      private async Task EnterAge(IBotCommandContext notification, CancellationToken cancellationToken)     {         const string text = \"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0412\u0430\u0448 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\";         await botClient.SendTextMessageAsync(chatId: notification.Chat, text: text, cancellationToken: cancellationToken);     }      private async Task AddNewUser(IBotCommandContext notification, CancellationToken cancellationToken)     {         var text = \"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e.\";         await botClient.SendTextMessageAsync(chatId: notification.Chat, text: text, cancellationToken: cancellationToken);          text = $\"\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c! {Firstname} {Surname}\";         await botClient.SendTextMessageAsync(chatId: notification.Chat, text: text, cancellationToken: cancellationToken);     }      public override ValueTask&lt;bool> IsLastStage()     {         return ValueTask.FromResult(Calls >= 4);     } }<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b\u043e, \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u0441 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u044f \u0438 \u0445\u043e\u0442\u0435\u043b\u043a\u0438 \u0431\u0438\u0437\u043d\u0435\u0441\u0430. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043a\u0440\u0443\u0442\u0438\u0442\u044c <code>TransactionBehavior<\/code> \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0438\u0437 <code>TelegramCommandHandler<\/code>, \u0442\u0430\u043a \u043c\u044b \u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u0422\u0430\u043a \u0436\u0435 \u0441 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041d\u0443, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0412\u0430\u0448\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430 \u043c\u0435\u0434\u0438\u0430\u0442\u043e\u0440\u0435, \u0445\u0435\u0445.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a. \u0415\u0434\u0438\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043f\u043e\u0438\u043c\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>PollingServiceBase<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u043d\u0443\u0442\u0440\u0438 <code>ReceiveAsync<\/code> \u0443 \u0441\u0435\u0431\u044f \u043f\u0440\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 <code>HandlePollingErrorAsync<\/code> \u0443 <code>IUpdateHandler<\/code>. \u0422\u0430\u043a \u043a\u0430\u043a <code>IUpdateHandler<\/code> \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0443 \u043a\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430, \u0438 \u0435\u043c\u0443 \u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e \u043d\u0435\u0439.<\/p>\n<p>\u0418\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043a\u043e\u043c\u043c\u0430\u043d\u0434 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0432 <code>IPipelineBehavior<\/code> \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u0432\u0435\u0434\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0442\u0430\u043a \u0443\u043c\u0435\u0435\u043c.<\/p>\n<p>\u0410 \u0435\u0449\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043b\u0435\u0433\u043a\u043e \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435! \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0442 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 id \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438\u0445, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0431\u0440\u0430\u043b \u0434\u0440\u0443\u0433\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443.<\/p>\n<p>\u0418\u043b\u0438 \u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u0440\u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445. \u041d\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0443\u0435\u0442\u0441\u044f \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0442\u0438\u0441\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c\u0443 \u043c\u0435\u0434\u0438\u0430\u0442\u043e\u0440\u0443.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u043c\u043e\u0435\u043c <a href=\"https:\/\/github.com\/Kataane\/QuickGram\/tree\/main\" rel=\"noopener noreferrer nofollow\">github<\/a>. \u0415\u0441\u043b\u0438 \u0443 \u0412\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u2014 \u0441\u043c\u0435\u043b\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0435, \u0440\u0430\u0434 \u0431\u0443\u0434\u0443 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/806827\/\"> https:\/\/habr.com\/ru\/articles\/806827\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0431\u043e\u0442\u044b \u0441\u0442\u0430\u043b\u0438 \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043d\u0430\u0448\u0435\u0439 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438. \u041e\u043d\u0438 \u0441\u0442\u0430\u043b\u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u043c\u0438 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430\u043c\u0438 \u0432 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u2013 \u043e\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0441\u043e\u043a\u043e\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c.<\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0431\u043e\u0442\u0430. \u041c\u0435\u043d\u044f \u0442\u043e\u0436\u0435 \u043a\u043e\u0441\u043d\u0443\u043b\u0441\u044f \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442. \u041d\u0430\u0447\u0430\u0432 \u0438\u0441\u043a\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c: \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043d\u0435\u0442, \u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<p>\u041d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e! \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441 \u0432\u0430\u043c\u0438 \u0432\u0441\u0435\u043c\u0438 \u044d\u0442\u0430\u043f\u0430\u043c\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0431\u043e\u0442\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c C#.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u043e\u0442 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430. \u0418\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c long-polling \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u043c\u0435\u0441\u0442\u043e webhooks. \u0411\u043e\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 <a href=\"http:\/\/asp.net\" rel=\"noopener noreferrer nofollow\">asp.net<\/a>. \u041d\u0443\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0440\u0438\u043a \u0438\u043b\u0438 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0411\u043e\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0439\u0434\u0435\u043c \u043f\u043e \u043f\u0443\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p><span class=\"habrahidden\">\u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u043e\u0442\u043e\u0432 \u043d\u0430 c# \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0438 \u0431\u043b\u0430\u0433\u043e\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/span><\/p>\n<p>\u041a\u0430\u043a \u043e\u043f\u043e\u0440\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/TelegramBots\/Telegram.Bot\" rel=\"noopener noreferrer nofollow\">Telegram.Bot<\/a>, \u043a\u0430\u043a \u0441\u0430\u043c\u0443 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0443\u044e \u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 API \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u043e\u0432. \u0417\u0430\u0439\u0434\u0435\u043c \u043d\u0430 github \u0438 \u043f\u043e\u0438\u0449\u0435\u043c \u043a\u0442\u043e \u0438 \u043a\u0430\u043a \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442.<\/p>\n<p>\u0421\u044e\u0440\u043f\u0440\u0438\u0437, \u043d\u043e c# \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u043e\u0432. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043d\u0430\u0448\u0435\u043b, \u044d\u0442\u043e \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u0438\u0433\u0440\u0430 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0430 <a href=\"https:\/\/www.tgwerewolf.com\/\" rel=\"noopener noreferrer nofollow\">tgwerewolf<\/a> <a href=\"https:\/\/github.com\/GreyWolfDev\/Werewolf\" rel=\"noopener noreferrer nofollow\">github<\/a>, \u043d\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0449\u0430\u044f\u0441\u044f. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0447\u0438\u0441\u0442\u044b\u0439 Telegram.Bot, \u0447\u0442\u043e-\u0442\u043e \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438, \u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0442\u044f\u0436\u0435\u043b\u043e.<\/p>\n<p>C \u0444\u0440\u0435\u0439\u043c\u043e\u0440\u043a\u0430\u043c\u0438 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u0447\u0443\u0442\u044c \u043b\u0443\u0447\u0448\u0435. \u042f \u043d\u0430\u0448\u0435\u043b \u0430\u0436 2 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<br \/> \u041d\u0430\u0447\u043d\u0435\u043c \u0441 <a href=\"https:\/\/github.com\/MajMcCloud\/TelegramBotFramework\" rel=\"noopener noreferrer nofollow\">TelegramBotFramework<\/a> \u2014 \u043d\u0430\u0447\u0430\u043b\u0438 \u0437\u0430 \u0437\u0434\u0440\u0430\u0432\u0438\u0435, \u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u0437\u0430 \u0443\u043f\u043e\u043a\u043e\u0439.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0432\u044f\u043b\u043e\u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0445\u043e\u0442\u044c \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0441\u044f \u0431\u043e\u0434\u0440\u043e: \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c. \u0418\u0437 \u043f\u043b\u044e\u0441\u043e\u0432, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f\u043c \u0438 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u0441 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0438 \u0432\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u0441\u043c\u0438\u0440\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0437\u0430\u0439\u0442\u0438. \u0414\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0430\u0431\u043e\u0440 &#171;ui&#187; \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0447\u0442\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u043e.<\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0435\u0441\u0442\u044c, \u043d\u043e \u043e\u043d\u043e \u043a\u043e\u0441\u0442\u044b\u043b\u044c\u043d\u043e\u0435 \u0438 \u043b\u0443\u0447\u0448\u0435 \u0434\u0430\u0436\u0435 \u043f\u0430\u043b\u043a\u043e\u0439 \u043d\u0435 \u0442\u044b\u043a\u0430\u0442\u044c, \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e.<\/p>\n<p>\u041d\u0443 \u0438 \u0438\u0437 \u043c\u0438\u043d\u0443\u0441\u043e\u0432: \u0442\u044f\u0436\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0443 <a href=\"http:\/\/asp.net\" rel=\"noopener noreferrer nofollow\">asp.net<\/a>; \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439; \u0442\u044f\u0436\u0435\u043b\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u0435\u0431\u044f. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440, \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>\u0418 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u0441\u0430\u043c\u043e\u0435 \u0432\u043a\u0443\u0441\u043d\u043e\u0435 \u2014 <a href=\"https:\/\/github.com\/TgBotFramework\/TgBotFramework\" rel=\"noopener noreferrer nofollow\">TgBotFramework<\/a> \u2014 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0442 \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0435\u0440\u0430 Telegram.Bot. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d, \u0434\u0440\u0443\u0436\u0438\u0442 \u0441 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430. \u041d\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0437\u043a\u0430, \u0431\u0435\u0440\u0435\u043c \u0438 \u0438\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430.<\/p>\n<p>\u0423\u0432\u044b, \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u0443\u0436\u0435 \u0431\u044b\u043b \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442, \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0431\u0435\u0440\u0435\u0442, \u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 \u043c\u0435\u0434\u0438\u0430\u0442\u043e\u0440\u0435, \u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0438\u043a\u043b \u0436\u0438\u0437\u043d\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0442 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430, \u043c\u043e\u0436\u0435\u0442 \u043a\u0430\u043a-\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0432\u043e\u0435\u0433\u043e Processor, \u043d\u043e \u044f \u043d\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b.<\/p>\n<p>\u041e\u0431\u0438\u0434\u043d\u043e, \u0447\u0442\u043e c# \u0438 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 .NET \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u044f\u0437\u044b\u043a\u0438 \u2014 <a href=\"https:\/\/github.com\/python-telegram-bot\/python-telegram-bot\" rel=\"noopener noreferrer nofollow\">python-telegram-bot<\/a> \u0438 <a href=\"https:\/\/github.com\/LonamiWebs\/Telethon\" rel=\"noopener noreferrer nofollow\">Telethon<\/a>,  go \u2014 <a href=\"https:\/\/github.com\/go-telegram-bot-api\/telegram-bot-api\" rel=\"noopener noreferrer nofollow\">telegram-bot-api<\/a> \u0438 \u0441\u0430\u043c\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 rust\u2014 <a href=\"https:\/\/github.com\/teloxide\/teloxide\" rel=\"noopener noreferrer nofollow\">teloxide<\/a><\/p>\n<p>\u0425\u043e\u0442\u044f \u043c\u043e\u0436\u0435\u0442 \u044f \u043f\u043b\u043e\u0445\u043e \u0438\u0441\u043a\u0430\u043b. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434, \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430 \u043d\u0430 c#.<\/p>\n<p>\u041d\u0443, \u0440\u0430\u0437 \u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u0442\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a \u0432\u044b\u0431\u043e\u0440\u0443, \u0442\u043e \u043d\u0435 \u043e\u0442\u0447\u0430\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u2014 \u0440\u0443\u043a\u0438 \u0432 \u043d\u043e\u0433\u0438 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0437 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u0441\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442 \u043c\u0435\u0434\u0438\u0430\u0442\u043e\u0440. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0438\u0445 \u043a\u0430\u043a scoped.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u043e\u043d\u043e\u0432\u0443\u044e \u0441\u043b\u0443\u0436\u0431\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0442 \u0431\u043e\u0442\u0430:<\/p>\n<pre><code class=\"cs\">public class PollingServiceBase : BackgroundService {     private readonly ITelegramBotClient botClient;     private readonly IUpdateHandler handler;      private readonly ReceiverOptions receiverOptions = new()     {         AllowedUpdates = [UpdateType.Message, UpdateType.CallbackQuery],         ThrowPendingUpdates = true,     };      public PollingServiceBase(ITelegramBotClient botClient, IUpdateHandler handler, IOptions&lt;AcadeMarketConfiguration> options, ILogger&lt;PollingServiceBase> logger)     {         this.botClient = botClient;         this.handler = handler;     }      protected override async Task ExecuteAsync(CancellationToken stoppingToken)     {         while (!stoppingToken.IsCancellationRequested)         {         try         {         await botClient.ReceiveAsync(updateHandler: handler, receiverOptions: receiverOptions, cancellationToken: stoppingToken);         }         catch         {         }         }     } <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u041a\u0440\u0443\u0442\u0438\u043c \u0432 \u0444\u043e\u043d\u0435 \u0432 \u0446\u0438\u043a\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0412 ReceiveAsync, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u0432 DefaultUpdateReceiver, \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043d\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 while \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0437\u0436\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435, \u043a\u0430\u043a \u0438 \u0441\u0430\u043c\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a. \u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u043a UpdateHandler.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0443\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u044f \u043c\u0430\u0433\u0438\u044f!<\/p>\n<pre><code class=\"cs\">public class UpdateHandler(IServiceProvider serviceProvider) : IUpdateHandler, IDisposable {     internal readonly Dictionary&lt;long, (string command, IServiceScope scope)> UsersCommand = [];      public UpdateHandler(         Dictionary&lt;long, (string command, IServiceScope scope)> dictionary,         IServiceProvider serviceProvider) :          this(serviceProvider)     {         UsersCommand = dictionary;     }      public async Task HandleUpdateAsync(ITelegramBotClient botClient, Update update, CancellationToken cancellationToken)     {         await using var scope = serviceProvider.CreateAsyncScope();         var publisher = scope.ServiceProvider.GetRequiredService&lt;IPublisher>();          var chat = update.GetChat();         ArgumentNullException.ThrowIfNull(chat);          var getCommand = new GetBotCommandNotification { Update = update };         await publisher.Publish(getCommand, cancellationToken);          var tuple = ChooseCommand(chat.Id, getCommand.Command);         if (!tuple.HasValue) return;          var provider = tuple.Value.scope;         var command = tuple.Value.command;          var scopeMediator = provider.ServiceProvider.GetRequiredKeyedService&lt;IMediator>(nameof(CustomTelegramMediator));         IBotCommandContext updateReceived = new BotCommandContext(update, chat, command);          try         {             await scopeMediator.Publish(updateReceived, cancellationToken);                         ArgumentException.ThrowIfNullOrWhiteSpace(updateReceived.Command);         }         catch (Exception e)         {             var asyncServiceScope = new AsyncServiceScope(provider);             await asyncServiceScope.DisposeAsync();              UsersCommand.Remove(chat.Id);              throw;         }          if (updateReceived.NeedRefresh)         {             provider.Dispose();             UsersCommand.Remove(chat.Id);         }     }      private (IServiceScope scope, string command)? ChooseCommand(long chatId, string botCommand)     {         var exist = UsersCommand.TryGetValue(chatId, out var tuple);          IServiceScope provider;         var command = botCommand;          if (string.IsNullOrWhiteSpace(command) &amp;&amp; !exist) return null;         if (!string.IsNullOrWhiteSpace(command) &amp;&amp; !exist)         {             provider = serviceProvider.CreateScope();             UsersCommand.Add(chatId, (command, provider));         }         else if (string.IsNullOrWhiteSpace(command) &amp;&amp; exist)         {             provider = tuple.scope;             command = tuple.command;         }         else         {             if (tuple.command != command)             {                 tuple.scope.Dispose();                  provider = serviceProvider.CreateScope();                 UsersCommand[chatId] = (command, provider);             }             else             {                 provider = tuple.scope;                 command = tuple.command;             }         }          return (provider, command);     } } <\/code><\/pre>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0435\u0442: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0437\u0430\u0432\u043e\u0434\u0438\u043c scope \u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0435\u0441\u0442\u044c \u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043c\u0435\u043d\u044f\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u0443; \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u0435\u0440\u043d\u0443\u043b\u0430 <code>NeedRefresh<\/code> \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043c\u0443\u0442\u0438\u0442\u044c \u2014  <code>var scopeMediator = provider.ServiceProvider.GetRequiredKeyedService&lt;IMediator>(nameof(CustomTelegramMediator))<\/code>, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 <code>GetBotCommandNotification<\/code>, \u043d\u0435 \u0437\u043d\u0430\u044e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0447\u0442\u043e notification \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u0435\u0433\u043e \u0432 <code>GetBotCommandNotification<\/code>. \u0421\u0430\u043c <code>GetBotCommandHandler<\/code> \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439:<\/p>\n<pre><code class=\"cs\">public abstract class GetBotCommandHandler : INotificationHandler&lt;GetBotCommandNotification> {     public abstract UpdateType Type { get; }      public ValueTask Handle(GetBotCommandNotification command, CancellationToken cancellationToken)     {         if (command.Update.Type != Type) return ValueTask.CompletedTask;         if (!CanHandle(command)) return ValueTask.CompletedTask;          SetCommand(command);         return ValueTask.CompletedTask;     }      protected internal abstract bool CanHandle(GetBotCommandNotification notification);      protected internal abstract void SetCommand(GetBotCommandNotification notification); } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u043c\u0430\u043d\u0434. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439: \u043c\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u0437 Telegram. \u0417\u0430\u0442\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f\u043c. \u0415\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435 \u0438\u043c\u0435\u0435\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f \u0434\u043b\u044f \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439, \u0430 \u0435\u0449\u0435 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c IPipelineBehavior <a href=\"https:\/\/github.com\/jbogard\/MediatR\/issues\/353\" rel=\"noopener noreferrer nofollow\">\u043a \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u043c<\/a>.<\/p>\n<p>\u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. \u0412 Mediatr \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u0435\u0434\u0438\u0430\u0442\u043e\u0440\u0430 \u0438 <a href=\"https:\/\/github.com\/jbogard\/MediatR\/pull\/431\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u043c \u043f\u0440\u0438 \u0438\u0445 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438<\/a>. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c  \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u043e \u043a\u043b\u044e\u0447\u0443 (<a href=\"https:\/\/learn.microsoft.com\/en-us\/aspnet\/core\/fundamentals\/dependency-injection?view=aspnetcore-8.0#keyed-services\" rel=\"noopener noreferrer nofollow\">AddKeyed \u0438 \u0435\u0433\u043e \u0434\u0440\u0443\u0437\u044c\u044f<\/a>), \u043a\u0430\u043a \u0432\u0441\u0435 \u0443\u0434\u0430\u0447\u043d\u043e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-373284","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/373284","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=373284"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/373284\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=373284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=373284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=373284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}