summaryrefslogtreecommitdiff
path: root/lib/mattermost/command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mattermost/command.rb')
-rw-r--r--lib/mattermost/command.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/mattermost/command.rb b/lib/mattermost/command.rb
index 108a2a47a4b..7d4710bb94d 100644
--- a/lib/mattermost/command.rb
+++ b/lib/mattermost/command.rb
@@ -14,9 +14,13 @@ module Mattermost
icon_url: icon_url
}
- response = post( "/teams/#{team_id}/commands/create", body: command.to_json)
+ post_command(command)['token']
+ end
+
+ private
- response.parsed_response['token']
+ def post_command(command)
+ post( "/teams/#{team_id}/commands/create", body: command.to_json).parsed_response
end
end
end