From 8e71a612a666d53ac9880544e2c97e134795c1e8 Mon Sep 17 00:00:00 2001 From: Evgeny Petrov Date: Sun, 22 Oct 2017 20:07:51 +0300 Subject: [PATCH] Added missing methods definitions to __init__.py and Async Telebot --- telebot/__init__.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/telebot/__init__.py b/telebot/__init__.py index d1099ba..c2ce45c 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -610,6 +610,35 @@ class TeleBot: apihelper.send_location(self.token, chat_id, latitude, longitude, live_period, reply_to_message_id, reply_markup, disable_notification)) + def edit_message_live_location(self, latitude, longitude, chat_id=None, message_id=None, + inline_message_id=None, reply_markup=None): + """ + Use this method to edit live location + :param latitude: + :param longitude: + :param chat_id: + :param message_id: + :param inline_message_id: + :param reply_markup: + :return: + """ + return types.Message.de_json( + apihelper.edit_message_live_location(self, 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): + """ + Use this method to stop updating a live location message sent by the bot + or via the bot (for inline bots) before live_period expires + :param chat_id: + :param message_id: + :param inline_message_id: + :param reply_markup: + :return: + """ + return types.Message.de_json( + apihelper.stop_message_live_location(self, 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): """ @@ -1328,6 +1357,14 @@ class AsyncTeleBot(TeleBot): def send_location(self, *args, **kwargs): return TeleBot.send_location(self, *args, **kwargs) + @util.async() + def edit_message_live_location(self, *args, **kwargs): + return TeleBot.edit_message_live_location(self, *args, **kwargs) + + @util.async() + def stop_message_live_location(self, *args, **kwargs): + return TeleBot.stop_message_live_location(self, *args, **kwargs) + @util.async() def send_venue(self, *args, **kwargs): return TeleBot.send_venue(self, *args, **kwargs)