Heavy work on the image detection code, fixed mention prefixes not being properly registered

This commit is contained in:
TheEssem 2020-10-18 16:53:35 -05:00
parent 6cd9878632
commit cf5c649384
57 changed files with 240 additions and 443 deletions

View file

@ -25,7 +25,8 @@ module.exports = async (message) => {
// prefix can be a mention or a set of special characters
const guildDB = message.channel.guild ? await database.guilds.findOne({ id: message.channel.guild.id }).lean().exec() : null;
const prefix = message.channel.guild ? (message.content.startsWith(message.channel.guild.members.get(client.user.id).mention) ? `${message.channel.guild.members.get(client.user.id).mention} ` : guildDB.prefix) : "";
// there's a bit of a workaround here due to member.mention not accounting for both mention types
const prefix = message.channel.guild ? (message.content.startsWith(message.channel.guild.members.get(client.user.id).mention) ? `${message.channel.guild.members.get(client.user.id).mention} ` : (message.content.startsWith(`<@${client.user.id}>`) ? `<@${client.user.id}> ` : guildDB.prefix)) : "";
// ignore other stuff
if (message.content.startsWith(prefix) === false) return;