discord.js - Imagine an app

DIA

discord.js - Imagine an app

Support server for discord.js, a Node.js module to interact with Discords apps API.

Join

djs-questions

djs-voice

how can i do customize bot with d.js

How can customize a bot's pfp which is not my creation with using d.js bot

SlashCommandBuilder defaults

So i have a really simple question, Is SlashCommandBuilder by default set to all contexts and integration types....

Only Slash Commands Not Responding, Showing "The application didn't respond in time" with No console

I've tried everything I could, including regenerating the Token and creating a new discord.js project from scratch. Out of all my events, only Events.InteractionCreate isn't receiving anything—no error messages, and nothing is logged even after using console.log. Events.MessageCreate and Events.ClientReady are both working fine and successfully logging outputs....

Entitlement Update event not received after cancelling subscription

I'm currently testing subscriptions to my bot, and when I create a subscription an ENTITLEMENT_CREATE event is fired, I can see the details of the entitlement, and it is added to discord.js entitlement cache. However when I cancel the subscription via the "Subscriptions" settings, discord shows the subscription is cancelled, however no ENTITLEMENT_UPDATE event is recieved. According to discord.js the entitlement has no end date, even though discord documentation says there should be an end date set once a subscription is cancelled. Even if I restart the bot and re-fetch entitlements into cache, the entitlement is still active with no end date....

Posting img with REST

I may be approaching this in an inefficient manner, so while I am asking specifically how to post an image using REST, I am open to other ideas. My use case involves occasionally posting as the bot, typically components like buttons that are permanent. I prefer not to use / commands for these, as I only need to update if I change the code. These utility functions are currently written as mini-apps, creating a client, logging in, and then posting on the ready event. But I don't think this is the best way to do so, as I am now logging in as a second client....

Bot Not Updating Voice Permissions

I'm trying to have an event voice channel that is locked(everyone cannot connect or speak), but when an event is live have the perms update so everyone can connect and speak to that channel. There are no console errors I am seeing, and I know it's detecting an active event since the channels status gets updated to reflect the event name as it's supposed to. Can someone give this a look over and see what I'm doing wrong in the permissions area?...

Database connection

Hey I have a mysql database, I can connect to it and run CRUD actions. But I feel like the setup is wrong. I have this function:...

"cannot redeclare block-scoped variable 'data'"

do i register all of my slash commands in ready.js? i had no issues with the following: const { Events } = require('discord.js'); module.exports = { name: Events.ClientReady,...

why does my bot does random things

my bot does some random shit idk why there are no errors idk why its doing it

Unknown interaction

Hey! This is a bit of a weird issue, the code that wraps my dropdowns is quite difficult to pick apart on the backend to be able to post here, but this is what's in the active bit, should be relatively easy to understand. ```ts this.eventLengthDropdown = this.cache.storage.registerDropdown("eventLengthDropdown:" + this.id, async (cache: Cache, interaction: AnySelectMenuInteraction) => { if (interaction.values[0] === "-1") {...

I have an error that i cannot solve.

This error is just a console error but it works fine for me to the but, there is obv a problem. My code: https://sourceb.in/Jd8ZsB3U2d My error: Error handling modal submission: DiscordAPIError[10062]: Unknown interaction at handleErrors (D:\dcbot321312\node_modules@discordjs\rest\dist\index.js:727:13) at process.processTicksAndRejections (node:internal/process/task_queues:105:5)...

Message periodic scanner

Hey! I am trying to figure out if I there is a better way to handle my case: User can create suggestion on my server....

Can discord.js store snowflakes as bigints instead of strings?

See title, I couldn't spot any options for it in the docs and I'm curious if it's possible.

How to differentiate between the possible errors when DMing a user?

I want to do send a DM to a user and handle the errors. I know that there is more than one possible error, but not how to handle it. There is the one if the user has DMs disabled and one if user doesn't share any servers with the bot and one for Unknown user and also one for "Cannot send messages to this user". How can I differentiate between those errors and what is even possible?...

Error that i cannot fix.

I know that i asked help for this once but i still need help. This is my codes: index.js https://sourceb.in/LrDkNyzADH commands\contest.js https://sourceb.in/BO3kmjr7MH And the error I got: D:\dcbot321312\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:105 if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied); ^...

Application command's options

how can i get (for example) the name of the command, or the value? i know how to get the data, but i can't figure out on how to get the name cause it says undefined...
No description

duration is null or undefined

when i do /addreminder 1s it just still says its undefined. ```const { SlashCommandBuilder } = require("discord.js"); const ms = require("ms"); module.exports = {...

Bot not receiving DM's

This is my bots code. ```js console.log(message) // If the message is from a bot, do nothing if (message.author.bot) return;...