Class: TD::Types::InternalLinkType::AttachmentMenuBot

Inherits:
TD::Types::InternalLinkType show all
Defined in:
lib/tdlib/types/internal_link_type/attachment_menu_bot.rb

Overview

The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to

attachment menu.

Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn’t added to attachment menu, then show a disclaimer about Mini Apps being third-party applications,

ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu.

If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can’t be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL.

Instance Attribute Summary collapse

Method Summary

Methods inherited from Base

#to_hash, #to_json

Instance Attribute Details

#bot_usernameTD::Types::String

Username of the bot.

Returns:

  • (TD::Types::String)

    the current value of bot_username



16
17
18
# File 'lib/tdlib/types/internal_link_type/attachment_menu_bot.rb', line 16

def bot_username
  @bot_username
end

#target_chatTD::Types::TargetChat

Target chat to be opened.

Returns:



16
17
18
# File 'lib/tdlib/types/internal_link_type/attachment_menu_bot.rb', line 16

def target_chat
  @target_chat
end

#urlTD::Types::String

URL to be passed to openWebApp.

Returns:

  • (TD::Types::String)

    the current value of url



16
17
18
# File 'lib/tdlib/types/internal_link_type/attachment_menu_bot.rb', line 16

def url
  @url
end