mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
21 lines
669 B
JavaScript
21 lines
669 B
JavaScript
const Command = require('../../framework/Command');
|
|
|
|
module.exports = class CleverbotEndCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'cleverbot-end',
|
|
aliases: ['clevs-end', 'chat-end', 'end'],
|
|
group: 'cleverbot',
|
|
description: 'Ends the current Cleverbot chat.'
|
|
});
|
|
}
|
|
|
|
run(msg) {
|
|
const cleverbot = this.client.cleverbots.get(msg.channel.id);
|
|
if (!cleverbot) return msg.say('There is not a Cleverbot conversation in this channel.');
|
|
clearTimeout(cleverbot.timeout);
|
|
this.client.cleverbots.delete(msg.channel.id);
|
|
return msg.reply(`Ended the current conversation. Chatted **${cleverbot.interactions}** times.`);
|
|
}
|
|
};
|