telegram.ext.Defaults¶
-
class
telegram.ext.Defaults(parse_mode=None, disable_notification=None, disable_web_page_preview=None, timeout=None, quote=None, tzinfo=<UTC>, run_async=False, allow_sending_without_reply=None)¶ Bases:
objectConvenience 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_idis passed inkwargs, this parameter will be ignored. Default:Truein group chats andFalsein 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 thepytzmodule. Defaults to UTC.Note
Will not be used for
telegram.Bot.get_updates()!run_async (
bool, optional) – Default setting for therun_asyncparameter 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_idis passed inkwargs, this parameter will be ignored. Default:Truein group chats andFalsein private chats.- Type
bool
-
run_async¶ Optional. Default setting for the
run_asyncparameter of handlers and error handlers registered throughDispatcher.add_handler()andDispatcher.add_error_handler().- Type
bool