|
|
@ -250,7 +250,7 @@ module.exports = { |
|
|
|
async hitokoto() { |
|
|
|
async hitokoto() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
let request = require('request-promise'); |
|
|
|
let request = require('request-promise'); |
|
|
|
return await request({ |
|
|
|
let res = await request({ |
|
|
|
uri: 'http://api.hitokoto.us/rand', |
|
|
|
uri: 'http://api.hitokoto.us/rand', |
|
|
|
timeout: 1500, |
|
|
|
timeout: 1500, |
|
|
|
qs: { |
|
|
|
qs: { |
|
|
@ -259,6 +259,8 @@ module.exports = { |
|
|
|
}, |
|
|
|
}, |
|
|
|
json: true |
|
|
|
json: true |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
if (!res.hitokoto) return null; |
|
|
|
|
|
|
|
else return res; |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|