summaryrefslogtreecommitdiff
path: root/lib/mattermost/command.rb
blob: afbf2ce3349f393a31a1791e84828f405575e9d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Mattermost
  class Command
    def self.create(session, team_id, command)
      response = session.post("/api/v3/teams/#{team_id}/commands/create", body: command.to_json).parsed_response

      if response.has_key?('message')
        response
      else
        response['token']
      end
    end
  end
end