class Nico::Message

Attributes

body[R]

Public Class Methods

new(json) click to toggle source
# File lib/nico/message.rb, line 8
def initialize(json)
  # also available: id, user_id, starred, created_at, type, room_id
  @body = json['body'] || ''
end

Public Instance Methods

relevant?() click to toggle source
# File lib/nico/message.rb, line 13
def relevant?
  @body.start_with? *Nico::ALIASES
end
response() click to toggle source
# File lib/nico/message.rb, line 17
def response
  # This should loop through the regex and respond adequately
  # And one of these regex will add to the regex (and save to github)
  case @body
    when Matchers::DaftPunkMatcher.match then Matchers::DaftPunkMatcher.response
    else "You said #{@body}"
  end
end