Documentation - v0.27.1
    Preparing search index...

    Function openWebview

    • Open a webview.

      Parameters

      • client: ITelegramClient
      • params: {
            bot: InputPeerLike;
            chat?: InputPeerLike;
            platform:
                | string & {}
                | "android"
                | "ios"
                | "tdesktop"
                | "macos"
                | "unigram";
            theme?: | RawDataJSON
            | {
                accent_text_color?: string;
                bg_color?: string;
                button_color?: string;
                button_text_color?: string;
                destructive_text_color?: string;
                header_bg_color?: string;
                hint_color?: string;
                link_color?: string;
                secondary_bg_color?: string;
                section_bg_color?: string;
                section_header_text_color?: string;
                section_separator_color?: string;
                subtitle_text_color?: string;
                text_color?: string;
            };
            webview: InputWebview;
        }
        • bot: InputPeerLike

          Bot whose webview to open

        • Optionalchat?: InputPeerLike

          Chat to report to the server as the "currently open chat", also the chat to which the message will be sent in case of from_inline_keyboard, from_bot_menu and from_attach_menu webviews

        • platform: string & {} | "android" | "ios" | "tdesktop" | "macos" | "unigram"

          Webview platform to use in the init data

          Some of the known values:

          • android - Android clients
          • ios - iOS clients
          • tdesktop - Telegram Desktop
          • macos - Telegram for macOS
          • unigram - Unigram
        • Optionaltheme?:
              | RawDataJSON
              | {
                  accent_text_color?: string;
                  bg_color?: string;
                  button_color?: string;
                  button_text_color?: string;
                  destructive_text_color?: string;
                  header_bg_color?: string;
                  hint_color?: string;
                  link_color?: string;
                  secondary_bg_color?: string;
                  section_bg_color?: string;
                  section_header_text_color?: string;
                  section_separator_color?: string;
                  subtitle_text_color?: string;
                  text_color?: string;
              }

          Theme parameters to pass to the mini app

          Each value should be a string (hex-encoded RGB, no alpha)

        • webview: InputWebview

          Information about the webview to open

      Returns Promise<WebviewResult>