mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Add ParseMode module
This commit is contained in:
parent
e7cbff8087
commit
84ae464b52
@ -23,3 +23,4 @@ __version__ = "0.4.2"
|
|||||||
from .api.errors import Error
|
from .api.errors import Error
|
||||||
from .client import ChatAction
|
from .client import ChatAction
|
||||||
from .client import Client
|
from .client import Client
|
||||||
|
from .client import ParseMode
|
||||||
|
@ -18,3 +18,4 @@
|
|||||||
|
|
||||||
from .chat_action import ChatAction
|
from .chat_action import ChatAction
|
||||||
from .client import Client
|
from .client import Client
|
||||||
|
from .parse_mode import ParseMode
|
||||||
|
@ -488,8 +488,9 @@ class Client:
|
|||||||
Text of the message to be sent.
|
Text of the message to be sent.
|
||||||
|
|
||||||
parse_mode (:obj:`str`):
|
parse_mode (:obj:`str`):
|
||||||
Use "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or
|
Use :obj:`pyrogram.ParseMode.MARKDOWN` or :obj:`pyrogram.ParseMode.HTML` if you want Telegram apps
|
||||||
inline URLs in your message. Defaults to "Markdown".
|
to show bold, italic, fixed-width text or inline URLs in your message.
|
||||||
|
Defaults to MARKDOWN.
|
||||||
|
|
||||||
disable_web_page_preview (:obj:`bool`, optional):
|
disable_web_page_preview (:obj:`bool`, optional):
|
||||||
Disables link previews for links in this message.
|
Disables link previews for links in this message.
|
||||||
@ -585,8 +586,9 @@ class Client:
|
|||||||
Photo caption, 0-200 characters.
|
Photo caption, 0-200 characters.
|
||||||
|
|
||||||
parse_mode (:obj:`str`):
|
parse_mode (:obj:`str`):
|
||||||
Use "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or
|
Use :obj:`pyrogram.ParseMode.MARKDOWN` or :obj:`pyrogram.ParseMode.HTML` if you want Telegram apps
|
||||||
inline URLs in your caption. Defaults to "Markdown".
|
to show bold, italic, fixed-width text or inline URLs in your caption.
|
||||||
|
Defaults to MARKDOWN.
|
||||||
|
|
||||||
ttl_seconds (:obj:`int`, optional):
|
ttl_seconds (:obj:`int`, optional):
|
||||||
Self-Destruct Timer.
|
Self-Destruct Timer.
|
||||||
@ -657,8 +659,9 @@ class Client:
|
|||||||
Audio caption, 0-200 characters.
|
Audio caption, 0-200 characters.
|
||||||
|
|
||||||
parse_mode (:obj:`str`):
|
parse_mode (:obj:`str`):
|
||||||
Use "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or
|
Use :obj:`pyrogram.ParseMode.MARKDOWN` or :obj:`pyrogram.ParseMode.HTML` if you want Telegram apps
|
||||||
inline URLs in your caption. Defaults to "Markdown".
|
to show bold, italic, fixed-width text or inline URLs in your caption.
|
||||||
|
Defaults to MARKDOWN.
|
||||||
|
|
||||||
duration (:obj:`int`, optional):
|
duration (:obj:`int`, optional):
|
||||||
Duration of the audio in seconds.
|
Duration of the audio in seconds.
|
||||||
@ -736,8 +739,9 @@ class Client:
|
|||||||
Document caption, 0-200 characters.
|
Document caption, 0-200 characters.
|
||||||
|
|
||||||
parse_mode (:obj:`str`):
|
parse_mode (:obj:`str`):
|
||||||
Use "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or
|
Use :obj:`pyrogram.ParseMode.MARKDOWN` or :obj:`pyrogram.ParseMode.HTML` if you want Telegram apps
|
||||||
inline URLs in your caption. Defaults to "Markdown".
|
to show bold, italic, fixed-width text or inline URLs in your caption.
|
||||||
|
Defaults to MARKDOWN.
|
||||||
|
|
||||||
disable_notification (:obj:`bool`, optional):
|
disable_notification (:obj:`bool`, optional):
|
||||||
Sends the message silently.
|
Sends the message silently.
|
||||||
@ -804,8 +808,9 @@ class Client:
|
|||||||
Video caption, 0-200 characters.
|
Video caption, 0-200 characters.
|
||||||
|
|
||||||
parse_mode (:obj:`str`):
|
parse_mode (:obj:`str`):
|
||||||
Use "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or
|
Use :obj:`pyrogram.ParseMode.MARKDOWN` or :obj:`pyrogram.ParseMode.HTML` if you want Telegram apps
|
||||||
inline URLs in your caption. Defaults to "Markdown".
|
to show bold, italic, fixed-width text or inline URLs in your caption.
|
||||||
|
Defaults to MARKDOWN.
|
||||||
|
|
||||||
duration (:obj:`int`, optional):
|
duration (:obj:`int`, optional):
|
||||||
Duration of sent video in seconds.
|
Duration of sent video in seconds.
|
||||||
@ -883,8 +888,9 @@ class Client:
|
|||||||
Voice message caption, 0-200 characters.
|
Voice message caption, 0-200 characters.
|
||||||
|
|
||||||
parse_mode (:obj:`str`):
|
parse_mode (:obj:`str`):
|
||||||
Use "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or
|
Use :obj:`pyrogram.ParseMode.MARKDOWN` or :obj:`pyrogram.ParseMode.HTML` if you want Telegram apps
|
||||||
inline URLs in your caption. Defaults to "Markdown".
|
to show bold, italic, fixed-width text or inline URLs in your caption.
|
||||||
|
Defaults to MARKDOWN.
|
||||||
|
|
||||||
duration (:obj:`int`, optional):
|
duration (:obj:`int`, optional):
|
||||||
Duration of the voice message in seconds.
|
Duration of the voice message in seconds.
|
||||||
@ -1247,8 +1253,9 @@ class Client:
|
|||||||
New text of the message.
|
New text of the message.
|
||||||
|
|
||||||
parse_mode (:obj:`str`):
|
parse_mode (:obj:`str`):
|
||||||
Use "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or
|
Use :obj:`pyrogram.ParseMode.MARKDOWN` or :obj:`pyrogram.ParseMode.HTML` if you want Telegram apps
|
||||||
inline URLs in your message. Defaults to "Markdown".
|
to show bold, italic, fixed-width text or inline URLs in your message.
|
||||||
|
Defaults to MARKDOWN.
|
||||||
|
|
||||||
disable_web_page_preview (:obj:`bool`, optional):
|
disable_web_page_preview (:obj:`bool`, optional):
|
||||||
Disables link previews for links in this message.
|
Disables link previews for links in this message.
|
||||||
@ -1287,8 +1294,9 @@ class Client:
|
|||||||
New caption of the message.
|
New caption of the message.
|
||||||
|
|
||||||
parse_mode (:obj:`str`):
|
parse_mode (:obj:`str`):
|
||||||
Use "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or
|
Use :obj:`pyrogram.ParseMode.MARKDOWN` or :obj:`pyrogram.ParseMode.HTML` if you want Telegram apps
|
||||||
inline URLs in your caption. Defaults to "Markdown".
|
to show bold, italic, fixed-width text or inline URLs in your caption.
|
||||||
|
Defaults to MARKDOWN.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`pyrogram.Error`
|
:class:`pyrogram.Error`
|
||||||
|
29
pyrogram/client/parse_mode.py
Normal file
29
pyrogram/client/parse_mode.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Pyrogram - Telegram MTProto API Client Library for Python
|
||||||
|
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
|
||||||
|
#
|
||||||
|
# This file is part of Pyrogram.
|
||||||
|
#
|
||||||
|
# Pyrogram is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Lesser General Public License as published
|
||||||
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Pyrogram is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
class ParseMode:
|
||||||
|
"""This class provides a convenient access to parse modes.
|
||||||
|
It is intended to be used with any method that accepts the optional argument **parse_mode**
|
||||||
|
"""
|
||||||
|
|
||||||
|
HTML = "html"
|
||||||
|
"""Set the parse mode to HTML style"""
|
||||||
|
|
||||||
|
MARKDOWN = "markdown"
|
||||||
|
"""Set the parse mode to Markdown style"""
|
Loading…
x
Reference in New Issue
Block a user