{"id":227,"date":"2021-01-01T21:26:33","date_gmt":"2021-01-01T20:26:33","guid":{"rendered":"https:\/\/www.davidestebanmunoz.com\/?p=227"},"modified":"2021-12-30T21:38:16","modified_gmt":"2021-12-30T20:38:16","slug":"wc-bilbao-telegram-bot","status":"publish","type":"post","link":"https:\/\/www.davidestebanmunoz.com\/?p=227","title":{"rendered":"WC Bilbao Telegram Bot"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.davidestebanmunoz.com\/?p=230&amp;lang=es\">Este art\u00edculo se puede leer en castellano aqui<\/a><br>This telegram bot is accessible at<a href=\"http:\/\/t.me\/metrobilbao_bot\"> <\/a><a href=\"http:\/\/t.me\/aseosbilbao_bot\">http:\/\/t.me\/aseosbilbao_bot<\/a><\/p>\n\n\n\n<p>This bot was created when during COVID19 pandemic, the restaurants and pubs were closed in Euskadi by the gobernment several times and if you were in a hurry and you need a WC you cannot enter into one of those.<\/p>\n\n\n\n<p><br>The objective of this bot is to have the nearest 3 public WCs based on your location. Also, as it is really simple, its code can be used as base python code for telegram bots development.<\/p>\n\n\n\n<p>The interaction with the user is based on telegram commands, you send \/aseo command and the bots offers you to send your location. Finnally it will send you the location of 3 nearest WCs<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.davidestebanmunoz.com\/wp-content\/uploads\/2021\/12\/imagen-5.png\" alt=\"\" class=\"wp-image-228\" width=\"313\" height=\"191\" srcset=\"https:\/\/www.davidestebanmunoz.com\/wp-content\/uploads\/2021\/12\/imagen-5.png 489w, https:\/\/www.davidestebanmunoz.com\/wp-content\/uploads\/2021\/12\/imagen-5-300x183.png 300w\" sizes=\"auto, (max-width: 313px) 100vw, 313px\" \/><\/figure>\n\n\n\n<p>Its architecture is formed by just a MariaDB container and a Python container<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"187\" src=\"https:\/\/www.davidestebanmunoz.com\/wp-content\/uploads\/2021\/12\/telegram_bot.drawio-300x187.png\" alt=\"\" class=\"wp-image-196\" srcset=\"https:\/\/www.davidestebanmunoz.com\/wp-content\/uploads\/2021\/12\/telegram_bot.drawio-300x187.png 300w, https:\/\/www.davidestebanmunoz.com\/wp-content\/uploads\/2021\/12\/telegram_bot.drawio.png 451w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure><\/div>\n\n\n\n<p>pyTelegramBotAPI Python library has been used for handling telegram requests and MariaDB DB has been used for storaging WC coordinates and names.<\/p>\n\n\n\n<p>Full code of docker-compose and application itself is available at <a href=\"https:\/\/github.com\/botmakerdvd\/wcbilbao_bot\">https:\/\/github.com\/botmakerdvd\/wcbilbao_bot<\/a><\/p>\n\n\n\n<p>Also it is included <a href=\"https:\/\/github.com\/botmakerdvd\/wcbilbao_bot\/blob\/master\/data\/handler\/import_wc_bilbao.py\"><a href=\"https:\/\/github.com\/botmakerdvd\/wcbilbao_bot\/blob\/master\/data\/handler\/import_wc_bilbao.py\">import_wc_bilbao.py<\/a><\/a> that reads WCs from <a href=\"https:\/\/www.bilbao.eus\/Bilbaonet\/kml\/aseos_publicos.kml\">bilbao.eus<\/a> and updates the DB<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Type: Telegram Bot<\/li><li>Where: Docker containers on VPS<\/li><li>Languages and technologies used: Python, MySQL<\/li><li>Github repo: yes<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/www.davidestebanmunoz.com\/?p=227\">Read More<span class=\"screen-reader-text\">WC Bilbao Telegram Bot<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[38,49,52,81],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-personal-projects","tag-docker-en","tag-python","tag-sql","tag-telegram","excerpt"],"_links":{"self":[{"href":"https:\/\/www.davidestebanmunoz.com\/index.php?rest_route=\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.davidestebanmunoz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.davidestebanmunoz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.davidestebanmunoz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.davidestebanmunoz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=227"}],"version-history":[{"count":2,"href":"https:\/\/www.davidestebanmunoz.com\/index.php?rest_route=\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":232,"href":"https:\/\/www.davidestebanmunoz.com\/index.php?rest_route=\/wp\/v2\/posts\/227\/revisions\/232"}],"wp:attachment":[{"href":"https:\/\/www.davidestebanmunoz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.davidestebanmunoz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.davidestebanmunoz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}