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

Handling DiscordJS API Errors

Hello everyone, I've been trying to handle API response errors to avoid my Bot to die once these occur, errors like character limit exceeded or too many options on a command, the problem is: I am not sure where can I capture these errors because using the function catch() only works on certain cases, for example on the put request only works when i have 25 options (the limit) if i have 26 it will not be captured by the catch and just kill the bot.

change clear-warns to remove-warn(id)

https://sourceb.in/6juwjNd0ng i want to know if theres a way to clear a certain warning instead of all of them...

Multi Guild Error Logs

https://sourceb.in/hmOEpNlIIk i have the schema, interactionCreate event, and set-up command in the sourcebin. it will send to the channel if I use a channel id but not if i use the database. the guild id and channel id are logged in mongo db but i still get the type error...

Ping NaNms

```js const { SlashCommandBuilder, Client, GatewayIntentBits, WebsocketOptions } = require('discord.js'); const client = new Client({ intents: [GatewayIntentBits.Guilds]}); module.exports = { data: new SlashCommandBuilder()...

State management

I'm building a bot and am wondering the best way to manage state within the app? For example, once a user executes a command we begin a flow that asks them various questions and then will provide them with a custom message at the end based on all of the answers they've given. Is there a standard to maintain state in discord.js that will allow us to keep all these answers? Thanks!

sending message when shard starts

Error [ShardingInProcess]: Shards are still being spawned.

Responding to interaction with a video from a URL

Hi, I have a database of videos that are all stored as links (all on the discord CDN and ending in .mp4). I want to respond to a ChatInputCommandInteraction with a video. At the moment I'm doing await i.reply({files: [new Attachment({url: row.content})]}), but that re-uploads the video to the Discord CDN rather than just showing it from the URL, which makes it slower. With images I know you can just provide a url and not have to reupload it, I assume this is possible with videos too? And also Attachment's constructor is private so its not ideal. ...

djs14 question

is it possible to create a command to set up a 'bot-logs' channel, for every server the bot is in? that way if the bot gets updated the dev can send the updates to the servers bot log channel?

Reply failing on button interaction, getting no errors

Just not sure what I did wrong here. Looks fine according to the discord API guide as far as I can tell. When I hit the yes button, I get an error in discord that says "This interaction failed."...

logic building question (flow chart included):

First of all, thank you so much for all of the help you guys have given me over the past couple days as I'm building this bot. New to discord.js and you have helped to make it a really fun and engaging experience to learn! I have a working embed, and I've done research into the discord.js to figure out if this was possible I think I've found a way to do what I want, but I wanted to know if this was a feasible way to get what I'm trying to do set up, or if there's another way I should go about it. ...

Icon in embed .addFields msg

How I may input this teeny-weeny icon to value in .addField in my embed msg. For example I have something like this: .addFields({ name: 'Account:', value: You have [here I want input my icon] }); Is it possible in djs v.13 ?...

Not sure why my embed is failing.

Hello! I have an embed that I'm putting together and I'm getting a TypeError that I'm not quite sure I understand. Could someone help me understand what the error is trying to say? ```TypeError: (intermediate value).setTitle(...).setDescription(...).setColor(...).setThumbnail(...).setTimestamp(...).addComponents is not a function at Object.execute (C:\Users\Owner\Desktop\BartleBot\src\commands\tools\quiz.js:31:8) at Object.execute (C:\Users\Owner\Desktop\BartleBot\src\events\client\interactionCreate.js:12:27)...

I wanna get embed data

When I click "Onayla" Button bot send message embeds description this channel. Can I do it?

How to completely removing an emoji, not just the reactions

In my app, the bot automatically adds different emoji reactions when a user creates a message. Afte a certain amount of time, I want that emoji removed. Not just the reactions, but the entire emoji. So far, I've only been able to figure out how to remove the reactions, which result in the default reaction count of 1, but the emoji is still there. Is there a way to remove the emoji entirely? Thanks all

DiscordAPIError[10062]: Unknown interaction

hii my bot was working very well at morning but now its give me this error for everything i use any help 🤍...

Does anyone know this "ENOTFOUND" error?

I think it's an error in a call discordjs made, and not a result of a function I called. I'm using djs 14.6.0 and node 16.13.2, so it might have been fixed in the meantime, but I'm not really sure where it originated in the first place.

waiting for interaction collector to finish before executing another function

code: ``js await interaction.reply({ ephemeral: false, embeds: [embed], components: [row] }).catch(e => console.log(e)); let filter = i => [next, exit`].includes(i.customId);...