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

Updated documentation to another theme.

This commit is contained in:
coder2020official 2022-03-07 16:10:44 +05:00
parent c8fb83c97c
commit dd589e2490
7 changed files with 33 additions and 29 deletions

2
.gitignore vendored
View File

@ -67,5 +67,3 @@ testMain.py
# documentation # documentation
_build/ _build/
_static/
_templates/

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -16,13 +16,14 @@
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
import telebot
project = 'pyTelegramBotAPI' project = 'pyTelegramBotAPI'
copyright = '2022, coder2020official' copyright = '2022, coder2020official'
author = 'coder2020official' author = 'coder2020official'
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
release = '1.0' release = telebot.__version__
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
@ -36,6 +37,7 @@ extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
"sphinx.ext.autosummary", "sphinx.ext.autosummary",
"sphinx.ext.napoleon", "sphinx.ext.napoleon",
"sphinx_copybutton",
] ]
@ -53,14 +55,18 @@ exclude_patterns = []
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
# #
html_theme = 'sphinx_rtd_theme' html_theme = 'furo'
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] html_static_path = ['_static']
html_logo = 'logo.png' #html_logo = 'logo.png'
html_theme_options = { html_theme_options = {
'logo_only': True, "light_css_variables": {
'display_version': False, "color-brand-primary": "#7C4DFF",
"color-brand-content": "#7C4DFF",
},
"light_logo": "logo.png",
"dark_logo": "logo2.png",
} }

View File

@ -46,6 +46,8 @@ REPLY_MARKUP_TYPES = Union[
Module : telebot Module : telebot
""" """
__version__ = '4.4.0'
class Handler: class Handler:
""" """
@ -916,8 +918,7 @@ class TeleBot:
Telegram documentation: https://core.telegram.org/bots/api#setchatstickerset Telegram documentation: https://core.telegram.org/bots/api#setchatstickerset
:param chat_id: Unique identifier for the target chat or username of the target supergroup :param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
(in the format @supergroupusername)
:param sticker_set_name: Name of the sticker set to be set as the group sticker set :param sticker_set_name: Name of the sticker set to be set as the group sticker set
:return: API reply. :return: API reply.
""" """
@ -2913,17 +2914,19 @@ class TeleBot:
Example: Example:
bot = TeleBot('TOKEN') .. code-block:: python3
# Print post message text before entering to any post_channel handlers bot = TeleBot('TOKEN')
@bot.middleware_handler(update_types=['channel_post', 'edited_channel_post'])
def print_channel_post_text(bot_instance, channel_post):
print(channel_post.text)
# Print update id before entering to any handlers # Print post message text before entering to any post_channel handlers
@bot.middleware_handler() @bot.middleware_handler(update_types=['channel_post', 'edited_channel_post'])
def print_channel_post_text(bot_instance, update): def print_channel_post_text(bot_instance, channel_post):
print(update.update_id) print(channel_post.text)
# Print update id before entering to any handlers
@bot.middleware_handler()
def print_channel_post_text(bot_instance, update):
print(update.update_id)
:param update_types: Optional list of update types that can be passed into the middleware handler. :param update_types: Optional list of update types that can be passed into the middleware handler.
""" """
@ -2986,7 +2989,7 @@ class TeleBot:
All message handlers are tested in the order they were added. All message handlers are tested in the order they were added.
Example: Example:
.. code-block:: python .. code-block:: python
bot = TeleBot('TOKEN') bot = TeleBot('TOKEN')

View File

@ -2344,17 +2344,14 @@ class AsyncTeleBot:
If user is restricted for more than 366 days or less than 30 seconds from the current time, If user is restricted for more than 366 days or less than 30 seconds from the current time,
they are considered to be restricted forever they are considered to be restricted forever
:param can_send_messages: Pass True, if the user can send text messages, contacts, locations and venues :param can_send_messages: Pass True, if the user can send text messages, contacts, locations and venues
:param can_send_media_messages Pass True, if the user can send audios, documents, photos, videos, video notes :param can_send_media_messages: Pass True, if the user can send audios, documents, photos, videos, video notes
and voice notes, implies can_send_messages and voice notes, implies can_send_messages
:param can_send_polls: Pass True, if the user is allowed to send polls, implies can_send_messages :param can_send_polls: Pass True, if the user is allowed to send polls, implies can_send_messages
:param can_send_other_messages: Pass True, if the user can send animations, games, stickers and :param can_send_other_messages: Pass True, if the user can send animations, games, stickers and
use inline bots, implies can_send_media_messages use inline bots, implies can_send_media_messages
:param can_add_web_page_previews: Pass True, if the user may add web page previews to their messages, :param can_add_web_page_previews: Pass True, if the user may add web page previews to their messages, implies can_send_media_messages
implies can_send_media_messages :param can_change_info: Pass True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
:param can_change_info: Pass True, if the user is allowed to change the chat title, photo and other settings. :param can_invite_users: Pass True, if the user is allowed to invite new users to the chat, implies can_invite_users
Ignored in public supergroups
:param can_invite_users: Pass True, if the user is allowed to invite new users to the chat,
implies can_invite_users
:param can_pin_messages: Pass True, if the user is allowed to pin messages. Ignored in public supergroups :param can_pin_messages: Pass True, if the user is allowed to pin messages. Ignored in public supergroups
:return: True on success :return: True on success
""" """

View File

@ -283,7 +283,7 @@ def split_string(text: str, chars_per_string: int) -> List[str]:
def smart_split(text: str, chars_per_string: int=MAX_MESSAGE_LENGTH) -> List[str]: def smart_split(text: str, chars_per_string: int=MAX_MESSAGE_LENGTH) -> List[str]:
""" r"""
Splits one string into multiple strings, with a maximum amount of `chars_per_string` characters per string. Splits one string into multiple strings, with a maximum amount of `chars_per_string` characters per string.
This is very useful for splitting one giant message into multiples. This is very useful for splitting one giant message into multiples.
If `chars_per_string` > 4096: `chars_per_string` = 4096. If `chars_per_string` > 4096: `chars_per_string` = 4096.