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

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;
}
...

Help width interactions

Hello I have this code in slash conmmand, when I try to interact outside the if works perfectly but if y try into the if give me an error: ```Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred. at StringSelectMenuInteraction.reply (C:\Users\Rober\Desktop\BotLocal\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:102:46) at Client.<anonymous> (C:\Users\Rober\Desktop\BotLocal\src\commands\ticket\order2.js:47:29)...

adding a button to a ticket bot

I found a ticket bot on GitHub.. and it has a button to create a ticket all I need is to add another button like for donation.. I've tried but I got errors. seems like I know nothing about coding. would someone do it for me? I think it's so simple for u guys. https://github.com/feyit/ticket-bot...

Error with Action (.\node_modules\discord.js\src\client\actions\ActionsManager.js:75)

When I run node index.js, my console shows TypeError: Action is not a constructor which is in the source files of discord.js. The ActionsManager.js file from the Discord.js library, an attempt is made to use Action as a constructor, but it is found that Action is not a valid constructor function. And the console also tells me that the error is related with const client = new Client({ intents: [GatewayIntentBits.Guilds] });. It started when I was following this part of the documentation: https://discordjs.guide/additional-features/cooldowns.html. This is the error. (ActionManager.js) ```js register(Action) { this[Action.name.replace(/Action$/, '')] = new Action(this.client);...

prefix command not working

I tried to add the commands in separate files, but it did not turn out to be comfortable for me, it also did not work, so I wanted to add them in the same index, it turns out that it does not work either, I chose to add a console.log to see if the client.on ('messageCreate') was executed correctly, someone help me? ```js const { Client, Collection, GatewayIntentBits, Partials, SlashCommandBuilder } = require('discord.js'); ...

Pagination problem

Hello, I have a problem with pagination. I'm working on some stock management commands, and here I would like to display the entire stock after the command. The problem is that the embed is too large, so I thought about using pagination and only displaying 5 "data" on each embed page. However, I have a problem because my code is not functional....

Modals

```ts button.showModal( new Modal() .setCustomId("test") .setTitle("This is a test modal")...

Anti spam

how would you go about making an anti spam, so say as if someone was spam messaging how would I log that with my bot?

Discord Embed inline field gets out of line

This happen when I expect it all to stay in-line. Code snippet: ```javascript .addFields(...

Fetching Guild Commands returns nothing

I am using the ApplicationCommandPermissionsUpdate event. I am trying to fetch the command using the guild.commands.fetch() method. This always returns empty and i'm not sure why. Here is my some code for the ApplicationCommandPermissionsUpdate file: ```js module.exports = {...

Label Character Limit

I searched something on discord-api-types and I saw that there it says that Text Input's label is max. of 80 characters while when actually creating and sending it, it's 45? Is this mistake on discord-api-types or it's actually 80 somehow or something else? * https://discord-api-types.dev/api/discord-api-types-v10/interface/APITextInputComponent#label...

bot can't manage roles on user

THE ERROR: TypeError: Cannot read properties of undefined (reading 'id') at get cache [as cache] (C:\Users\2DF2ZDT\Documents\New folder\node_modules\di ers\GuildMemberRoleManager.js:37:101) at GuildMemberRoleManager.add (C:\Users\2DF2ZDT\Documents\New folder\node_modu...

Auth2

Is the access token used to access people's accounts? or just to pull information like name, avatar and among others?

TypeScript Logical Error Not Syntax Error

So, I have a ModMail bot made in TypeScript, and I have a slash command that blocks the user from D.M.'ing the bot any further. The problem is, when inputting the time/duration for how long the block wants to be in the slash command, the bot disregards it by having the block be permanent. Please help. The code is below. Thanks....

emoji react message

how to make it add reactions to the message?

Question about integration

On server where I spend some time there a Role Linked integration. That's get your steam account if you allow, and get steam ID and gets some information about dota 2 from your profile. What I not understood is in picture, like is there anyway to make it in Discord.JS or no. Any help appreciated

Does anyone know if the defaultMemberPermissions can set a job id or just PermissionFlagsBits?

```lua module.exports = { name: "teste", description: "teste", defaultMemberPermissions: PermissionFlagsBits.Administrator,...