From 8aa8fa59864a788b4563aed459ff4df650230014 Mon Sep 17 00:00:00 2001 From: JekaFST Date: Tue, 5 Dec 2017 00:21:05 +0300 Subject: [PATCH 1/2] Fix for SendLocation with live period Fix for payload['live_perion'] typo -> payload['live_period'] --- telebot/apihelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/apihelper.py b/telebot/apihelper.py index 8dd78c3..a12d38d 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -271,7 +271,7 @@ def send_location(token, chat_id, latitude, longitude, live_period=None, reply_t method_url = r'sendLocation' payload = {'chat_id': chat_id, 'latitude': latitude, 'longitude': longitude} if live_period: - payload['live_perion'] = live_period + payload['live_period'] = live_period if reply_to_message_id: payload['reply_to_message_id'] = reply_to_message_id if reply_markup: From 60596a95b828667a16f6919f65d0d96de71a5c39 Mon Sep 17 00:00:00 2001 From: JekaFST Date: Tue, 5 Dec 2017 01:31:47 +0300 Subject: [PATCH 2/2] Edit and stop live location fixes .token was missed in apihelper's methods calls --- telebot/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index 97dfa4b..190e556 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -639,7 +639,7 @@ class TeleBot: :return: """ return types.Message.de_json( - apihelper.edit_message_live_location(self, latitude, longitude, chat_id, message_id, + apihelper.edit_message_live_location(self.token, latitude, longitude, chat_id, message_id, inline_message_id, reply_markup)) def stop_message_live_location(self, chat_id=None, message_id=None, inline_message_id=None, reply_markup=None): @@ -653,7 +653,7 @@ class TeleBot: :return: """ return types.Message.de_json( - apihelper.stop_message_live_location(self, chat_id, message_id, inline_message_id, reply_markup)) + apihelper.stop_message_live_location(self.token, chat_id, message_id, inline_message_id, reply_markup)) def send_venue(self, chat_id, latitude, longitude, title, address, foursquare_id=None, disable_notification=None, reply_to_message_id=None, reply_markup=None):