Class: Hipbot::Callbacks::RoomMessage

Inherits:
Message show all
Defined in:
lib/hipbot/callbacks/room_message.rb

Instance Method Summary collapse

Constructor Details

#initialize(room_id, user_name_or_mention, message_body) ⇒ RoomMessage

Returns a new instance of RoomMessage.



4
5
6
7
8
9
10
11
12
# File 'lib/hipbot/callbacks/room_message.rb', line 4

def initialize room_id, user_name_or_mention, message_body
  with_room(id: room_id) do |room|
    with_user_by_name_or_mention(user_name_or_mention) do |user|
      return if ignore_message?(user, message_body)

      Hipbot.react(user, room, message_body)
    end
  end
end