From 91c37247d3e4cd50fe27215f03ec7d6b185ec35e Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Sun, 27 Feb 2022 22:13:35 -0700 Subject: [PATCH] fix ar --- commands/fun/rp.js | 2 +- events/messageCreate.js | 2 +- util/response/filterresponse.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/fun/rp.js b/commands/fun/rp.js index 875dac9..33f0d08 100644 --- a/commands/fun/rp.js +++ b/commands/fun/rp.js @@ -71,7 +71,7 @@ module.exports = { let n = message.member ? message.member.displayName : message.author.username; return message.channel.send({embeds: [new Discord.MessageEmbed() .setAuthor({name: `${n}${n.endsWith('s') ? "'" : "'s"} RP Characters`, iconURL: (message.member || message.author).displayAvatarURL({dynamic: true})}) - .setDescription(Object.keys(rp.chars).map(ch => `\`${ch}\`: ${rp.chars[ch].name}`).join(',')) + .setDescription(Object.keys(rp.chars).map(ch => `\`${ch}\`: ${rp.chars[ch].name}`).join(', ')) .setColor('c375f0') .setFooter({text: "Natsuki"}) .setTimestamp() diff --git a/events/messageCreate.js b/events/messageCreate.js index cadad37..a109006 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -94,7 +94,7 @@ module.exports = async (client, message) => { if (message.guild && client.misc.cache.ar.has(message.guild.id) && client.misc.cache.ar.get(message.guild.id).includes(msg.trim()) && !(client.misc.cache.arIgnore.has(message.guild.id) && client.misc.cache.arIgnore.get(message.guild.id).includes(message.channel.id))) { AR.findOne({gid: message.guild.id}).then(ar => { - if (ar && ar.triggers.length && ar.triggers.includes(msg.trim())) {return message.channel.send(require('../util/response/filterresponse')(message.member, client, ar.ars[ar.triggers.indexOf(msg.trim())])).catch(() => {});} + if (ar && ar.triggers.length && ar.triggers.includes(msg.trim())) {return require('../util/response/filterresponse')(message.member, client, ar.ars[ar.triggers.indexOf(msg.trim())]).then(t => message.channel.send(t).catch(() => {})).catch(() => {});} }); } diff --git a/util/response/filterresponse.js b/util/response/filterresponse.js index cce7824..815b0a8 100644 --- a/util/response/filterresponse.js +++ b/util/response/filterresponse.js @@ -1,8 +1,9 @@ module.exports = async (member, client, text) => { + const go = await member.guild.fetchOwner(); text = text .replace(/(?:{{member}}|{{m}})/gm, member.displayName) .replace(/(?:{{membercount}}|{{mc}})/gm, `${member.guild.members.cache.size}`) - .replace(/(?:{{owner}}|{{o}})/gm, member.guild.fetchOwner().then(owner => owner.displayName)) + .replace(/(?:{{owner}}|{{o}})/gm, go.displayName) .replace(/(?:{{ping}}|{{mp}}|{{memberping}}|{{p}})/gm, `<@${member.id}>`) .replace(/(?:{{s}}|{{server}}|{{servername}}|{{sn}})/gm, member.guild.name) .replace(/{{n}}/gm, '\n')