Method: ChatBot#on_message

Defined in:
lib/chatx/hooks.rb

#on_message(room_id) ⇒ Object

A simpler syntax for creating #add_hook to the “Message Posted” event.

Parameters:

  • room_id (#to_i)

    The room to listen in

See Also:



55
56
57
# File 'lib/chatx/hooks.rb', line 55

def on_message(room_id)
  add_hook(room_id, 'Message Posted') { |e| yield(e.hash['content']) }
end