mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
fix: some intendation
This commit is contained in:
@ -33,6 +33,7 @@ class Handler:
|
||||
"""
|
||||
Class for (next step|reply) handlers
|
||||
"""
|
||||
|
||||
def __init__(self, callback, *args, **kwargs):
|
||||
self.callback = callback
|
||||
self.args = args
|
||||
@ -46,6 +47,7 @@ class Saver:
|
||||
"""
|
||||
Class for saving (next step|reply) handlers
|
||||
"""
|
||||
|
||||
def __init__(self, handlers, filename, delay):
|
||||
self.handlers = handlers
|
||||
self.filename = filename
|
||||
@ -1303,12 +1305,11 @@ class TeleBot:
|
||||
if not was_poped:
|
||||
i += 1
|
||||
|
||||
|
||||
@staticmethod
|
||||
def _build_handler_dict(handler, **filters):
|
||||
return {
|
||||
'function': handler,
|
||||
'filters': filters
|
||||
'filters' : filters
|
||||
}
|
||||
|
||||
def message_handler(self, commands=None, regexp=None, func=None, content_types=['text'], **kwargs):
|
||||
@ -1518,8 +1519,6 @@ class AsyncTeleBot(TeleBot):
|
||||
def load_reply_handlers(self, filename="./.handler-saves/reply.save", del_file_after_loading=True):
|
||||
return TeleBot.load_reply_handlers(self, filename, del_file_after_loading)
|
||||
|
||||
@util.async_dec()
|
||||
|
||||
@util.async_dec()
|
||||
def get_me(self):
|
||||
return TeleBot.get_me(self)
|
||||
|
@ -457,11 +457,11 @@ class Message(JsonDeserializable):
|
||||
if not entities:
|
||||
return text
|
||||
_subs = {
|
||||
"bold": "<b>{text}</b>",
|
||||
"italic": "<i>{text}</i>",
|
||||
"pre": "<pre>{text}</pre>",
|
||||
"code": "<code>{text}</code>",
|
||||
"url": "<a href=\"{url}\">{text}</a>",
|
||||
"bold" : "<b>{text}</b>",
|
||||
"italic" : "<i>{text}</i>",
|
||||
"pre" : "<pre>{text}</pre>",
|
||||
"code" : "<code>{text}</code>",
|
||||
"url" : "<a href=\"{url}\">{text}</a>",
|
||||
"text_link": "<a href=\"{url}\">{text}</a>"
|
||||
}
|
||||
if hasattr(self, "custom_subs"):
|
||||
@ -469,6 +469,7 @@ class Message(JsonDeserializable):
|
||||
_subs[type] = self.custom_subs[type]
|
||||
utf16_text = text.encode("utf-16-le")
|
||||
html_text = ""
|
||||
|
||||
def func(text, type=None, url=None, user=None):
|
||||
text = text.decode("utf-16-le")
|
||||
if type == "text_mention":
|
||||
@ -501,6 +502,7 @@ class Message(JsonDeserializable):
|
||||
def html_caption(self):
|
||||
return self.__html_text(self.caption, self.caption_entities)
|
||||
|
||||
|
||||
class MessageEntity(JsonDeserializable):
|
||||
@classmethod
|
||||
def de_json(cls, json_string):
|
||||
@ -1069,7 +1071,7 @@ class InputVenueMessageContent(Dictionaryable):
|
||||
|
||||
def to_dic(self):
|
||||
json_dic = {'latitude': self.latitude, 'longitude': self.longitude, 'title': self.title,
|
||||
'address': self.address}
|
||||
'address' : self.address}
|
||||
if self.foursquare_id:
|
||||
json_dic['foursquare_id'] = self.foursquare_id
|
||||
return json_dic
|
||||
|
Reference in New Issue
Block a user