Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# SwitchInlineQueryChosenChat

class telegram.SwitchInlineQueryChosenChat(query=None, allow_user_chats=None, allow_bot_chats=None, allow_group_chats=None, allow_channel_chats=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `query`, `allow_user_chats`, `allow_bot_chats`, `allow_group_chats`, and `allow_channel_chats` are equal.

  Available In

  `telegram.InlineKeyboardButton.switch_inline_query_chosen_chat`

  Added in version 20.3.

  Caution

  The PTB team has discovered that you must pass at least one of `allow_user_chats`, `allow_bot_chats`, `allow_group_chats`, or `allow_channel_chats` to Telegram. Otherwise, an error will be raised.

  Parameters:

    - query (`str`, optional) – The default inline query to be inserted in the input field. If left empty, only the bot’s username will be inserted.

    - allow_user_chats (`bool`, optional) – Pass `True`, if private chats with users can be chosen.

    - allow_bot_chats (`bool`, optional) – Pass `True`, if private chats with bots can be chosen.

    - allow_group_chats (`bool`, optional) – Pass `True`, if group and supergroup chats can be chosen.

    - allow_channel_chats (`bool`, optional) – Pass `True`, if channel chats can be chosen.

  query

    Optional. The default inline query to be inserted in the input field. If left empty, only the bot’s username will be inserted.

    Type:

      `str`

  allow_user_chats

    Optional. `True`, if private chats with users can be chosen.

    Type:

      `bool`

  allow_bot_chats

    Optional. `True`, if private chats with bots can be chosen.

    Type:

      `bool`

  allow_group_chats

    Optional. `True`, if group and supergroup chats can be chosen.

    Type:

      `bool`

  allow_channel_chats

    Optional. `True`, if channel chats can be chosen.

    Type:

      `bool`