Defaults¶
- class telegram.ext.Defaults(parse_mode=None, disable_notification=None, disable_web_page_preview=None, quote=None, tzinfo=datetime.timezone.utc, block=True, allow_sending_without_reply=None, protect_content=None)[source]¶
Bases:
object
Convenience Class to gather all parameters with a (user defined) default value
Changed in version 20.0: Removed the argument and attribute
timeout
. Specify default timeout behavior for the networking backend directly viatelegram.ext.ApplicationBuilder
instead.- Parameters:
parse_mode (
str
, optional) – Mode for parsing entities. Seetelegram.constants.ParseMode
and formatting options for more details.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.quote (
bool
, optional) – If set toTrue
, the reply is sent as an actual reply to the message. Ifreply_to_message_id
is passed, this parameter will be ignored. Default:True
in group chats andFalse
in private chats.tzinfo (
datetime.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
. If thetelegram.ext.JobQueue
is used, this must be a timezone provided by thepytz
module. Defaults topytz.utc
, if available, anddatetime.timezone.utc
otherwise.block (
bool
, optional) – Default setting for theBaseHandler.block
parameter of handlers and error handlers registered throughApplication.add_handler()
andApplication.add_error_handler()
. Defaults toTrue
.protect_content (
bool
, optional) –Protects the contents of the sent message from forwarding and saving.
New in version 20.0.
- property allow_sending_without_reply[source]¶
Optional. Pass
True
, if the message should be sent even if the specified replied-to message is not found.- Type:
- property block[source]¶
Optional. Default setting for the
BaseHandler.block
parameter of handlers and error handlers registered throughApplication.add_handler()
andApplication.add_error_handler()
.- Type:
- property disable_notification[source]¶
Optional. Sends the message silently. Users will receive a notification with no sound.
- Type:
- property disable_web_page_preview[source]¶
Optional. Disables link previews for links in this message.
- Type:
- property explanation_parse_mode[source]¶
Optional. Alias for
parse_mode
, used for the corresponding parameter oftelegram.Bot.send_poll()
.- Type:
- property parse_mode[source]¶
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:
- property protect_content[source]¶
Optional. Protects the contents of the sent message from forwarding and saving.
New in version 20.0.
- Type: