update breve url

This commit is contained in:
rnhmjoj 2017-02-22 22:12:06 +01:00
parent 7c0f760a51
commit 0d4c48874b

View File

@ -1,5 +1,5 @@
# Description: # Description:
# Accorcia un link usando l'api di breve.xyz # Accorcia un link usando l'api di brve.bit
# #
# Dependencies: # Dependencies:
# valid-url # valid-url
@ -25,7 +25,8 @@ module.exports = (robot) ->
robot.respond /breve|accorcia (.+)$/i, (res) -> robot.respond /breve|accorcia (.+)$/i, (res) ->
url = res.match[1] url = res.match[1]
if is_web_uri url if is_web_uri url
ne.post 'https://breve.xyz/api', url: url, (err, resp, body) => ne.post 'https://brve.bit/api', url: url, {rejectUnauthorized: false}, (err, resp, body) =>
return res.send "c'è qualche problema: #{err}" if err
res.send (res.random valid) + body.link res.send (res.random valid) + body.link
else else
res.send res.random invalid res.send res.random invalid