I am trying to shard my discord bot in v13, and when I run just the main file (bot.js) on my beta bot without sharding, it works fine, but when I try running it with sharding, It gives this error. Here is the index.js code where I shard When I try running just bot.js without sharding, it gives the error
Tag: discord.js
Clear command is not deleting messages correctly discord.js v13
I want to make a bulk-clear command for my bot. I tried this code: But it doesn’t work correctly. when I run !clear 3, It deletes 2 messages. Notes: I am using discord.js v13 and node.js v16 Answer Your bot also counts your command as a message, and removes it. That’s why it only removes 2 other messages. To prevent
How do I re-run a Javascript-file when the content of a folder changes?
I am having trouble getting this to work. I am developing a Discord-bot and just started using slash-commands, which require the commands to be “pushed” every time I change something. The files are pushed by simply running a Javascript-file. Then there is also the main bot-file, which needs to be stopped from running and then started again, in order for
if (typeof data !== ‘string’) throw new error(errorMessage);
I’m working on a serverinfo command in discord.js v13 and I don’t know how to fix this error ERROR: [Photo Error]: https://i.stack.imgur.com/tcEem.png if (typeof data !== ‘string’) throw new error(errorMessage); ^ RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings. [Symbol(code)]: ‘EMBED_FIELD_VALUE’ Answer The second parameter to .addField must be a string, as your error message says: MessageEmbed field values
Why does my addrole command have errors? (discord.jsV12)
So basically my addrole command after the new version of discord.jsv13 no longer works and displays errors like role.id is not a function or role.id is not defined even though I believe there is no error, I’m pretty experienced with javascript but I tried different methods of fixing it but neither seem to do the trick, maybe because v12 is
Discord.js v13 REST API Guide Cat and Urban Issues
So i tried following the https://discordjs.guide/additional-info/rest-api.html guide before making my own. But I can’t get either to work. Firstly with /cat it crashes and the console returns with: And /urban works but no matter what term I enter it returns with NULL. Here is the code, its nearly identical from the guides apart from the added SlashCommandBuilder and REST. Answer
How can I forward sent messages from one discord server to a separate channel in a different server [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 9 months ago. Improve this question Title. I couldn’t find anything on this online or on stackoverflow. Answer What you could do is have a message event listener which collects all
TypeError: path.join is not a function (got the error in my handleEvents.js file)
I am trying to make a discord bot and i got this error in my handleEvents.js file The code: Answer You are missing a path module import and by using the name path as property of your callback, you would be overwriting the path module.
“Jump to Message” Button
Hi so basically I’m making a suggestion command. Once the user ran the command it will reply “Suggestion Submitted” with “Jump to Suggestion” url button but I’m getting error with the button. Here’s my code The Error Error: MessageButton must be a String Hope to get the some help with this as this have become the issue for me that
I can’t send an embed with a slash command (discord.js)
So what happens is Anytime I try to send a embed with a slash command on discord.js it throws an error. Here is the “help.js” file I’m trying to send. The Error: Answer You are getting this error because the variable channel has not been defined before you used it. Instead you can use interaction.channel.send() if you want to send