       }
 
   match: (input) ->
-    @log "match:", input
+    @log 'match:', input
     Giphy.regex.exec input or ''
 
   getEndpoint: (state) ->
-    @log "getEndpoint:", state
+    @log 'getEndpoint:', state
     match = @match state.input
 
     if match


  # rating, limit, offset, api
  getOptions: (state) ->
    @log "getOptions:", state
    state.options = {}
    while @getNextOption state
      null

        rating: process.env.HUBOT_GIPHY_DEFAULT_RATING
      }, state.options
      @api.search options, (err, res) =>
        @handleResponse state, err, => @getRandomResult(res.data, @getUriFromResult)
    else
      @getRandomUri state

  getIdUri: (state) ->
    @log 'getIdUri:', state
    if state.args and state.args.length > 0
      ids = state.args.split(' ').map(x -> x.trim())
      @api.id ids, (err, res) =>
        @handleResponse state, err, => @getRandomResult(res.data, @getUriFromResult)
    else
      @error state.msg, 'No Id Provided'

  getTranslateUri: (state) ->
    @log 'getTranslateUri:', state
    options = merge {
      s: state.args,
      rating: process.env.HUBOT_GIPHY_DEFAULT_RATING
    }, state.options
    @api.translate options, (err, res) =>
      @handleResponse state, err, => @getRandomResult(res.data, @getUriFromResult)

  getRandomUri: (state) ->
    @log 'getRandomUri:', state
    options = merge {
      tag: state.args,
      rating: process.env.HUBOT_GIPHY_DEFAULT_RATING
    }, state.options
    @api.random options, (err, res) =>
      console.log err, res
      @handleResponse state, err, -> @getRandomResult(res.data, @getUriFromResult)

  getTrendingUri: (state) ->
    @log 'getTrendingUri:', state
    options = merge {
      limit: process.env.HUBOT_GIPHY_DEFAULT_LIMIT
      rating: process.env.HUBOT_GIPHY_DEFAULT_RATING
    }, state.options
    @api.trending options, (err, res) =>
      @handleResponse state, err, => @getRandomResult(res.data, @getUriFromResult)

  getHelp: (state) ->

  getUri: (state) ->
    @log 'getUri:', state
    switch state.endpoint
      when Giphy.SearchEndpointName then @getSearchUri state
      when Giphy.IdEndpointName then @getIdUri state
