This is the current code that I have, I would like to make it where if you have a certain role then you can bypass the cooldown, also if anyone knows how to make a command that restricts a certain command to a certain channel, instead of having this really long message.channel.id. Answer Answering Your First Question: Simply check if
Tag: discord.js
Check if a user can send message in a mentioned channel discord.js
I have a command which allows users to make the bot to say a message, but I would like it to be able to check whether the user is able to send messages in that channel before it sends it. Currently, I just have it locked to the MANAGE_MESSAGES permission. Here is the code: I have searched and couldn’t find
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 This is the code I’m trying to run but it joins the channel and nothing after
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 want to get the value of ó in Latin-1 characters: ó, therefore, the result would be como salutación familiar. getHex function removes &#; and returns xF3 to
UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Role in my code
I have a few lines of code that are causing issues, This produces the following error: I have no idea what the issue is and im really confused, any and all help is appreciated. Answer Dude you need to use === instead = in line 1!
Discord music bot: prefix not defined
I wanted to make a music discord bot and I’ve been having trouble with it for a while. and I keep getting an error and I got this code from CodeLyon’s video called “Make Your Own Discord Bot | Music Bot (Play, Skip, Stop Commands)” I keep getting the same error when I try it: ReferenceError: PREFIX is not defined
error when a non bot member comes online (presenceUpdate)
I am trying to get my bot to send this message when a bot goes online or offline. it works sometimes but when a human member comes online i get this error: UNCAUGHT EXCEPTION TypeError: Cannot read property ‘user’ of undefined. My code: Answer If we assume that this code is server side: Definitely you didn’t send newPresence in client
How do I use callbacks to order the chain of events in a command?
I am making a setup command, using the #awaitMessages listener 2 times in a row to set up a server correctly from a user input, but try as I might, I cannot achieve the effect of each message being sent, then collecting data, then sending the next message etc. Here is my code (I have removed lots of clutter you
TypeError: Cannot read property ‘split’ of undefined in discord and nodejs
this is the error this is the code this line gives error let token = msg.content.split(‘ ‘); i have blanked it out this fetches giphy gif // Here we get the data array from the response object // We pass the array to showGiphs function // We use catch method for Error handling Answer You’re trying to call split on
My Discord bot is sending multiple messages at once using discord.js
For some reason the bot is posting in the discord more than once. I am unsure how to fix this at this moment. I’ve exhausted all options and even restarted the code and the bot itself and I am not to sure where to go on from here. You can find my code below: youtube.js Answer I would suggest that