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, matches: nil, options: {}) ⇒ Message

Returns a new instance of Message.



7
8
9
10
11
12
13
14
# File 'lib/botkit/message.rb', line 7

def initialize(text:, raw: {}, channel_id: nil, command: nil, matches: nil, options: {})
  @text = text
  @command = command
  @raw = raw
  @channel_id = channel_id
  @options = options
  @matches = matches
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

#matchesObject (readonly)

Returns the value of attribute matches.



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

def matches
  @matches
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)


16
17
18
# File 'lib/botkit/message.rb', line 16

def command?
  command
end