Class: MTProto::TL::EditMessage
- Inherits:
-
Object
- Object
- MTProto::TL::EditMessage
- Includes:
- Binary
- Defined in:
- lib/mtproto/tl/objects/edit_message.rb
Instance Method Summary collapse
-
#initialize(peer:, id:, message:, entities: nil, reply_markup: nil, no_webpage: false) ⇒ EditMessage
constructor
A new instance of EditMessage.
- #serialize ⇒ Object
Methods included from Binary
#b_u32, #b_u64, #u32_b, #u64_b
Constructor Details
#initialize(peer:, id:, message:, entities: nil, reply_markup: nil, no_webpage: false) ⇒ EditMessage
Returns a new instance of EditMessage.
10 11 12 13 14 15 16 17 |
# File 'lib/mtproto/tl/objects/edit_message.rb', line 10 def initialize(peer:, id:, message:, entities: nil, reply_markup: nil, no_webpage: false) @peer = peer @id = id @message = @entities = entities @reply_markup = reply_markup @no_webpage = no_webpage end |
Instance Method Details
#serialize ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/mtproto/tl/objects/edit_message.rb', line 19 def serialize flags = 1 << 11 flags |= (1 << 1) if @no_webpage flags |= (1 << 2) if @reply_markup flags |= (1 << 3) if entities? result = u32_b(Constructors::MESSAGES_EDIT_MESSAGE) result += u32_b(flags) result += serialize_input_peer result += u32_b(@id) result += serialize_tl_string(@message) result += @reply_markup.serialize if @reply_markup result += MessageEntities.serialize(@entities) if entities? result end |