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

slash commands

How to check which sub options they used in the slash commands?

Application failed to respond

Keep getting application failed to respond with no error on the log i think it has something to do with the command handler commandhandler.js: https://sourceb.in/lVRKExQCuL index.js: https://sourceb.in/y5SKsVYhHY...

user.global_name

HI from which version this property is available in user object "global_name, the user's display name, if it is set. For bots, this is the application name"...

Issue adding and removing roles in same command

I have a select menu command where you select the roles you want to add/remove from a list when roles are selected it checks if the user has the roles already, what roles didn't get elected and removes the unselected roles and add the selected roles. this issue I am having is when I combine the roles.add and the roles.remove the member roles remain unchanged and no error is given. ```js try { if (rolesToAdd.length >= 1 && rolesToRemove.length >= 1) { await interaction.member.roles.remove(rolesToRemove);...

Cannot use `{data.length}` (Typescript)

i dont know the reason why {data.length} get error, it announced that 'data' is of type 'unknown'.ts(18046) Here is the code: ```ts import fs from 'node:fs'...

how do I handle modalsubmits in typescript?

even if I use a collector, it wont work

discord js core issue

Sometime halfway through guilds.map(async (guild) =>{..} ) cpu usage goes abnormally high ,ram usage increases by like 50mb and server gets stuck , it doesn't continue . And remains stuck till it is killed Full code: https://pastecode.io/s/mk7w8hu2 the code which could be responsable: https://pastecode.io/s/mk7w8hu2 Note: In this code guilds is a array of guilds fetched by api And i am using discord js core...

Issues With Permissions

Im going to say it now, Im terrible at coding and I have zero idea what I'm doing. Anyways I'm getting a permissions error in terminal and I have no idea how to resolve it. Can someone help me please? Thank you! Here is the code: https://paste.alienhost.net/kupubawefa.typescript...

Having choices as both strings and numbers for the same option?

I am trying to make an option for a slash command have a choices of one being a number and the other being a word/string. Is there a work around for this?

Button Interaction

Hello, this is my code: ```const { MessageActionRow, MessageButton,...

Could anyone help with a question? :D

this is right isn't it? I also wanted to know if it is possible to create buttons in these embeds via webhook

V13 - <User>.global_name

Hi, will the global_name information be available on a future v13 update?

button interaction doesnt work (d.js 14.11.0)

Im making a bot and button interactions dont work, when you hit a button it responds with "the application did not respond". Heres my code: https://hastebin.skyra.pw/junucexuze.js There are some variables that i left out for simplicity's sake but theyre unimportant to the part that doesnt work xd. anyways so i'd appreciate if anyone could help me :)...

Edit message on button click DJS14

Hey, I'm trying to make a slash command on my bot to fetch a list of users in my database. It'll work that way : /info pseudo:aznoob and will print a bunch of information game-related on the user. ...

Can we shorten the emojis?

Whenever my admins register new messages inside the JSON file by a command, my bot updates the message where it displays it with the new data. But recently I got a error because of 2K characters limit (emojis take too much space). Is there a way to reduce this aa to :aa: ? I somehow need to shorten the message sent, and to shorten the emojis seems the best way since there are a ton of emojis inside the mesasge....

Typing Oauth2Guild

Does anyone know if discord-api-types has a builtin type for an Oauth2Guild (i.e. a guild fetched via the oauth2 api/v10/users/@me/guilds route) or would it just be
import type { APIPartialGuild } from 'discord-api-types/v10';
export interface Oauth2Guild extends APIPartialGuild {
permissions: string;
}
import type { APIPartialGuild } from 'discord-api-types/v10';
export interface Oauth2Guild extends APIPartialGuild {
permissions: string;
}
...