I want to create a 'prefix changer' command. I want the bot to store whatever the user writes after the command into a variable.
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
client.on('ready', () => {
console.log('Bot Online');
});
var prefix = "!"
client.on(`message`, message => {
if (message.content === prefix + `ping`) {
message.channel.send("Pong! 🏓");
}
if (message.content === prefix + `help`) {
message.channel.send('COMMANDS LIST:\n**' + prefix + 'ping** - Pong!');
}
if (message.mentions.has(client.user.id)) {
message.channel.send("Why you ping me??");
}
if(message.content.startsWith(prefix + `prefix`))
{
prefix = //message after '!prefix'
message.channel.send("Prefix has now been updated to " + prefix)
}
});
client.login('BOT-TOKEN');