Make general_handler
handle photo updates
This commit is contained in:
parent
48b7e1e4a2
commit
92e39e7ed7
@ -11,7 +11,7 @@ __author__ = "Davide Testa"
|
|||||||
__email__ = "davide@davte.it"
|
__email__ = "davide@davte.it"
|
||||||
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
||||||
__license__ = "GNU General Public License v3.0"
|
__license__ = "GNU General Public License v3.0"
|
||||||
__version__ = "2.6.15"
|
__version__ = "2.6.16"
|
||||||
__maintainer__ = "Davide Testa"
|
__maintainer__ = "Davide Testa"
|
||||||
__contact__ = "t.me/davte"
|
__contact__ = "t.me/davte"
|
||||||
|
|
||||||
|
@ -934,10 +934,10 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject):
|
|||||||
|
|
||||||
async def photo_message_handler(self, update, user_record, language=None):
|
async def photo_message_handler(self, update, user_record, language=None):
|
||||||
"""Handle `photo` message update."""
|
"""Handle `photo` message update."""
|
||||||
logging.info(
|
return await self.general_handler(update=update,
|
||||||
"A photo message update was received, "
|
user_record=user_record,
|
||||||
"but this handler does nothing yet."
|
language=language,
|
||||||
)
|
update_type='photo')
|
||||||
|
|
||||||
async def sticker_message_handler(self, update, user_record, language=None):
|
async def sticker_message_handler(self, update, user_record, language=None):
|
||||||
"""Handle `sticker` message update."""
|
"""Handle `sticker` message update."""
|
||||||
@ -1003,6 +1003,8 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject):
|
|||||||
user_id = update['from']['id'] if 'from' in update else None
|
user_id = update['from']['id'] if 'from' in update else None
|
||||||
if update_type not in self.individual_handlers:
|
if update_type not in self.individual_handlers:
|
||||||
self.individual_handlers[update_type] = dict()
|
self.individual_handlers[update_type] = dict()
|
||||||
|
if update_type not in self.handlers:
|
||||||
|
self.handlers[update_type] = OrderedDict()
|
||||||
if user_id in self.individual_handlers[update_type]:
|
if user_id in self.individual_handlers[update_type]:
|
||||||
replier = self.individual_handlers[update_type][user_id]
|
replier = self.individual_handlers[update_type][user_id]
|
||||||
del self.individual_handlers[update_type][user_id]
|
del self.individual_handlers[update_type][user_id]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user