Fix mention prefix bug

This commit is contained in:
Essem 2022-03-19 23:20:42 -05:00
parent ecf683e279
commit 9e64dfa3c3
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -50,7 +50,7 @@ export default async (client, cluster, worker, ipc, message) => {
if (!message.content.startsWith(prefix)) return; if (!message.content.startsWith(prefix)) return;
// separate commands and args // separate commands and args
const replace = isMention ? `@${client.user.username} ` : prefix; const replace = isMention ? `@${(message.channel.guild ? message.channel.guild.members.get(client.user.id).nick : client.user.username) ?? client.user.username} ` : prefix;
const content = message.cleanContent.substring(replace.length).trim(); const content = message.cleanContent.substring(replace.length).trim();
const rawContent = message.content.substring(prefix.length).trim(); const rawContent = message.content.substring(prefix.length).trim();
const preArgs = content.split(/\s+/g); const preArgs = content.split(/\s+/g);