discord.js - Imagine a bot


discord.js - Imagine a bot

Support server for discord.js, a Node.js module to interact with the Discord bot API.

Join Server

Reaction Listener bot help needed

I have this bot that I want to do these things. I want it to send an embed on command, react to it, then listen to user reactions and log those reactions in another channel. Things I am having trouble figuring out is: 1. the embed sends twice when the command is sent for what i have no idea 2. i would like to make it so that the user can only input one reaction at a time. so that if a user changes their reaction, their old one is removed. ...
No description

Reading reaction info

I am attempting to take an array of reactions on a given message and identify the individual users that have posted each reaction. I have run into an issue where I can only reliably console.log the bot's user ID, and the list does not contain the rest of the user IDs unless the command is run immediately following a reaction state change (someone adds one). The other issue I'm running into is that I can console.log the information, but I can't seem to access it programmatically. This line of code is turning the reaction.users circular collection into something I can read in the console. ``` reactions.forEach(reaction => { if (reaction.count>1) { console.log(JSON.stringify(reaction.users,null,2)); } });...

Issue reading list of users who have reacted to a message

Afternoon, I'm creating a voting system in one of my servers that has users choose one of eight options. I am currently attempting to get the bot to reliably read the list of users that have reacted to each reaction, while also ignoring its own reactions. Related code...

Setting different commands for different types of servers.

Hello there, so i have a few server types. the user must /register before being able to see all the commands. Seperate kinds of servers should have seperate set of commands, and they should not be able to see each other's commands. ...
CNChun Nè2/23/2024

AudioPlayerError: aborted

```Lỗi khi phát nhạc: AudioPlayerError: aborted at connResetException (node:internal/errors:787:14) at TLSSocket.socketCloseListener (node:_http_client:455:19) at TLSSocket.emit (node:events:530:35) at node:net:337:12...

is accessing the message object from interaction response possible?

```js client.on("interactionCreate", async int => { if (int.isCommand()) { const SentResponse = await int.reply(...); try {...
Wwaff1e 🌹2/23/2024

Error: Invalid value GuildMember

I'm working on unmute command for my guild designed bot. However when i run the command the mentioned error occurs. Its worth to note that i use v13.14.0 not v13.17.1

settings command

its not saving the notifications, I have added settings.notification new and i want it to be saved in the users data but its not working we are using 14.14.0 discord.js version
No description


its not saving the notifications, I have added settings.notification new and i want it to be in the users data but its not working
No description

create channel

It says every time failed error: Error: DiscordAPIError[50035]: Invalid Form Body name[BASE_TYPE_REQUIRED]: This field is required...
No description

message collector filter not working as intended

Hello, I'm trying to build a message collector that only collects specific numbers or phrases for a bot for a game community. In doing so, I'm not sure why this logic isn't working. Is there another logic I can use or a change to the syntax I can use that will help me get the reply to be edited at the bottom of my code? ``` const collectorFilter = (m) => m.user.id === interaction.user.id && m.content.includes(...

Everyone role on guild.roles.everyone being undefined sometimes

In the attached image function first it awaits the login of the client then fetch the mainServer my project uses, if i print the guild.roles.everyone.id right after awaiting these things sometimes it have a value, sometimes not, if use a timeout of 500 miliseconds it always have a value, there is away to make sure it will have a value ?
No description
SShrewd 💫2/22/2024

Simple question

How is like context menu worth it? like I don't see a much of a need in it but I'm just curious and wanna know how it's better, how it can like make things easier, just anything, thanks

getting guild object

anyone knows how can I check if any kind of event happened and get the guild object? my bot only works on guilds so direct messages can be ignored. ```ts...

tracking first button press to do separate actions

hi, I'm trying to complete a util where: - all members in guild have "all channels" role - embed with 5 buttons to remove access to corresponding channels - upon pressing any of the 5 buttons, "all channels" role will be removed, and the other 4 roles apart from the button pressed will be granted, removing access from the channel button pressed....

Uploading images don't work

I'm trying to make a commands that shows a image as a joke, but it keep showing this error message, how do i fix?
No description


If the bot gets stuck on api-spam, there must be a way to tell. With a selectstringmenu, the member can change the name of the channel and I need to warn that person. Or can you find me a solution?

Setting Client commands in ES Module

I am trying to set commands in an ESModule: ```js const dirname = "./"; const foldersPath = path.join(dirname, "commands"); const commandFolders = fs.readdirSync(foldersPath);...

The bot has started, but does not respond to the standard command (!ping)

I installed all the required resources, node.js, discord.js library, latest versions. The bot has enabled intents on the Discord Developers website. The bot is turned on, it is online, but does not respond to the only ping command. Code:...

The button does not appear

After applying the command, only Embed, but there is no button Code - https://pastebin.com/jztz1uTJ...