From 9fc87f42be7614b50085a54336b39a98f6b51e18 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Mon, 11 May 2020 20:34:11 +0200 Subject: [PATCH] Cleverbot! Signed-off-by: loicbersier --- commands/fun/cleverbot.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 commands/fun/cleverbot.js diff --git a/commands/fun/cleverbot.js b/commands/fun/cleverbot.js new file mode 100644 index 00000000..4e18d72f --- /dev/null +++ b/commands/fun/cleverbot.js @@ -0,0 +1,34 @@ +const { Command } = require('discord-akairo'); +const cleverbot = require('cleverbot-free'); + +class CleverBotCommand extends Command { + constructor() { + super('CleverBot', { + aliases: ['CleverBot', 'cb'], + category: 'fun', + clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], + args: [ + { + id: 'message', + type: 'string', + prompt: { + start: 'What do you want to say to cleverbot?' + }, + match: 'rest' + }, + ], + description: { + content: 'Talk to cleverbot!', + usage: '', + examples: [''] + } + }); + } + + async exec(message, args) { + cleverbot(args.message).then(response => { + return message.channel.send(response); + }); + } +} +module.exports = CleverBotCommand; \ No newline at end of file