1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Badiboy
a9e0f5b7b0
Merge pull request #1484 from coder2020official/master
Regular documentation update.
2022-03-21 01:36:15 +03:00
_run
7b1b1a7caa
Update PULL_REQUEST_TEMPLATE.md 2022-03-19 14:06:07 +05:00
coder2020official
a6477541c0 Documentation incorrect display is fixed now. 2022-03-19 13:49:36 +05:00
_run
b652a9f6dc
Update doc_req.txt 2022-03-19 13:26:09 +05:00
_run
73b2813512
Update doc_req.txt 2022-03-10 20:22:42 +05:00
6 changed files with 27 additions and 11 deletions

View File

@ -11,4 +11,5 @@ OS:
## Checklist:
- [ ] I added/edited example on new feature/change (if exists)
- [ ] My changes won't break backend compatibility
- [ ] I made changes for async and sync

View File

@ -1,3 +1,5 @@
pytelegrambotapi
-r requirements.txt
furo
sphinx_copybutton
git+https://github.com/eternnoir/pyTelegramBotAPI.git

View File

@ -1148,15 +1148,15 @@ class TeleBot:
Telegram documentation: https://core.telegram.org/bots/api#sendaudio
:param chat_id:Unique identifier for the message recipient
:param audio:Audio file to send.
:param chat_id: Unique identifier for the message recipient
:param audio: Audio file to send.
:param caption:
:param duration:Duration of the audio in seconds
:param performer:Performer
:param title:Track name
:param reply_to_message_id:If the message is a reply, ID of the original message
:param duration: Duration of the audio in seconds
:param performer: Performer
:param title: Track name
:param reply_to_message_id: If the message is a reply, ID of the original message
:param reply_markup:
:param parse_mode
:param parse_mode:
:param disable_notification:
:param timeout:
:param thumb:
@ -2936,7 +2936,8 @@ class TeleBot:
def add_middleware_handler(self, handler, update_types=None):
"""
Add middleware handler
Add middleware handler.
:param handler:
:param update_types:
:return:
@ -3146,6 +3147,7 @@ class TeleBot:
"""
Adds the edit message handler
Note that you should use register_edited_message_handler to add edited_message_handler to the bot.
:param handler_dict:
:return:
"""
@ -3424,6 +3426,7 @@ class TeleBot:
def register_chosen_inline_handler(self, callback, func, pass_bot=False, **kwargs):
"""
Registers chosen inline handler.
:param callback: function to be called
:param func:
:param pass_bot: Pass TeleBot to handler.
@ -3719,6 +3722,7 @@ class TeleBot:
def register_chat_join_request_handler(self, callback, func=None, pass_bot=False, **kwargs):
"""
Registers chat join request handler.
:param callback: function to be called
:param func:
:param pass_bot: Pass TeleBot to handler.
@ -3748,7 +3752,7 @@ class TeleBot:
"""
Create custom filter.
custom_filter: Class with check(message) method.
:param custom_filter: Class with check(message) method.
:param custom_filter: Custom filter class with key.
"""
self.custom_filters[custom_filter.key] = custom_filter

View File

@ -10,6 +10,7 @@ class CallbackDataFilter:
def check(self, query):
"""
Checks if query.data appropriates to specified config
:param query: telebot.types.CallbackQuery
:return: bool
"""
@ -50,6 +51,7 @@ class CallbackData:
def new(self, *args, **kwargs) -> str:
"""
Generate callback data
:param args: positional parameters of CallbackData instance parts
:param kwargs: named parameters
:return: str
@ -87,6 +89,7 @@ class CallbackData:
def parse(self, callback_data: str) -> typing.Dict[str, str]:
"""
Parse data from the callback data
:param callback_data: string, use to telebot.types.CallbackQuery to parse it from string to a dict
:return: dict parsed from callback data
"""

View File

@ -69,6 +69,7 @@ class JsonDeserializable(object):
"""
Checks whether json_type is a dict or a string. If it is already a dict, it is returned as-is.
If it is not, it is converted to a dict by means of json.loads(json_type)
:param json_type: input json or parsed dict
:param dict_copy: if dict is passed and it is changed outside - should be True!
:return: Dictionary parsed from json or original dict
@ -943,6 +944,7 @@ class ReplyKeyboardMarkup(JsonSerializable):
when row_width is set to 1.
When row_width is set to 2, the following is the result of this function: {keyboard: [["A", "B"], ["C"]]}
See https://core.telegram.org/bots/api#replykeyboardmarkup
:param args: KeyboardButton to append to the keyboard
:param row_width: width of row
:return: self, to allow function chaining.
@ -974,6 +976,7 @@ class ReplyKeyboardMarkup(JsonSerializable):
Adds a list of KeyboardButton to the keyboard. This function does not consider row_width.
ReplyKeyboardMarkup#row("A")#row("B", "C")#to_json() outputs '{keyboard: [["A"], ["B", "C"]]}'
See https://core.telegram.org/bots/api#replykeyboardmarkup
:param args: strings
:return: self, to allow function chaining.
"""
@ -2399,6 +2402,7 @@ class ShippingOption(JsonSerializable):
def add_price(self, *args):
"""
Add LabeledPrice to ShippingOption
:param args: LabeledPrices
"""
for price in args:

View File

@ -226,8 +226,9 @@ def pil_image_to_file(image, extension='JPEG', quality='web_low'):
def is_command(text: str) -> bool:
"""
r"""
Checks if `text` is a command. Telegram chat commands start with the '/' character.
:param text: Text to check.
:return: True if `text` is a command, else False.
"""
@ -452,6 +453,7 @@ def deprecated(warn: bool=True, alternative: Optional[Callable]=None):
"""
Use this decorator to mark functions as deprecated.
When the function is used, an info (or warning if `warn` is True) is logged.
:param warn: If True a warning is logged else an info
:param alternative: The new function to use instead
"""