mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Cleverbot
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const request = require('superagent');
|
||||
|
||||
module.exports = class CleverbotCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'cleverbot',
|
||||
aliases: [
|
||||
'clevs',
|
||||
'chat'
|
||||
],
|
||||
group: 'random',
|
||||
memberName: 'cleverbot',
|
||||
description: 'Talk to Cleverbot.',
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What would you like to say to Cleverbot?',
|
||||
type: 'string',
|
||||
parse: text => encodeURIComponent(text)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { text } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
.post('https://cleverbot.io/1.0/ask')
|
||||
.send({ user: process.env.CLEVS_USER, key: process.env.CLEVS_KEY, text });
|
||||
if(body.status !== 'success') throw new Error(body.status);
|
||||
return msg.reply(body.response);
|
||||
} catch(err) {
|
||||
return msg.say(`An Error Occurred: ${err}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -84,7 +84,8 @@ module.exports = class InfoCommand extends Command {
|
||||
[SoundCloud](https://developers.soundcloud.com/),
|
||||
[random.cat](http://random.cat/),
|
||||
[random.dog](https://random.dog/),
|
||||
[fixer.io](http://fixer.io/)
|
||||
[fixer.io](http://fixer.io/),
|
||||
[cleverbot.io](https://cleverbot.io/)
|
||||
`
|
||||
);
|
||||
return msg.embed(embed);
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
<li><a href="http://random.cat/">random.cat</a></li>
|
||||
<li><a href="https://random.dog/">random.dog</a></li>
|
||||
<li><a href="http://fixer.io/">fixer.io</a></li>
|
||||
<li><a href="https://cleverbot.io/">cleverbot.io</a></li>
|
||||
</ul>
|
||||
<h2>Information</h2>
|
||||
<ul>
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<li>YuGiOh! Card Data</li>
|
||||
</ul>
|
||||
<li>LMGTFY Link Generation!</li>
|
||||
<li>Cleverbot!</li>
|
||||
<li>Binary, Morse, Pirate, and Temmie Translators!</li>
|
||||
<li>Cowsay, Embed, Reverse, Zalgo, and Upside Down Text!</li>
|
||||
<li>Customizable Prefix!</li>
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
<li>YuGiOh! Card Data</li>
|
||||
</ul>
|
||||
<li>LMGTFY Link Generation!</li>
|
||||
<li>Cleverbot!</li>
|
||||
<li>Binary, Morse, Pirate, and Temmie Translators!</li>
|
||||
<li>Cowsay, Embed, Reverse, Zalgo, and Upside Down Text!</li>
|
||||
<li>Customizable Prefix!</li>
|
||||
@@ -95,6 +96,7 @@
|
||||
<li><a href="http://random.cat/">random.cat</a></li>
|
||||
<li><a href="https://random.dog/">random.dog</a></li>
|
||||
<li><a href="http://fixer.io/">fixer.io</a></li>
|
||||
<li><a href="https://cleverbot.io/">cleverbot.io</a></li>
|
||||
</ul>
|
||||
<h2>Information</h2>
|
||||
<ul>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "18.3.1",
|
||||
"version": "18.4.0",
|
||||
"description": "A Discord Bot",
|
||||
"main": "shardingmanager.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user