Fix bug in portal, cleverbot group

This commit is contained in:
Dragon Fire
2021-04-18 08:33:03 -04:00
parent c6996cccdf
commit 09924d6973
5 changed files with 16 additions and 14 deletions
@@ -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: [
+1 -1
View File
@@ -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...');