diff --git a/davtelepot/__init__.py b/davtelepot/__init__.py index c27680d..8f8c80d 100644 --- a/davtelepot/__init__.py +++ b/davtelepot/__init__.py @@ -14,7 +14,7 @@ __author__ = "Davide Testa" __email__ = "davide@davte.it" __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __license__ = "GNU General Public License v3.0" -__version__ = "2.1.29" +__version__ = "2.1.30" __maintainer__ = "Davide Testa" __contact__ = "t.me/davte" diff --git a/davtelepot/custombot.py b/davtelepot/custombot.py index 48bab08..a249255 100644 --- a/davtelepot/custombot.py +++ b/davtelepot/custombot.py @@ -314,32 +314,12 @@ class Bot(davtelepot.bot.Bot): ) return - async def handle_location(self, update): - """Handle location sent by user.""" - user_id = update['from']['id'] if 'from' in update else None - answerer, answer = None, None - if self.maintenance: - if update['chat']['id'] > 0: - answer = self.maintenance_message - elif user_id in self.custom_location_parsers: - answerer = self.custom_location_parsers[user_id] - del self.custom_location_parsers[user_id] - if answerer: - if asyncio.iscoroutinefunction(answerer): - answer = await answerer(update) - else: - answer = answerer(update) - if answer: - try: - return await self.send_message(answer=answer, chat_id=update) - except Exception as e: - logging.error( - "Failed to process answer:\n{}".format( - e - ), - exc_info=True - ) - return + async def handle_location(self, *args, **kwargs): + """Handle location sent by user. + + This method is deprecated: use `location_message_handler` instead. + """ + return await super().location_message_handler(*args, **kwargs) def set_custom_parser(self, parser, update=None, user=None): """Set a custom parser for the user.