Class: Telegram::Message

Inherits:
Struct
  • Object
show all
Defined in:
lib/telegram/events.rb

Overview

Message object belong to Event class instance

See Also:

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Attribute Details

#fromTelegramContact

Returns The sender of the message.

Returns:



55
56
57
# File 'lib/telegram/events.rb', line 55

def from
  @from
end

#from_typeString

Returns The type of the sender.

Returns:

  • (String)

    The type of the sender



55
56
57
# File 'lib/telegram/events.rb', line 55

def from_type
  @from_type
end

#idNumber

Returns Message Identifier.

Returns:

  • (Number)

    Message Identifier



55
56
57
# File 'lib/telegram/events.rb', line 55

def id
  @id
end

#raw_fromString

Returns Raw identifier string of the sender.

Returns:

  • (String)

    Raw identifier string of the sender



55
56
57
# File 'lib/telegram/events.rb', line 55

def raw_from
  @raw_from
end

#raw_toString

Returns Raw identifier string of the receiver.

Returns:

  • (String)

    Raw identifier string of the receiver



55
56
57
# File 'lib/telegram/events.rb', line 55

def raw_to
  @raw_to
end

#textString

Returns The text of the message.

Returns:

  • (String)

    The text of the message



55
56
57
# File 'lib/telegram/events.rb', line 55

def text
  @text
end

#toTelegramChat, TelegramContact

Returns:

  • (TelegramChat)

    If you receive a message in the chat group

  • (TelegramContact)

    If you receive a message in the chat with one contact



55
56
57
# File 'lib/telegram/events.rb', line 55

def to
  @to
end

#to_typeString

Returns The type of the receiver.

Returns:

  • (String)

    The type of the receiver



55
56
57
# File 'lib/telegram/events.rb', line 55

def to_type
  @to_type
end

#typeString

Returns The type of the message (either of text, photo, video or etc).

Returns:

  • (String)

    The type of the message (either of text, photo, video or etc)



55
56
57
# File 'lib/telegram/events.rb', line 55

def type
  @type
end