mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge pull request #1484 from coder2020official/master
Regular documentation update.
This commit is contained in:
commit
a9e0f5b7b0
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -11,4 +11,5 @@ OS:
|
|||||||
## Checklist:
|
## Checklist:
|
||||||
- [ ] I added/edited example on new feature/change (if exists)
|
- [ ] I added/edited example on new feature/change (if exists)
|
||||||
- [ ] My changes won't break backend compatibility
|
- [ ] My changes won't break backend compatibility
|
||||||
|
- [ ] I made changes for async and sync
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
pytelegrambotapi
|
-r requirements.txt
|
||||||
|
|
||||||
furo
|
furo
|
||||||
sphinx_copybutton
|
sphinx_copybutton
|
||||||
|
git+https://github.com/eternnoir/pyTelegramBotAPI.git
|
||||||
|
@ -1148,15 +1148,15 @@ class TeleBot:
|
|||||||
|
|
||||||
Telegram documentation: https://core.telegram.org/bots/api#sendaudio
|
Telegram documentation: https://core.telegram.org/bots/api#sendaudio
|
||||||
|
|
||||||
:param chat_id:Unique identifier for the message recipient
|
:param chat_id: Unique identifier for the message recipient
|
||||||
:param audio:Audio file to send.
|
:param audio: Audio file to send.
|
||||||
:param caption:
|
:param caption:
|
||||||
:param duration:Duration of the audio in seconds
|
:param duration: Duration of the audio in seconds
|
||||||
:param performer:Performer
|
:param performer: Performer
|
||||||
:param title:Track name
|
:param title: Track name
|
||||||
:param reply_to_message_id:If the message is a reply, ID of the original message
|
:param reply_to_message_id: If the message is a reply, ID of the original message
|
||||||
:param reply_markup:
|
:param reply_markup:
|
||||||
:param parse_mode
|
:param parse_mode:
|
||||||
:param disable_notification:
|
:param disable_notification:
|
||||||
:param timeout:
|
:param timeout:
|
||||||
:param thumb:
|
:param thumb:
|
||||||
@ -2936,7 +2936,8 @@ class TeleBot:
|
|||||||
|
|
||||||
def add_middleware_handler(self, handler, update_types=None):
|
def add_middleware_handler(self, handler, update_types=None):
|
||||||
"""
|
"""
|
||||||
Add middleware handler
|
Add middleware handler.
|
||||||
|
|
||||||
:param handler:
|
:param handler:
|
||||||
:param update_types:
|
:param update_types:
|
||||||
:return:
|
:return:
|
||||||
@ -3146,6 +3147,7 @@ class TeleBot:
|
|||||||
"""
|
"""
|
||||||
Adds the edit message handler
|
Adds the edit message handler
|
||||||
Note that you should use register_edited_message_handler to add edited_message_handler to the bot.
|
Note that you should use register_edited_message_handler to add edited_message_handler to the bot.
|
||||||
|
|
||||||
:param handler_dict:
|
:param handler_dict:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
@ -3424,6 +3426,7 @@ class TeleBot:
|
|||||||
def register_chosen_inline_handler(self, callback, func, pass_bot=False, **kwargs):
|
def register_chosen_inline_handler(self, callback, func, pass_bot=False, **kwargs):
|
||||||
"""
|
"""
|
||||||
Registers chosen inline handler.
|
Registers chosen inline handler.
|
||||||
|
|
||||||
:param callback: function to be called
|
:param callback: function to be called
|
||||||
:param func:
|
:param func:
|
||||||
:param pass_bot: Pass TeleBot to handler.
|
: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):
|
def register_chat_join_request_handler(self, callback, func=None, pass_bot=False, **kwargs):
|
||||||
"""
|
"""
|
||||||
Registers chat join request handler.
|
Registers chat join request handler.
|
||||||
|
|
||||||
:param callback: function to be called
|
:param callback: function to be called
|
||||||
:param func:
|
:param func:
|
||||||
:param pass_bot: Pass TeleBot to handler.
|
:param pass_bot: Pass TeleBot to handler.
|
||||||
@ -3748,7 +3752,7 @@ class TeleBot:
|
|||||||
"""
|
"""
|
||||||
Create custom filter.
|
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.
|
:param custom_filter: Custom filter class with key.
|
||||||
"""
|
"""
|
||||||
self.custom_filters[custom_filter.key] = custom_filter
|
self.custom_filters[custom_filter.key] = custom_filter
|
||||||
|
@ -10,6 +10,7 @@ class CallbackDataFilter:
|
|||||||
def check(self, query):
|
def check(self, query):
|
||||||
"""
|
"""
|
||||||
Checks if query.data appropriates to specified config
|
Checks if query.data appropriates to specified config
|
||||||
|
|
||||||
:param query: telebot.types.CallbackQuery
|
:param query: telebot.types.CallbackQuery
|
||||||
:return: bool
|
:return: bool
|
||||||
"""
|
"""
|
||||||
@ -50,6 +51,7 @@ class CallbackData:
|
|||||||
def new(self, *args, **kwargs) -> str:
|
def new(self, *args, **kwargs) -> str:
|
||||||
"""
|
"""
|
||||||
Generate callback data
|
Generate callback data
|
||||||
|
|
||||||
:param args: positional parameters of CallbackData instance parts
|
:param args: positional parameters of CallbackData instance parts
|
||||||
:param kwargs: named parameters
|
:param kwargs: named parameters
|
||||||
:return: str
|
:return: str
|
||||||
@ -87,6 +89,7 @@ class CallbackData:
|
|||||||
def parse(self, callback_data: str) -> typing.Dict[str, str]:
|
def parse(self, callback_data: str) -> typing.Dict[str, str]:
|
||||||
"""
|
"""
|
||||||
Parse data from the callback data
|
Parse data from the callback data
|
||||||
|
|
||||||
:param callback_data: string, use to telebot.types.CallbackQuery to parse it from string to a dict
|
:param callback_data: string, use to telebot.types.CallbackQuery to parse it from string to a dict
|
||||||
:return: dict parsed from callback data
|
:return: dict parsed from callback data
|
||||||
"""
|
"""
|
||||||
|
@ -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.
|
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)
|
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 json_type: input json or parsed dict
|
||||||
:param dict_copy: if dict is passed and it is changed outside - should be True!
|
:param dict_copy: if dict is passed and it is changed outside - should be True!
|
||||||
:return: Dictionary parsed from json or original dict
|
: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 1.
|
||||||
When row_width is set to 2, the following is the result of this function: {keyboard: [["A", "B"], ["C"]]}
|
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
|
See https://core.telegram.org/bots/api#replykeyboardmarkup
|
||||||
|
|
||||||
:param args: KeyboardButton to append to the keyboard
|
:param args: KeyboardButton to append to the keyboard
|
||||||
:param row_width: width of row
|
:param row_width: width of row
|
||||||
:return: self, to allow function chaining.
|
: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.
|
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"]]}'
|
ReplyKeyboardMarkup#row("A")#row("B", "C")#to_json() outputs '{keyboard: [["A"], ["B", "C"]]}'
|
||||||
See https://core.telegram.org/bots/api#replykeyboardmarkup
|
See https://core.telegram.org/bots/api#replykeyboardmarkup
|
||||||
|
|
||||||
:param args: strings
|
:param args: strings
|
||||||
:return: self, to allow function chaining.
|
:return: self, to allow function chaining.
|
||||||
"""
|
"""
|
||||||
@ -2399,6 +2402,7 @@ class ShippingOption(JsonSerializable):
|
|||||||
def add_price(self, *args):
|
def add_price(self, *args):
|
||||||
"""
|
"""
|
||||||
Add LabeledPrice to ShippingOption
|
Add LabeledPrice to ShippingOption
|
||||||
|
|
||||||
:param args: LabeledPrices
|
:param args: LabeledPrices
|
||||||
"""
|
"""
|
||||||
for price in args:
|
for price in args:
|
||||||
|
@ -226,8 +226,9 @@ def pil_image_to_file(image, extension='JPEG', quality='web_low'):
|
|||||||
|
|
||||||
|
|
||||||
def is_command(text: str) -> bool:
|
def is_command(text: str) -> bool:
|
||||||
"""
|
r"""
|
||||||
Checks if `text` is a command. Telegram chat commands start with the '/' character.
|
Checks if `text` is a command. Telegram chat commands start with the '/' character.
|
||||||
|
|
||||||
:param text: Text to check.
|
:param text: Text to check.
|
||||||
:return: True if `text` is a command, else False.
|
: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.
|
Use this decorator to mark functions as deprecated.
|
||||||
When the function is used, an info (or warning if `warn` is True) is logged.
|
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 warn: If True a warning is logged else an info
|
||||||
:param alternative: The new function to use instead
|
:param alternative: The new function to use instead
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user