diff --git a/scripts/shortener.coffee b/scripts/shortener.coffee index fc5d8fc..451d5cb 100644 --- a/scripts/shortener.coffee +++ b/scripts/shortener.coffee @@ -1,5 +1,5 @@ # Description: -# Accorcia un link usando l'api di breve.xyz +# Accorcia un link usando l'api di brve.bit # # Dependencies: # valid-url @@ -25,7 +25,8 @@ module.exports = (robot) -> robot.respond /breve|accorcia (.+)$/i, (res) -> url = res.match[1] 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 else - res.send res.random invalid \ No newline at end of file + res.send res.random invalid