master
Kit Kasune 3 years ago
parent c7b9e5d9d8
commit 91c37247d3
  1. 2
      events/messageCreate.js
  2. 3
      util/response/filterresponse.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))) { 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 => { 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(() => {});}
}); });
} }

@ -1,8 +1,9 @@
module.exports = async (member, client, text) => { module.exports = async (member, client, text) => {
const go = await member.guild.fetchOwner();
text = text text = text
.replace(/(?:{{member}}|{{m}})/gm, member.displayName) .replace(/(?:{{member}}|{{m}})/gm, member.displayName)
.replace(/(?:{{membercount}}|{{mc}})/gm, `${member.guild.members.cache.size}`) .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(/(?:{{ping}}|{{mp}}|{{memberping}}|{{p}})/gm, `<@${member.id}>`)
.replace(/(?:{{s}}|{{server}}|{{servername}}|{{sn}})/gm, member.guild.name) .replace(/(?:{{s}}|{{server}}|{{servername}}|{{sn}})/gm, member.guild.name)
.replace(/{{n}}/gm, '\n') .replace(/{{n}}/gm, '\n')

Loading…
Cancel
Save