Browse Source

use telegram.chat.Chat.send_location shortcut

Fabian Peter Hammerle 3 years ago
parent
commit
19d9bad5de
3 changed files with 13 additions and 12 deletions
  1. 3 1
      Pipfile
  2. 9 9
      Pipfile.lock
  3. 1 2
      location_guessing_game_telegram_bot.py

+ 3 - 1
Pipfile

@@ -4,7 +4,9 @@ verify_ssl = true
 name = "pypi"
 
 [packages]
-python-telegram-bot = "*"
+# >=13.0 telegram.chat.Chat.send_location shortcut
+# https://github.com/python-telegram-bot/python-telegram-bot/commit/fc5844c13da3b3fb20bb2d0bfcdf1efb1a826ba6#diff-2590f2bde47ea3730442f14a3a029ef77d8f2c8f3186cf5edd7e18bcc7243c39R381
+python-telegram-bot = ">=13.0"
 
 [dev-packages]
 # black requires python>=3.6

+ 9 - 9
Pipfile.lock

@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "ae1fdbcde9e141e60694c50e106cc303f9abca009aa37d75775c8630ce269444"
+            "sha256": "c37088f160c98b47950a36733ba55f419830e6ac5e9608b9734fc2572219b6bd"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -74,15 +74,15 @@
         },
         "cryptography": {
             "hashes": [
-                "sha256:287032b6a7d86abc98e8e977b20138c53fea40e5b24e29090d5a675a973dcd10",
-                "sha256:288c65eea20bd89b11102c47b118bc1e0749386b0a0dfebba414076c5d4c8188",
-                "sha256:7eed937ad9b53280a5f53570d3a7dc93cb4412b6a3d58d4c6bb78cc26319c729",
-                "sha256:dab437c2e84628703e3358f0f06555a6259bc5039209d51aa3b05af667ff4fd0",
-                "sha256:ee5e19f0856b6fbbdbab15c2787ca65d203801d2d65d0b8de6218f424206c848",
-                "sha256:f21be9ec6b44c223b2024bbe59d394fadc7be320d18a8d595419afadb6cd5620",
-                "sha256:f6ea140d2736b7e1f0de4f988c43f76b0b3f3d365080e091715429ba218dce28"
+                "sha256:0bf49d5b38e4f3745a0eab0597fa97720dd49b30d65f534b49a82e303f149deb",
+                "sha256:18d6f3ac1da14a01c95f4590ee58e96aa6628d231ce738e9eca330b9997127b6",
+                "sha256:4f6761a82b51fe02cda8f45af1c2f698a10f50003dc9c2572d8a49eda2e6d35b",
+                "sha256:8b3b79af57e12aabbc3db81e563eaa07870293a1ffdcc891d107035ce9a0dbff",
+                "sha256:9c6f7552d4f2130542d488b9d9e5b1546204b5d1aa90c823d50cce8eed421363",
+                "sha256:b0873ac0c0e6bc6882cd285930cc382ec4e78786be71bdc113c06246eea61294",
+                "sha256:c8dc9859c5a046e1ca22da360dfd609c09064a4f974881cb5cba977c581088ec"
             ],
-            "version": "==3.4.4"
+            "version": "==3.4.5"
         },
         "pycparser": {
             "hashes": [

+ 1 - 2
location_guessing_game_telegram_bot.py

@@ -53,8 +53,7 @@ def _photo_command(
             reply_to_message_id=context.chat_data["last_photo_message_id"],
         )
         # https://github.com/python-telegram-bot/python-telegram-bot/pull/2043
-        context.bot.send_location(
-            chat_id=update.effective_chat.id,
+        update.effective_chat.send_location(
             latitude=context.chat_data["last_photo"].latitude,
             longitude=context.chat_data["last_photo"].longitude,
             disable_notification=True,