telegram.ext.Defaults¶
-
class
telegram.ext.
Defaults
(parse_mode: str = None, disable_notification: bool = None, disable_web_page_preview: bool = None, timeout: Union[DefaultValue[DVType], float, None] = None, quote: bool = None, tzinfo: pytz.tzinfo.BaseTzInfo = <UTC>, run_async: bool = False, allow_sending_without_reply: bool = None)¶ Bases:
object
Convenience Class to gather all parameters with a (user defined) default value
Parameters: - parse_mode (
str
, optional) – Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or URLs in your bot’s message. - disable_notification (
bool
, optional) – Sends the message silently. Users will receive a notification with no sound. - disable_web_page_preview (
bool
, optional) – Disables link previews for links in this message. - allow_sending_without_reply (
bool
, optional) – PassTrue
, if the message should be sent even if the specified replied-to message is not found. - timeout (
int
|float
, optional) – If this value is specified, use it as the read timeout from the server (instead of the one specified during creation of the connection pool). - quote (
bool
, optional) – If set toTrue
, the reply is sent as an actual reply to the message. Ifreply_to_message_id
is passed inkwargs
, this parameter will be ignored. Default:True
in group chats andFalse
in private chats. - tzinfo (
tzinfo
, optional) –A timezone to be used for all date(time) inputs appearing throughout PTB, i.e. if a timezone naive date(time) object is passed somewhere, it will be assumed to be in
tzinfo
. Must be a timezone provided by thepytz
module. Defaults to UTC.Note
Will not be used for
telegram.Bot.get_updates()
! - run_async (
bool
, optional) – Default setting for therun_async
parameter of handlers and error handlers registered throughDispatcher.add_handler()
andDispatcher.add_error_handler()
. Defaults toFalse
.
-
parse_mode
¶ Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or URLs in your bot’s message.
Type: str
-
explanation_parse_mode
¶ Optional. Alias for
parse_mode
, used for the corresponding parameter oftelegram.Bot.send_poll()
.Type: str
-
disable_notification
¶ Optional. Sends the message silently. Users will receive a notification with no sound.
Type: bool
-
disable_web_page_preview
¶ Optional. Disables link previews for links in this message.
Type: bool
-
allow_sending_without_reply
¶ Optional. Pass
True
, if the message should be sent even if the specified replied-to message is not found.Type: bool
-
timeout
¶ Optional. If this value is specified, use it as the read timeout from the server (instead of the one specified during creation of the connection pool).
Type: int
|float
-
quote
¶ Optional. If set to
True
, the reply is sent as an actual reply to the message. Ifreply_to_message_id
is passed inkwargs
, this parameter will be ignored. Default:True
in group chats andFalse
in private chats.Type: bool
-
run_async
¶ Optional. Default setting for the
run_async
parameter of handlers and error handlers registered throughDispatcher.add_handler()
andDispatcher.add_error_handler()
.Type: bool
- parse_mode (