How to use multi prefix in this code? I have tried various ways but nothing works.
let prefix = [ 'e', 'E' ];
if (message.guild) {
client.prefixes.ensure(message.guild.id, { prefix: 'e' });
let guildPrefix = client.prefixes.get(message.guild.id, "e");
prefix = guildPrefix ? guildPrefix : 'e';
}
if(!(message.content.startsWith(prefix[0])||message.content.startsWith(prefix[1]))) { return; }
const args = message.content.slice(prefix.length).trim().split(/ +/);
This is the code, its not work, i dont know why? can u help me guys? i use discord.js v13
if(!(message.content.startsWith(prefix[0])||message.content.startsWith(prefix[1]))) { return; }
It will not start with an array, so you have to split the condition. However there might be a more elegant solution to this.
Edit: The elegant solution is in the comments.