Class: MTProto::TL::SetBotGuestChatResult
- Inherits:
-
Object
- Object
- MTProto::TL::SetBotGuestChatResult
- Includes:
- Binary
- Defined in:
- lib/mtproto/tl/objects/set_bot_guest_chat_result.rb
Overview
messages.setBotGuestChatResult#b8f106e3 query_id:long result:InputBotInlineResult
= InputBotInlineMessageID
How a guest-mode bot answers an updateBotGuestChatQuery: the reply text is wrapped in inputBotInlineResult(type “article”) -> inputBotInlineMessageText, and the server posts that message into the guest chat. Text-only for now (no media / buttons).
Constant Summary collapse
- CONSTRUCTOR =
0xb8f106e3- INPUT_BOT_INLINE_RESULT =
inputBotInlineResult
0x88bf9319- INPUT_BOT_INLINE_MESSAGE_TEXT =
inputBotInlineMessageText
0x3dcd7a87
Instance Method Summary collapse
-
#initialize(query_id:, message:, result_id: nil, result_type: 'article', result_title: nil) ⇒ SetBotGuestChatResult
constructor
A new instance of SetBotGuestChatResult.
- #serialize ⇒ Object
Methods included from Binary
#b_u32, #b_u64, #u32_b, #u64_b
Constructor Details
#initialize(query_id:, message:, result_id: nil, result_type: 'article', result_title: nil) ⇒ SetBotGuestChatResult
Returns a new instance of SetBotGuestChatResult.
19 20 21 22 23 24 25 26 27 |
# File 'lib/mtproto/tl/objects/set_bot_guest_chat_result.rb', line 19 def initialize(query_id:, message:, result_id: nil, result_type: 'article', result_title: nil) @query_id = query_id @message = @result_id = result_id || SecureRandom.hex(8) @result_type = result_type # The "article" result type requires a non-empty title (the server rejects an # empty one with ARTICLE_TITLE_EMPTY); the actual reply shown is send_message. @result_title = result_title || end |
Instance Method Details
#serialize ⇒ Object
29 30 31 32 33 34 |
# File 'lib/mtproto/tl/objects/set_bot_guest_chat_result.rb', line 29 def serialize result = u32_b(CONSTRUCTOR) result += u64_b(@query_id) result += serialize_result result end |