How to find a discord.js user’s permissions from a message mention?

I’m making a ban command and I need to check if the target user has administrator permissions. I’ve tried: const user = message.mentions.users.first(); const userMember = message.guild.members.fetch(…

How to remove role from user in guild discordjs V12?

I have an economy system on my discord server and players can buy VIP for 30 days. Data are saved in firestore cloud database. The bot checks every 4 hours if someone has over his VIP and it should …

How to access property of a property of a JSON object if the initial property is a variable?

I am making a discord bot and have successfully made a system where it stores user’s variables in a JSON file in this format: { “801479782613123123”: { “status”: true }, &…

Discord.js bot joining voice channel but wont run the remaining code after joining

I have a discord bot that I’m trying to get to join a voice channel and have it repeat a sound file, so far I have got it to join but after it joins, none of the code in the arrow function is run let …

How to convert Unicode Hex Characters to Latin-1 in JavaScript

I’m using rae-api to get the definition of the words in their dictionary. The problem is for example: I search for the definition of the word hola, it returns como salutación familiar.. I …

UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Role in my code

I have a few lines of code that are causing issues, role = await message.guild.roles.cache.find(role => role.name = “Muted”); member.roles.add(role.id); This produces the following error:…

Inconsistent error when checking for user ID’s while using partials as well. (Discord.js)

The code below is the code I am using to track deleted and edited messages. However, when I try to check the user ID (because sometimes, discord bots like groovy constantly delete and edit messages …

JavaScript,Discord.js, Node.js TypeError: Cannot read property ‘execute’ of undefined

I’m building a discord bot and I want to save information in bdays.json but this error pops up. All other commands are working just fine but I am getting this error: TypeError: Cannot read property ‘…

How to have a Discord bot return the number of words in a message

client.on(‘message’, message => { if (!message.content.startsWith(prefix) || message.author.bot) return; const args = message.content.slice(prefix.length).trim().split(/ +/); const …

discord.js eval command returning [object Map] and [object Object]

so I have my eval command, however when I run such things as an eval to set status or something like that, it returns either [object Object] or [object Map]. I have fixed the previous error with […