{"id":1119,"date":"2021-07-12T09:33:19","date_gmt":"2021-07-12T09:33:19","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=1119"},"modified":"2021-07-16T07:15:06","modified_gmt":"2021-07-16T07:15:06","slug":"futbolnyj-telegram-bot-na-python-1-4-podgotovka-i-nastrojka-bota","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/uk\/futbolnyj-telegram-bot-na-python-1-4-podgotovka-i-nastrojka-bota\/","title":{"rendered":"\u0424\u0443\u0442\u0431\u043e\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442 \u043d\u0430 Python (1\/4): \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u043e\u0442\u0430"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430 \u043d\u0430 python. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c API, \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0444\u0443\u0442\u0431\u043e\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0442\u0447\u0435\u0439 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u0433\u0434\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u0430, \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0431\u043e\u0442\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u0412\u043c\u0435\u0441\u0442\u043e Heroku, \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, \u0447\u0442\u043e \u0431\u044b \u0431\u043e\u0442 \u043d\u0435 \u0437\u0430\u0441\u044b\u043f\u0430\u043b. \u042d\u0442\u043e \u0431\u043b\u0438\u0436\u0435 \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0440\u0430\u0437\u0431\u0438\u0442\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u044b:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 Redis.<\/li><li>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430.<\/li><li>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 , \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445.<\/li><li>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u0442\u0430.<\/li><li>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0432\u044b\u0431\u043e\u0440 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0430\u043f\u0438 \u0444\u0443\u0442\u0431\u043e\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0442\u0447\u0435\u0439.<\/li><li>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043c\u0430\u0442\u0447\u0435\u0439 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 \u0431\u043e\u0442\u0430.<\/li><li>\u0414\u0435\u043f\u043b\u043e\u0439, \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435:<ol><li>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u0435\u0448\u0435\u0432\u043e\u0433\u043e \u0438\u043b\u0438 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e VPS.<\/li><li>\u0417\u0430\u043f\u0443\u0441\u043a \u0420\u0435\u0434\u0438\u0441-\u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/li><li>\u0417\u0430\u043f\u0443\u0441\u043a \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u043e\u0442\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/li><\/ol><\/li><li><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-\">\u0412\u0432\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439+, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0437\u043d\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 async\/await. \u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u043d\u0438\u0439 \u043c\u0430\u043b\u043e, \u043a\u0440\u0430\u0439\u043d\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0432&nbsp;Pycharm, \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0447\u0442\u043e \u0431\u044b \u043f\u0440\u043e\u0435\u043a\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c\u044e.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u0412\u0435\u0440\u0441\u0438\u044f Python - 3.8+\n\naiogram==2.11.2\nemoji==1.1.0\nredis==3.5.3\nujson==4.0.1\nuvloop==0.14.0  # \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430 Windows<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043a\u043e\u0434\u043e\u043c \u044d\u0442\u043e\u0439 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u043e\u0442\u0430:<br><a href=\"https:\/\/gitlab.com\/PythonRu\/fonlinebot\/-\/tree\/master\/first_step\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/gitlab.com\/PythonRu\/fonlinebot\/-\/tree\/master\/first_step<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-redis\">\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0431\u043e\u0442\u0430 \u0438 Redis<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u00abfonlinebot\u00bb \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u0412 Pycharm \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pythonru.com\/wp-content\/uploads\/2021\/01\/pycharm-new-project.png\" alt=\"pycharm new project\" class=\"wp-image-4592\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u0442\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f 4: \u0434\u043b\u044f \u0431\u043e\u0442\u0430, \u0440\u0430\u0431\u043e\u0442\u044b \u0441 redis, \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0438 emoji \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u0445.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install aiogram==2.11.2 redis==3.5.3 ujson==4.0.1 emoji==1.1.0<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-redis-1\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Redis \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Redis \u2014 \u044d\u0442\u043e \u0440\u0435\u0437\u0438\u0434\u0435\u043d\u0442\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0442\u0430\u043a\u0430\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u044f\u043c\u043e \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438) \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u0440 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0427\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0434\u0438\u0441\u043a\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0442\u043e\u0440\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p><cite>\u0418\u0437 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014&nbsp;<a href=\"https:\/\/pythonru.com\/biblioteki\/redis-python\" target=\"_blank\" rel=\"noopener\">Redis \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 Python<\/a><\/cite><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Redis \u043d\u0430 Linux\/Mac \u0441\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u044d\u0442\u0438\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c:&nbsp;<a href=\"https:\/\/redis.io\/download#from-source-code\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/redis.io\/download#from-source-code<\/a>. \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438&nbsp;<code>src\/redis-server<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0427\u0442\u043e \u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 Windows \u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u0443\u0439\u0442\u0435 \u0430\u0440\u0445\u0438\u0432&nbsp;<a href=\"https:\/\/github.com\/dmajkic\/redis\/downloads\" target=\"_blank\" rel=\"noreferrer noopener\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>. \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u00abredis-server.exe\u00bb.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u00abmain.py\u00bb \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># fonlinebot\/main.py\nimport redis\n\n\nr = redis.StrictRedis()\nprint(r.ping())\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u044b\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u0442&nbsp;<code>True<\/code>, \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0430.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h--1\">\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0431\u043e\u0442\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c&nbsp;<a href=\"https:\/\/t.me\/botfather\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/t.me\/botfather<\/a>&nbsp;\u043a\u043e\u043c\u0430\u043d\u0434\u0443&nbsp;<code>\/newbot<\/code>. \u0414\u0430\u043b\u0435\u0435 \u043e\u043d \u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0438\u043c\u044f \u0438 \u0430\u0434\u0440\u0435\u0441 \u0431\u043e\u0442\u0430. \u0415\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b, \u0432\u044b\u0434\u0430\u0435\u0442 \u0442\u043e\u043a\u0435\u043d. \u0423\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u00abfonlinebot\u00bb \u0441\u043d\u043e\u0432\u0430.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pythonru.com\/wp-content\/uploads\/2021\/01\/registraciya-bota-v-telegrame.png\" alt=\"\u0424\u0443\u0442\u0431\u043e\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442 \u043d\u0430 Python (1\/4): \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u043e\u0442\u0430\" class=\"wp-image-4594\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0442\u043e\u043a\u0435\u043d \u0432 \u0444\u0430\u0439\u043b. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u00abconfig.py\u00bb \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0438 \u0437\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0442\u043e\u043a\u0435\u043d&nbsp;<code>TOKEN = \"\u0412\u0410\u0428 \u0422\u041e\u041a\u0415\u041d\"<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h--2\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u043e\u0442\u0430<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u0441 redis \u0438 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0444\u0430\u0439\u043b\u044b. \u0412 \u043f\u0430\u043f\u043a\u0435 \u00abfonlinebot\u00bb \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u043d\u0435\u0435 \u00abmain.py\u00bb \u0438 \u00abconfig.py\u00bb \u0434\u043e\u0431\u0430\u0432\u0438\u043c: \u00abdatabase.py\u00bb, \u00abrequirements.txt\u00bb \u0438 \u043f\u0430\u043f\u043a\u0443 \u00abapp\u00bb. \u0412 \u043f\u0430\u043f\u043a\u0443 \u00abapp\u00bb \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435: \u00abbot.py\u00bb, \u00abdialogs.py\u00bb, \u00abservice.py\u00bb. \u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pythonru.com\/wp-content\/uploads\/2021\/01\/arhitektura-bota.png\" alt=\"\u0424\u0443\u0442\u0431\u043e\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442 \u043d\u0430 Python (1\/4): \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u043e\u0442\u0430\" class=\"wp-image-4596\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0432 \u0431\u043e\u0442 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438, \u0435\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u0434\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u00abmain.py\u00bb \u2014 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u043e\u0442\u0430.<\/li><li>\u00abconfig.py\u00bb \u2014 \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043b\u044e\u0447\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/li><li>\u00abdatabase.py\u00bb \u2014 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043a\u0435\u0448\u0435\u043c(redis).<\/li><li>\u00abrequirements.txt\u00bb \u2014 \u0445\u0440\u0430\u043d\u0438\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/li><li>\u00abapp\u00bb \u2014 \u043f\u0430\u043f\u043a\u0430 \u0441\u0430\u043c\u043e\u0433\u043e \u0431\u043e\u0442\u0430.<ul><li>\u00abbot.py\u00bb \u2014 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u043e\u0442\u0430 \u0441 \u044e\u0437\u0435\u0440\u0430\u043c\u0438, \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/li><li>\u00abdialogs.py\u00bb \u2014 \u0432\u0441\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u0431\u043e\u0442\u0430.<\/li><li>\u00abservice.py\u00bb \u2014 \u0431\u0438\u0437\u043d\u0435\u0441 \u043b\u043e\u0433\u0438\u043a\u0430, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043c\u0430\u0442\u0447\u0430\u0445.<\/li><\/ul><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e. \u0417\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u00abrequirements.txt\u00bb \u043d\u0430\u0448\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>aiogram==2.11.2\nemoji==1.1.0\nredis==3.5.3\nujson==4.0.1\nuvloop==0.14.0<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u0422\u0430\u043a \u043a\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 Windows, uvloop \u043c\u044b \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u00abconfig.py\u00bb \u043a \u0442\u043e\u043a\u0435\u043d\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u043e\u0442\u0430 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a redis.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># fonlinebot\/config.py\nimport ujson\nimport logging\nlogging.basicConfig(level=logging.INFO)\n\n\nTOKEN = \"\u0437\u0434\u0435\u0441\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u043e\u043a\u0435\u043d\"\nBOT_VERSION = 0.1\n# \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044e\u0437\u0435\u0440\u043e\u043c \u043b\u0438\u0433\u0438\nBOT_DB_NAME = \"users_leagues\"\n# \u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043b\u0438\u0433\nBOT_LEAGUES = {\n    \"1\": \"\u0411\u0443\u043d\u0434\u0435\u0441\u043b\u0438\u0433\u0430\",\n    \"2\": \"\u0421\u0435\u0440\u0438\u044f \u0410\",\n    \"3\": \"\u041b\u0430 \u041b\u0438\u0433\u0430\",\n    \"4\": \"\u0422\u0443\u0440\u0435\u0446\u043a\u0430\u044f \u0421\u0443\u043f\u0435\u0440\u043b\u0438\u0433\u0430\",\n    \"5\": \"\u0427\u0435\u043c\u043f\u0438\u043e\u043d\u0430\u0442 \u041d\u0438\u0434\u0435\u0440\u043b\u0430\u043d\u0434\u043e\u0432\",\n    \"6\": \"\u041f\u0440\u043e-\u043b\u0438\u0433\u0430 \u0411\u0435\u043b\u044c\u0433\u0438\u0438\",\n    \"7\": \"\u0410\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0430\u044f \u041f\u0440\u0435\u043c\u044c\u0435\u0440-\u043b\u0438\u0433\u0430\",\n    \"8\": \"\u041b\u0438\u0433\u0430 1\",\n}\n# \u0424\u043b\u0430\u0433\u0438 \u0434\u043b\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, emoji-\u043a\u043e\u0434\nBOT_LEAGUE_FLAGS = {\n    \"1\": \":Germany:\",\n    \"2\": \":Italy:\",\n    \"3\": \":Spain:\",\n    \"4\": \":Turkey:\",\n    \"5\": \":Netherlands:\",\n    \"6\": \":Belgium:\",\n    \"7\": \":England:\",\n    \"8\": \":France:\",\n}\n\n# \u0414\u0430\u043d\u043d\u044b\u0435 redis-\u043a\u043b\u0438\u0435\u043d\u0442\u0430\nREDIS_HOST = 'localhost'\nREDIS_PORT = 6379\n# \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0430\u0440\u043e\u043b\u044f \u043d\u0435\u0442. \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435\nREDIS_PASSWORD = None\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043b\u0438\u0433\u0430\u0445 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 json \u0444\u0430\u0439\u043b. \u042d\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u043e\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 10 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u044f \u044f\u0432\u043d\u043e \u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u0430\u043b.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h--3\">\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 sqlite \u0438 redis. \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0439 \u043f\u043e \u043b\u0438\u0433\u0430\u043c \u044e\u0437\u0435\u0440\u043e\u0432.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042e\u0437\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c 3 \u0447\u0435\u043c\u043f\u0438\u043e\u043d\u0430\u0442\u0430 \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f, \u0431\u043e\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u0445 \u0432 \u0411\u0414 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u0435\u0448(redis) \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u0430\u0442\u0447\u0435\u0439, \u0447\u0442\u043e \u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a API \u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 API \u043b\u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># fonlinebot\/database.py\nimport os\nimport logging\nimport sqlite3\nimport redis\nimport ujson\n\nimport config\n\n\n# \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 redis.StrictRedis\nclass Cache(redis.StrictRedis):\n    def __init__(self, host, port, password,\n                 charset=\"utf-8\",\n                 decode_responses=True):\n        super(Cache, self).__init__(host, port,\n                                    password=password,\n                                    charset=charset,\n                                    decode_responses=decode_responses)\n        logging.info(\"Redis start\")\n\n    def jset(self, name, value, ex=0):\n        \"\"\"\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 python-\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 Json \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\"\"\"\n        r = self.get(name)\n        if r is None:\n            return r\n        return ujson.loads(r)\n\n    def jget(self, name):\n        \"\"\"\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 Json \u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0432 python-\u043e\u0431\u044a\u0435\u043a\u0442\"\"\"\n        return ujson.loads(self.get(name))\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043b\u0430\u0441\u0441&nbsp;<code>Cache<\/code>&nbsp;\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442&nbsp;<code>StrictRedis<\/code>. \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c 2 \u043c\u0435\u0442\u043e\u0434\u0430&nbsp;<code>jset<\/code>,&nbsp;<code>jget<\/code>&nbsp;\u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 python \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 redis. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043d\u0438\u043c\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 CRUD.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># fonlinebot\/database.py\n#...\n\n\nclass Database:\n    \"\"\" \u041a\u043b\u0430\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \"\"\"\n    def __init__(self, name):\n        self.name = name\n        self._conn = self.connection()\n        logging.info(\"Database connection established\")\n\n    def create_db(self):\n        connection = sqlite3.connect(f\"{self.name}.db\")\n        logging.info(\"Database created\")\n        cursor = connection.cursor()\n        cursor.execute('''CREATE TABLE users \n                          (id INTEGER PRIMARY KEY,\n                           leagues VARCHAR NOT NULL);''')\n        connection.commit()\n        cursor.close()\n\n    def connection(self):\n        db_path = os.path.join(os.getcwd(), f\"{self.name}.db\")\n        if not os.path.exists(db_path):\n            self.create_db()\n        return sqlite3.connect(f\"{self.name}.db\")\n\n    def _execute_query(self, query, select=False):\n        cursor = self._conn.cursor()\n        cursor.execute(query)\n        if select:\n            records = cursor.fetchone()\n            cursor.close()\n            return records\n        else:\n            self._conn.commit()\n        cursor.close()\n\n    async def insert_users(self, user_id: int, leagues: str):\n        insert_query = f\"\"\"INSERT INTO users (id, leagues)\n                                       VALUES ({user_id}, \"{leagues}\")\"\"\"\n        self._execute_query(insert_query)\n        logging.info(f\"Leagues for user {user_id} added\")\n\n    async def select_users(self, user_id: int):\n        select_query = f\"\"\"SELECT leagues from leagues \n                           where id = {user_id}\"\"\"\n        record = self._execute_query(select_query, select=True)\n        return record\n\n    async def update_users(self, user_id: int, leagues: str):\n        update_query = f\"\"\"Update leagues \n                              set leagues = \"{leagues}\" where id = {user_id}\"\"\"\n        self._execute_query(update_query)\n        logging.info(f\"Leagues for user {user_id} updated\")\n\n    async def delete_users(self, user_id: int):\n        delete_query = f\"\"\"DELETE FROM users WHERE id = {user_id}\"\"\"\n        self._execute_query(delete_query)\n        logging.info(f\"User {user_id} deleted\")\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sqlite \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430. \u0427\u0442\u043e \u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439, \u044f \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0424\u0430\u0439\u043b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u0432:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># fonlinebot\/database.py\n#...\n\n\n# \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 cache \u0438 database\ncache = Cache(\n    host=config.REDIS_HOST,\n    port=config.REDIS_PORT,\n    password=config.REDIS_PASSWORD\n)\ndatabase = Database(config.BOT_DB_NAME)\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h--4\">\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439&nbsp;<code>dataclass<\/code>. \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u0432\u0441\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b. \u0410&nbsp;<code>dataclass<\/code>&nbsp;\u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># fonlinebot\/app\/dialogs.py\nfrom dataclasses import dataclass\n\n\n@dataclass(frozen=True)\nclass Messages:\n    test: str = \"\u041f\u0440\u0438\u0432\u0435\u0442 {name}. \u0420\u0430\u0431\u043e\u0442\u0430\u044e...\"\n\n\nmsg = Messages()\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h--5\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u043e\u0442\u0430<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0444\u0430\u0439\u043b\u0435 \u00abbot.py\u00bb\u00a0<a href=\"https:\/\/www.bearloga.space\/kak-sozdat-chat-bota-dlya-telegram-s-pomoshhyu-python\">\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0431\u043e\u0442\u0430<\/a>. \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u043e\u0442\u0430 \u0438 \u043f\u0435\u0440\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># fonlinebot\/app\/bot.py\nfrom aiogram import Bot, types\nfrom aiogram.contrib.middlewares.logging import LoggingMiddleware\nfrom aiogram.dispatcher import Dispatcher\n\nfrom config import TOKEN\nfrom app.dialogs import msg\nfrom database import database as db\n\n\n# \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u0430\nbot = Bot(token=TOKEN)\ndp = Dispatcher(bot)\ndp.middleware.setup(LoggingMiddleware())\n\n\n@dp.message_handler()\nasync def test_message(message: types.Message):\n    # \u0438\u043c\u044f \u044e\u0437\u0435\u0440\u0430 \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0430\n    user_name = message.from_user.first_name\n    await message.answer(msg.test.format(name=user_name))\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f&nbsp;<code>test_message<\/code>&nbsp;\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u044e\u0431\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430&nbsp;<code>on_shutdown<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># fonlinebot\/app\/bot.py\n# ...\n\nasync def on_shutdown(dp):\n    logging.warning('Shutting down..')\n    # \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0411\u0414\n    db._conn.close()\n    logging.warning(\"DB Connection closed\")\n\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h--6\">\u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0431\u043e\u0442\u0430<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0430\u0439\u043b \u00abmain.py\u00bb. \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u043e\u0442\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0443\u043b\u0438\u043d\u0433:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># fonlinebot\/main.py\nfrom aiogram import executor\n\nfrom app import bot\n\n\nexecutor.start_polling(bot.dp, \n                       skip_updates=True, \n                       on_shutdown=bot.on_shutdown)\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432 Pycharm, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u00abTerminal\u00bb \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435&nbsp;<code>python main.py<\/code>. \u0427\u0442\u043e \u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0431\u043e\u0442\u0430 \u0431\u0435\u0437 Pycharm:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430,<\/li><li>\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0439\u0442\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435,<\/li><li>\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 (<code>python main.py<\/code>).<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pythonru.com\/wp-content\/uploads\/2021\/01\/run-telegram-bot-terminal.png\" alt=\"\u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0431\u043e\u0442\u0430\" class=\"wp-image-4602\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pythonru.com\/wp-content\/uploads\/2021\/01\/pervoe-soobshenie-botu.png\" alt=\"\u041f\u0435\u0440\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0431\u043e\u0442\u0443\" class=\"wp-image-4603\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u0447\u0442\u043e \u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h--7\">\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u0442\u0430<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f. \u0427\u0442\u043e \u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043d\u0443\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043c\u043e\u0434\u0443\u043b\u044c \u00abtest.py\u00bb \u0432 \u043f\u0430\u043f\u043a\u0443 fonlinebot. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e 4 \u0442\u0435\u0441\u0442\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0438.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># fonlinebot\/test.py\nimport unittest\nimport aiohttp\nfrom unittest import IsolatedAsyncioTestCase\n\nfrom database import cache, database\nfrom app import bot\n\n\nclass TestDatabase(IsolatedAsyncioTestCase):\n    async def test_crud(self):\n        await database.insert_users(1111, \"1 2 3\")\n        self.assertEqual(await database.select_users(1111), ('1 2 3',))\n        await database.delete_users(1111)\n        self.assertEqual(await database.select_users(1111), None)\n\n\nclass TestCache(unittest.TestCase):\n    def test_connection(self):\n        self.assertTrue(cache.ping())\n\n    def test_response_type(self):\n        cache.setex(\"test_type\", 10, \"Hello\")\n        response = cache.get(\"test_type\")\n        self.assertEqual(type(response), str)\n\n\nclass TestBot(IsolatedAsyncioTestCase):\n    async def test_bot_auth(self):\n        bot.bot._session = aiohttp.ClientSession()\n        bot_info = await bot.bot.get_me()\n        await bot.bot._session.close()\n\n        self.assertEqual(bot_info&#91;\"username\"], \"FonlineBOT\")\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c CRUD \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0443\u0434\u0430\u043b\u0438\u043c. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 redis \u0438 \u0431\u043e\u0442\u043e\u043c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u0430 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u0430\u043a \u0438 \u0431\u043e\u0442\u0430, \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430&nbsp;<code>python main.py<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pythonru.com\/wp-content\/uploads\/2021\/01\/testirovanie-telegram-bota.png\" alt=\"\u0424\u0443\u0442\u0431\u043e\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442 \u043d\u0430 Python (1\/4): \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u043e\u0442\u0430\" class=\"wp-image-4605\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u0432\u0438\u0434\u043d\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u042d\u0442\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f&nbsp;<a href=\"https:\/\/github.com\/aio-libs\/aiohttp\/issues\/4324\" target=\"_blank\" rel=\"noreferrer noopener\">\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 aiohttp<\/a>&nbsp;\u043d\u0430 windows, \u043c\u043e\u0436\u043d\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h--8\">\u041e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li><code>aiogram.utils.exceptions.Unauthorized: Unauthorized<\/code>&nbsp;\u2014 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0431\u043e\u0442\u0430. \u0422\u043e\u043a\u0435\u043d \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443, \u0435\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u00ab\u0446\u0438\u0444\u0440\u044b:\u0431\u0443\u043a\u0432\u044b-\u0438-\u0446\u0438\u0444\u0440\u044b\u00bb, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435.<\/li><li><code>redis.exceptions.ConnectionError: Error 10061 connecting to ...<\/code>&nbsp;\u2014 redis-server \u043d\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d.<\/li><li><code>sqlite3.IntegrityError: UNIQUE constraint failed: ...<\/code>&nbsp;\u2014 \u0432\u044b \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0431\u043e\u0442\u0430 \u043d\u0430 python. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c API, \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0444\u0443\u0442\u0431\u043e\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0442\u0447\u0435\u0439 \u0438 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[79],"tags":[],"class_list":["post-1119","page","type-page","status-publish","hentry","category-futbolnyj-telegram-bot-na-python"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/1119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/comments?post=1119"}],"version-history":[{"count":0,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/1119\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/media?parent=1119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/categories?post=1119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/tags?post=1119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}