mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
New nick env variable
This commit is contained in:
@@ -28,9 +28,12 @@ module.exports = class CleverbotCommand extends Command {
|
|||||||
try {
|
try {
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.post('https://cleverbot.io/1.0/ask')
|
.post('https://cleverbot.io/1.0/ask')
|
||||||
.send({ user: process.env.CLEVS_USER, key: process.env.CLEVS_KEY, text, nick: 'XiaoBot' });
|
.send({
|
||||||
console.log(body.status, body.response, body);
|
user: process.env.CLEVS_USER,
|
||||||
if(body.status !== 'success') throw new Error(body.status);
|
key: process.env.CLEVS_KEY,
|
||||||
|
nick: process.env.CLEVS_NICK,
|
||||||
|
text
|
||||||
|
});
|
||||||
return msg.reply(body.response);
|
return msg.reply(body.response);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
return msg.say(`An Error Occurred: ${err}`);
|
return msg.say(`An Error Occurred: ${err}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user