discord.js - Imagine an app

DIA

discord.js - Imagine an app

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

Join

djs-questions

djs-voice

Where can I find projects using discord.js?

I'd love to look through a list of projects using discord.js. Perhaps someone has already built what I need and I can join that project rather than starting a new one. Or perhaps I can learn something from looking through the features that will improve my own project. I realize not everyone will want to be listed, but it would be great to have at least a few "powered by discord.js" examples. I couldn't find any on either the web site or here in Discord....

Help with Message Reaction Collectors

Hello, Version: 14.21 I'm not sure if I am just missing something really obvious here, but I can't seem to get the Message#createReactionCollector() to acknowledge reactions on a message. Here is my code:...

member.id is returning null for only one specific member

I've had a Discord bot running for over a year, no issue. The bot is running the latest version of discord.js: 14.21.0 on Node.js version 20.6.1. A specific member that joined the server recently was having issues running some of the commands of my bot, so I looked into it. For THIS member (and no other members), anytime the code references a member id in a SlashCommand (interaction.member.id) the id attribute is null (TypeError: Cannot read properties of null (reading 'id')). Does anyone know a reason why a specific member's id would be null? Like I mentioned, after a year of the bot running, this is the only individual where their member id comes back null....

Files not getting attached

I am trying to add text files as attachments, but it seems not to be working. Might be something obvious I am missing. Code I am working with (It has the catch block and other items) ``` client.on('interactionCreate', async (interaction: Interaction) => { try {...
No description

Can Guild.members.fetch return a partial member?

Like the title says, and can a partial member have the presence property null? If I needed the presence property, would a check if null and then calling member.fetch by the right course of action?...

Discord Embeds

How does one get a button inside an embed, like the image..?
No description

How do i handle permission bits when using REST

const allowValue = channel.permission_overwrites?.find((p) => p.id === membersRole.id)?.allow === '2048'
const denyValue = channel.permission_overwrites?.find((p) => p.id === membersRole.id)?.deny === '2048'
const allowValue = channel.permission_overwrites?.find((p) => p.id === membersRole.id)?.allow === '2048'
const denyValue = channel.permission_overwrites?.find((p) => p.id === membersRole.id)?.deny === '2048'
...

@discordjs/proxy-container intermittently crashing

Hi, I use this package to proxy my cloudflare worker requests since I was getting 1015s while trying to use the OAuth callback endpoint (ugh!). It's been working great up until a few days ago when all of a sudden a small percentage of requests began to return 1015s anyway, along with (I assume they happen at the same time) a crash. I have tried re-pulling the container in case there had been an update made but that didn't help sadly. Docker command: ```...

help compenentv2

My command does not display the user's avatar when I use his ID and I cannot find the problem.

Button Pagination not working?

I'm doing an auto updating help command just so my server can keep up to date with what commands are available. And yes I know most of the await aren't needed...
Code:
Code:
https://pastebin.com/mDraff2e...

My buttons are not updating correct. [USING COMMANDKIT LIBRARY]

I am trying to make it so once my claim button is pressed, all the rest of the buttons will stay the same except for the claim button which will change for the claimed button. instead, what happens is that pressing the claim button results in a "this interaction failed" however no error is outputted to the console.

Is it possible to edit a componentV2 message ?

```typescript import { CronJob } from 'cron'; import { Client, ContainerBuilder, MessageFlags, TextDisplayBuilder } from 'discord.js'; // import { getLeaderboardData } from '../db/leaderboardData.ts'; import { getSettings } from '../db/settings.ts';...

Collections not collecting channel messages

I am using the code sample code from basic message collector, but am struggling to get it to work at all. It seems no matter what I try, it always collects 0. I have added the following to my client: - GatewayIntentBits.Guilds, - GatewayIntentBits.GuildMessages,...

Voice channel name change fails silently after 2 successful attempts

I'm using a bot with Administrator permissions to rename a voice channel via channel.setName(). The first two attempts work fine, but from the third attempt onward, the name doesn't change — and no error is thrown. Here’s the relevant code snippet: ```ts...

deferReply() with withResponse/fetchReply

```js const { Client, CommandInteraction } = require("discord.js"); const { QuickDB } = require("quick.db"); const formatUptime = (ms) => {...

Is it still possible to create music commands using YouTube Music as the source?

I can never get my bot to play audio when connected into a voice channel.

How would I have two subCommandGroups?

I wanna have two subcommands for admin qoute and then admin activity which both have diff ways of manging....
No description

'collect' VS 'InteractionCreate'

While working on a bot I came across the problem of when to use collector, the 'collect' event and the 'interactionCreate' for buttons. I am confused when to use 'collect' and when to use 'interactionCreate' for buttons. I am trying to make a button that should work 24/7. It is used to send a request (basically send a message when someone clicks the button) but to work the button for 24/7....

Error Trying to Run on Server

Before when I was in VS code running it. It worked perfectly fine but when I move it to a server I get this error. ```js file:///home/container/source/index.js:1 import { Client, GatewayIntentBits, Collection } from 'discord.js' ^^^^^^^^^^^^^^^^^...