Skip to content

Commit

Permalink
chore(script): Upgrade script to node-kitsu 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lgaticaq committed May 11, 2017
1 parent 4582a53 commit 11cc46d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/script.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ icon = "https://kitsu.io/favicon-32x32-3e0ecb6fc5a6ae681e65dcbc2bdf1f17.png"
module.exports = (robot) ->
robot.respond /kitsu (.+)$/, (res) ->
query = res.match[1]
kitsu.searchAnime query, 0, (err, results) ->
if err
robot.emit("error", err)
res.send("An error has occurred: #{err.message}")
return
kitsu.searchAnime(query, 0).then (results) ->
if results.length is 0
res.send("Not found *#{query}*")
return
Expand Down Expand Up @@ -117,3 +113,7 @@ module.exports = (robot) ->
res.message.room, null, options)
else
res.send(text)
.catch (err) ->
robot.emit("error", err)
res.send("An error has occurred: #{err.message}")
return

0 comments on commit 11cc46d

Please sign in to comment.