mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 22:34:46 +02:00
Fix bug in portal, cleverbot group
This commit is contained in:
@@ -5,7 +5,7 @@ module.exports = class CleverbotEndCommand extends Command {
|
||||
super(client, {
|
||||
name: 'cleverbot-end',
|
||||
aliases: ['clevs-end', 'chat-end'],
|
||||
group: 'other',
|
||||
group: 'cleverbot',
|
||||
memberName: 'cleverbot-end',
|
||||
description: 'Ends the current Cleverbot chat.'
|
||||
});
|
||||
@@ -14,6 +14,7 @@ module.exports = class CleverbotEndCommand extends Command {
|
||||
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.`);
|
||||
}
|
||||
@@ -7,7 +7,7 @@ module.exports = class CleverbotCommand extends Command {
|
||||
super(client, {
|
||||
name: 'cleverbot',
|
||||
aliases: ['clevs', 'chat'],
|
||||
group: 'other',
|
||||
group: 'cleverbot',
|
||||
memberName: 'cleverbot',
|
||||
description: 'Starts a Cleverbot conversation.',
|
||||
credit: [
|
||||
@@ -39,7 +39,7 @@ module.exports = class PortalSendCommand extends Command {
|
||||
channel => channel.guild && channel.topic && channel.topic.includes('<xiao:portal>')
|
||||
);
|
||||
if (msg.guild) channels = channels.filter(channel => !msg.guild.channels.cache.has(channel.id));
|
||||
if (message.toLowerCase() === 'count') {
|
||||
if (message && message.toLowerCase() === 'count') {
|
||||
return msg.say(`**${this.portalEmoji} ${channels.size}** currently open portals.`);
|
||||
}
|
||||
if (!channels.size) return msg.reply('No channels have an open portal...');
|
||||
|
||||
Reference in New Issue
Block a user