discord.js - Imagine a 👻

DIA

discord.js - Imagine a 👻

Support server for discord.js, a Node.js module to interact with Discord's apps API.

Join

djs-questions

djs-voice

Select menu weird bahavior

(reposted from #djs-help-v14 due to no respond for 10 minutes) Hello guys, I am back I have a problem getting my dynamic select menu mapping function to work Here's the error ```[12-06-2023 12:42:22] Uncaught error...

Need help debugging an error

Can anyone help me debug this please? I've looked all around my code but there's nothing about ID. Any lines regarding something.id have been commented out but it still occurs. ``` [06:15:30/ERROR] Cannot read properties of null (reading 'id') Trace: [06:15:30/TRACE] TypeError: Cannot read properties of null (reading 'id') at new Context (C:\Users\andyj\Documents\GitHub\gamecord\client\node_modules\gcommands\dist\lib\structures\contexts\Context.js:8:42)...

Finding a role

Im using command option to get a user, for instance /addrole @name, i created a member value but cant figure out how to get a role Everytime i try to execute the command it gives roles undefined I use " member.roles.add(OCS)" to add the role...

displayName

I want to get the profile name on the current server of the user. currently I use it as following:
channelName.replace('{user}', `${member.displayName}`);
channelName.replace('{user}', `${member.displayName}`);
(<newstate>.member.displayName) The new update takes the username instead of the displayName it used to be....

component collector

can i collect two different components? for example, i am using a button that leads me into a string select menu...

if one user is already using a slash command, other users are unable to create their own instances

I made a quiz bot recently and when more than 1 person is trying to use the commands at a time the bot responds with "this command failed" when they try to enter the loop for the quiz. Is there some reason it doesn't support multiple instances?...

Detecting role removal

```js client.on('guildMemberUpdate', (oldMember, newMember) => { const roleID = '899870393282752542'; const removedRoles = oldMember.roles.cache.filter(role => !newMember.roles.cache.has(role.id));...

Differences between UserManager cache and GuildMemberManager cache

What's the difference between the UserManager cache and the GuildMemberManager cache? I understand the difference between a user and a GuildMember, but if the user cache is disabled does that mean guildMember.user wouldn't exist? or would it simply stop things like client.users? Ping on reply Additionally, cache only applies when you access things in the cache right? for instance, if a interaction request comes in and I have the UserManager cache disabled, I can still do intr.user. or intr.client.user correct?...

Pagination

Hello, I'm currently experiencing an issue with pagination in my Discord.js bot, specifically related to updating the content of pages. Here's a brief overview of the problem: I have implemented a pagination system that allows users to navigate through a list of items using previous and next buttons. Each page displays a limited number of items (let's say 5). The initial setup works fine, with the first page displaying the correct items. The second page displays the same objects as the first one and the third page shows the items 6-10 eventough i have 11 items so there's one item missing, which is showed when clicking on the previous page button to go back to page 2. However, when I delete an item on the last page, and the page becomes empty, the buttons for previous and next still appear, and the content of the page doesn't update accordingly. As a result, the pagination becomes inconsistent and doesn't reflect the actual state of the data....

I cant use my anycommand

Even if I fix my internet connection problem I got this error

Calling a DM function from outside Discord.js

Heya, I was wondering if anyone has insight to how i can call for a DM event via a outside function, My bot is running in-junction with a Fastify server, that runs authentication for a database, and when handing out access to this, I want the bot to DM the user their randomly generated key. I would assume there's a way to go about doing this, obviously, but i don't know how i would go about doing this, do i register a event in the event handler or something similar? Or can I just make a function to do this?...

my bot is not working

so i wanted to make a bot for my comunity but its not working i use replit in my browser to edit the code i have 2files the index.js and config.json thats have { "prefix": "!", "token": "someone told me to not show the token but its here", "botOwnerId": "969939887723782218" }...

button question

is it possible for me to make a button where when its clicked i can send a message back to the bot that will make it do something else?

GuildMemberRemove not working

client.on(Events.GuildMemberRemove, async (member) => {
console.log(`GuildMemberRemove: ${member}`);
});
client.on(Events.GuildMemberRemove, async (member) => {
console.log(`GuildMemberRemove: ${member}`);
});
...

Cannot Edit Interaction

Trying to make a verification system, but the other file doesn't mention it as a message. (the index.js code is through an express endpoint which validates the oauth token, my module & everything else works perfectly fine)

throw err; ^Error: Cannot find module '../commands/fun/avatar.js'Require stack:

Main.js File ```const { Client, Intents, Collection } = require('discord.js'); const Discord = require("discord.js")...

Error: Unsupported MIME type: image/webp

Trying to do image manipulation with peoples avatars but it's throwing this when a static image of someones avatar is being displayed. When someone has a GIF as their avatar, it comes up but it's as a static image instead of actually a GIF. ```js const avatar = !member ? interaction.user.avatarURL() : member.avatarURL(); const user = !member ? interaction.user : member;...