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

SystemChannelFlagsBitField

Why is new SystemChannelFlagsBitField(systemMessageFlagsChange?.new).serialize().SuppressRoleSubscriptionPurchaseNotificationReplies always false?

How to handle unhandled rejections?

My app usually crashes when a very weird unhandled rejection occurs, usually when it's an event where I don't have a general error handler. So how can I catch unhandled rejections effectively? (Maybe even do something with it like send it with a Webhook or log it)...

client is undefined error

Hey, I have the problem that I get an error with "client is undefined" after I call my script via "const script = require("./src/script"); script()". I have attached screenshots of the problem.
No description

Why are my embeds not sent but Files are?

I'm using this payload in a raw rest.post() request and the files are being sent, but not the embeds. Why? I have based the code on the original code from djs. ```ts payload = {...
No description

npx create-discord-bot generates broken code

I'm picking up Discord.JS in order to expand my choices for clients, so I figured I should take a look at Discord.JS, however when i run npx create-discord-bot and say yes to Typescript, it will create a project with broken code in src/util/deploy.ts it says Argument of type 'RESTPostAPIApplicationCommandsJSONBody[]' is not assignable to parameter of type 'RESTPutAPIApplicationCommandsJSONBody on const result = await api.applicationCommands.bulkOverwriteGlobalCommands(process.env.APPLICATION_ID!, commandData);, its the commandData part that is showing the issue, I have no clue how or why this happens, for context I originally come from Discord.NET which pretty much hides away the entire command registering behind its RegisterCommandsGloballyAsync function...

Problem with guildMemberRemove.js (duplicate leave message)

hi i have problem with my code, general when someone leave bot duplicate the message x2... but my guildMemberAdd looks VERY VERY same and send only 1 message ;/

Is the promise rejected when a REST.post request fails?

I'm doing something like this and I'm wondering in which case the promise is rejected (when the body and all stuff is correct). Is the promise rejected when the HTTP status code is not 2xx ? Is there a Type I can use? ```ts try {...

Cron Job doing what it wants

I used cron job several times and I googled how to correctly use it, but my command here executes in different times whenever it feels like doing so. The picture shows the code that triggers it For the past 10 weeks, it triggered on a Sunday at 22:54, Monday 20:32, Thursday 17:56 and so on (not at the time I want it to trigger) Today it triggered on a Tuesday at 18:00 which is the time I put in. I want it to run without problems, anything you know of?...
No description

Could someone help me with a problem I’m getting

I run my bot from my pc using npm index.js or node index. Js cannot remember of the top Of my head and when I run it it says my command has no name or function when it does...

Can't get this to work Interaction failed discord.js

I've been coding a discord ticket bot that opens a private channel with a user after they've opened a ticket, I've also added an advanced setup system that works just fine. However I'm not able to figure out why the bot is not creating a ticket after clicking on the Create Ticket button (Video showcase below). I've spent hours trying to figure out but I couldn't fix anything. Please help. Heres the code: https://github.com/ScremerMemer/Advanced-Ticket-Bot Video: https://www.youtube.com/watch?v=_6ZS_IC780c&ab_channel=Saket...

djs v14.16.3 - unknown interaction

so ive got this weird problem, when i'm developing the bot local everything works fine, but when i deploy it to my server to host the bot, i get unknown interaction errors for every command, button, select.

djs 14.16.3 - voiceStateUpdate - what do "sessionId" changes mean?

Hello, I have asked this in #djs-help-v14 before and someone replied, but never got an actual answer. I've got pretty much all voicestateupdate events coded; join, leave, switch, mute, deaf etc etc etc with an else { } to console log if something else happens, and it did. ...

Making a bot - COMPLETELY new

have no idea where to start, i have a chatbase bot that works on chatbase (an ai website thingy) and i want to link a discord bot so you can talk between discord and the website

Cannot run node.js

Below is the error I’m getting when running node index.js “node:internal/modules/cjs/loader:1252 throw err; ^...
No description

Interaction has already been acknowledged

Hi, I am making a Discord bot which utilizes interactions and message ids. Basically, whenever a message id is supplied into a command, it should currently reply back with the name of the channel which the command was run in. However, if the id is invalid, it should reply back with an error message. Unfortunately so, the bot does reply with the channel name everytime the command is ran (regardless of the validity of the message id), and if the message id was invalid it just throws an error into the console, which goes as follows: ```js...

Following a tutorial from 2020 and unsure of how I'm supposed to define Intents.

I'm following this tutorial by Sethey17 to make a simple Discord bot for my server that would be able to bulk delete messages in response to a command. https://www.youtube.com/watch?v=fx6oJ4PQDOs I'm on step two and I keep getting the following error when I try to run the code in the terminal. I've checked the code for typos and used JSHint. ...

Discord.JS First Slash command guide not working

when I use the /ping command I get "The Application did not respond in time": I have deployed the deploy-commands.ts code and it ran successfully. Here is my code for my ping.ts command: const { SlashCommandBuilder } = require('discord.js');...
No description

Property 'SoundboardSoundCreate' does not exist on type 'typeof AuditLogEvent'

if(untypedLog.action !== AuditLogEvent.SoundboardSoundCreate) return; // Property 'SoundboardSoundCreate' does not exist on type 'typeof AuditLogEvent'.
if(untypedLog.action !== AuditLogEvent.SoundboardSoundCreate) return; // Property 'SoundboardSoundCreate' does not exist on type 'typeof AuditLogEvent'.
any ideas?...