Class: Botkit::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/botkit/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text:, raw: {}, channel_id: nil, command: nil, options: {}, id: nil) ⇒ Message

Returns a new instance of Message.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/botkit/message.rb', line 7

def initialize(
  text:,
  raw: {},
  channel_id: nil,
  command: nil,
  options: {},
  id: nil
)
  @text = text
  @command = command
  @raw = raw
  @channel_id = channel_id
  @options = options
  @id = id
end

Instance Attribute Details

#channel_idObject (readonly)

Returns the value of attribute channel_id.



5
6
7
# File 'lib/botkit/message.rb', line 5

def channel_id
  @channel_id
end

#commandObject (readonly)

Returns the value of attribute command.



5
6
7
# File 'lib/botkit/message.rb', line 5

def command
  @command
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/botkit/message.rb', line 5

def id
  @id
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/botkit/message.rb', line 5

def options
  @options
end

#rawObject (readonly)

Returns the value of attribute raw.



5
6
7
# File 'lib/botkit/message.rb', line 5

def raw
  @raw
end

#textObject (readonly)

Returns the value of attribute text.



5
6
7
# File 'lib/botkit/message.rb', line 5

def text
  @text
end

Instance Method Details

#command?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/botkit/message.rb', line 23

def command?
  command
end