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

my bot is not working

so i wanted to make a bot for my comunity but its not working i use replit in my browser to edit the code i have 2files the index.js and config.json thats have { "prefix": "!", "token": "someone told me to not show the token but its here", "botOwnerId": "969939887723782218" }...

button question

is it possible for me to make a button where when its clicked i can send a message back to the bot that will make it do something else?

GuildMemberRemove not working

client.on(Events.GuildMemberRemove, async (member) => {
console.log(`GuildMemberRemove: ${member}`);
});
client.on(Events.GuildMemberRemove, async (member) => {
console.log(`GuildMemberRemove: ${member}`);
});
...

Cannot Edit Interaction

Trying to make a verification system, but the other file doesn't mention it as a message. (the index.js code is through an express endpoint which validates the oauth token, my module & everything else works perfectly fine)

throw err; ^Error: Cannot find module '../commands/fun/avatar.js'Require stack:

Main.js File ```const { Client, Intents, Collection } = require('discord.js'); const Discord = require("discord.js")...

Error: Unsupported MIME type: image/webp

Trying to do image manipulation with peoples avatars but it's throwing this when a static image of someones avatar is being displayed. When someone has a GIF as their avatar, it comes up but it's as a static image instead of actually a GIF. ```js const avatar = !member ? interaction.user.avatarURL() : member.avatarURL(); const user = !member ? interaction.user : member;...

opt is not defined

I already have all the database stuff handled, it's just the tags. The node version is in the error btw Node.js v18.3.0...

Commands not working

I made this discord bot about maybe 2 years ago I have recently started developing it again to use it as my final A level project everything seems to be doing well until I try execute commands they wont execute I dont know if it has something to do with the command handler being outdated or soemthing with the prefix Full code for refrence :https://replit.com/@MadlyJohn/Contbot-2 Using Version : "discord.js": "^12.5.3",...

Filter not picking up when a user interacts with a static message

```module.exports = { name: 'ruleVerify',
async execute(client){ ...

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