lib/rocket_chat/messages/chat.rb in rocketchat-0.1.8 vs lib/rocket_chat/messages/chat.rb in rocketchat-0.1.9

- old
+ new

@@ -20,11 +20,11 @@ # @param [String] msg_id The message id to delete # @param [Boolean] as_user Message deleted as user who sent (optional - default: false) # @return [Boolean] # @raise [HTTPError, StatusError] # - def delete(room_id: nil, name: nil, msg_id:, as_user: nil) + def delete(room_id: nil, name: nil, msg_id: nil, as_user: nil) session.request_json( '/api/v1/chat.delete', method: :post, body: room_params(room_id, name).tap do |h| @@ -38,11 +38,11 @@ # chat.getMessage REST API # @param [String] msg_id The message id to return # @return [RocketChat::Message] # @raise [HTTPError, StatusError] # - def get_message(msg_id:) + def get_message(msg_id: nil) response = session.request_json( '/api/v1/chat.getMessage', body: { msgId: msg_id } ) RocketChat::Message.new response['message'] if response['success'] @@ -55,11 +55,11 @@ # @param [String] channel Rocket.Chat channel name # @param [Hash] params Optional params (text, alias, emoji, avatar & attachments) # @return [RocketChat::Message] # @raise [HTTPError, StatusError] # - def post_message(room_id: nil, name: nil, channel:, **params) + def post_message(room_id: nil, name: nil, channel: nil, **params) response = session.request_json( '/api/v1/chat.postMessage', method: :post, body: room_params(room_id, name) .merge(channel: channel) @@ -75,10 +75,10 @@ # @param [String] msg_id The message id to update # @param [String] text Updated text for the message # @return [RocketChat::Message] # @raise [HTTPError, StatusError] # - def update(room_id: nil, name: nil, msg_id:, text:) + def update(room_id: nil, name: nil, msg_id: nil, text: nil) response = session.request_json( '/api/v1/chat.update', method: :post, body: room_params(room_id, name).merge(msgId: msg_id, text: text) )