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

MemberRemove call when I kick my bot

When I kick my bot of a server, I think that the event "MemberRemive" is called, and it makes a bug : ```java node_modules@discordjs\rest\dist\index.js:640 throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData); ^ ...

Error fetching guild on client ready event

I have a function that will check for all guilds that have member count enabled However this specific group of code seems to always fail to fetch the guild, even tho when evaluating the same code it succeeds. This specific line const guild = await client.guilds.fetch(g.guild).catch(() => {}); always returns void or undefined. Even tho the provided guild ID is valid. This function is called from the ClientReady event....

Why use @discordjs/broker rather than node-redis-pubsub?

I can imagine there being a benefit for discord.js-based applications, but i'm not sure what it is

bulkDelete error

so i'm trying to use bulkDelete but if the message is over 2 weeks it won't delete, thats fine but when I get the error it will exit the process even if I use try, is there anyway I can check if I can bulkDelete the message?

Get interaction of an interaction

Hi ! I wanted to know, with discord.js 14.11.0, there is a way to get an interaction sourced of another. To explain, I want to modify an embed with context menu and a modal (the modal appear after i click on the context menu action) and with that, I don't know how I can get the message of context menu when I submit all fields of the modal. https://github.com/Les-Moddeurs-Francais/Moddeur-Ultime/tree/suggestions...

trying to do a starboard system

https://sourceb.in/TFctbjoT1p setting the channel is fine and is entered in the database, but nothing gets sent to the channel so i figured it was my event...

Slash Commands Cooldowns

Hi, I just followed the guide for the cooldown but I get errors.

disable select menu

I was told i cant do it but I just wanna ask here to make sure, am i able to disable an option in a select menu?

Channel Permissions

hey im trying to get a specific role permission in a channel and copy its perms with another role in another word duplicatiing the role permission in the same channel. for example i got a role named Verified with set of permissions in some channels , and i wanna add another role named Verifed 2 to those channels which has verified role in them and copying its perm. ...

I don't know how to make a conditional "if" in setTimeout() (related to roles)

Hi!!! So, i was trying to make a mute command, and the good thing is i was able to creating it. However, i use the function setTimeout() to create a cooldown when the role "MUTEADO" (muted) deletes automatically at a specific time. The problem is that if i make a conditional, checking if user has "MUTEADO" role, always says something is not a function, or similar. Ive tried so many things, so tell me any ideas to make the conditional on line 50 work fine. Thank you!

How will djs handle bot tags, since they're not switching to the new username system?

I read on the Discord dev server that they decided not to switch bot users over to the new username system (yet), and they abandoned the idea to give all unverified bots a random username for now. Does this mean .tag can still be used for bot users? Two systems being used at the same time confuses me, because it seems we'll have to continue using deprecated features to show the differences between bot usernames. So can .tag and .discriminator still be used for bot users, or will .globalname function like .tag does for bot users?...

[Registering slash commands]

for now I register slash commands by the official guide from https://discordjs.guide/creating-your-bot/command-deployment.html#command-registration and once I hit the rate limit per day(100 times), the whole rest day I couldn't test my new commands on that bot. I read discord.js website and found that put() refreshes all the commands every time. As now I have at least 10 commands and some times I'll adjust something like the options and .put() many times. So, Is there any way to simply register only one command? I can't find other functions to do registering and I also found client.application.commands.create(), but if not necessary I don't want to do that (though it wont take much time, perhaps)...

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?...