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:
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).
Note
Will not be used for
telegram.Bot.get_updates()
!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 intzinfo
. Must be a timezone provided by thepytz
module. Defaults to UTC.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
.
-
property
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
-
property
disable_notification
¶ Optional. Sends the message silently. Users will receive a notification with no sound.
- Type
bool
-
property
disable_web_page_preview
¶ Optional. Disables link previews for links in this message.
- Type
bool
-
property
explanation_parse_mode
¶ Optional. Alias for
parse_mode
, used for the corresponding parameter oftelegram.Bot.send_poll()
.- Type
str
-
property
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
-
property
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
-
property
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
-
property
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