New nick env variable

This commit is contained in:
Daniel Odendahl Jr
2017-05-06 05:21:49 +00:00
parent c3d497f772
commit d2b6fca7b4
+6 -3
View File
@@ -28,9 +28,12 @@ module.exports = class CleverbotCommand extends Command {
try {
const { body } = await request
.post('https://cleverbot.io/1.0/ask')
.send({ user: process.env.CLEVS_USER, key: process.env.CLEVS_KEY, text, nick: 'XiaoBot' });
console.log(body.status, body.response, body);
if(body.status !== 'success') throw new Error(body.status);
.send({
user: process.env.CLEVS_USER,
key: process.env.CLEVS_KEY,
nick: process.env.CLEVS_NICK,
text
});
return msg.reply(body.response);
} catch(err) {
return msg.say(`An Error Occurred: ${err}`);