Module: RocketChat::Realtime::Methods::Message

Included in:
Client
Defined in:
lib/rocket_chat/realtime/methods/message.rb

Overview

Message methods

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#send_message(room_id, message) ⇒ Object

Login into server

Parameters:

  • room_id (String)
  • message (String)

Since:

  • 0.1.0



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rocket_chat/realtime/methods/message.rb', line 18

def send_message(room_id, message)
  method = Messages::Method.new(
    'sendMessage',
    {
      rid: room_id,
      msg: message
    }
  )
  AsyncTask.start(method.id) do
    driver.text(method.to_json)
  end
end