diff --git a/Xiao.js b/Xiao.js index a9b0df86..3bbf9c64 100644 --- a/Xiao.js +++ b/Xiao.js @@ -158,10 +158,9 @@ client.on('message', async msg => { // Cleverbot handler const cleverbot = client.cleverbots.get(msg.channel.id); if (cleverbot && cleverbot.active) { - if (!hasText) return; if (!cleverbot.shouldRespond(msg)) return; const response = await cleverbot.respond(msg.cleanContent); - await msg.reply(response); + await msg.channel.send(response); return; } diff --git a/structures/Cleverbot.js b/structures/Cleverbot.js index f8a7c414..8ae9e591 100644 --- a/structures/Cleverbot.js +++ b/structures/Cleverbot.js @@ -15,6 +15,11 @@ module.exports = class Cleverbot { } async respond(input) { + if (!input) { + clearTimeout(this.timeout); + this.timeout = this.setTimeout(); + return blankResponses[Math.floor(Math.random() * blankResponses.length)]; + } const { body } = await request .get('https://www.cleverbot.com/getreply') .query({