I have an error in these codes.
client.on("message", async message => {
if(message.author.bot || message.channel.type === 'dm') return;
let prefix = botsettings.prefix;
let messageArray = message.content.split(" ");
let cmd = messageArray[0];
let args = message.content.substring(message.content.indexOf(' ')+1);
if(!message.content.startsWith(prefix)) return;
let commandfile = bot.commands.get(cmd.slice(prefix.lenght)) || bot.commands.get(bot.aliases.get(cmd.slice(prefix.lenght)))
if(commandfile) commandfile.run(bot,message,args)
if(cmd === `${prefix} reactions`){
let embed = new Discord.MessageEmbed()
.setTitle('Reaction Roles')
.setDescription('Kişiliğinize göre bir rol seçiniz.')
.setColor('GREEN')
let msgEmbed = await message.channel.send(embed).
msgEmbed.react(':closed_book:')
}
})
I am encountering this error. I couldn't find the botsettings part.
UnhandledPromiseRejectionWarning: ReferenceError: botsettings is not defined
This means that you didn't define the "botsettings" file anywhere. Try adding
to the top of your code.