Answer the question
In order to leave comments, you need to log in
I can't understand the bot prefix (code written in discord.js)?
I wanted to make a music bot but failed with discord.py so I wanted to try with discord.js and I did but I can't figure out the bot prefix. Here is the code:
const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
const command = args.shift();
let guildQueue = client.player.getQueue(message.guild.id);
Answer the question
In order to leave comments, you need to log in
config is just a data store.
therefore, by adding something there, you will not change anything until you use this data in the code.
if you want the bot to respond to a specific prefix from the config, you can do something like this:
if (message.content.startsWith(`${settings.prefix}название_команды1`)) {
/* ... */
} else if (message.content.startsWith(`${settings.prefix}название_команды2`)) {
/* ... */
} // и т.д
(prefix)your_team_name...your code will run.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question