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

`MissingPropertyError` when making a select menu

I'm having a problem with making a StringSelectMenu; discord.js seems to insist that the menu I'm making is missing the label and value properties required of select menu options, but based on the builder, both of these should be there. My Code: ```ts // DenyReasonMenuSelect.ts...

I fucked up. literally

okay so i have made a bot in the past that didnt had slash commands. i literally quitted coding for 3 years. then i came for but i realised i can just transport my entire code into slash commands. so it would be way better right? like people dont have to know what is prefix, or what to write. anyways, i wrote the code in like 2 days. i refreshed the bot token. it says unauthorized. what did i do wrong you may ask. the bot doesnt have permission to create slash commands. i dont know what to do ri...

[CLOSED] Question regarding Unicode and Custom emojis

Hi! Anyone knows if discord.js offers a way to check if an emoji/string is a valid discord unicode emoji and not a custom one? The only solution I found so far is by checking if this emoji map contains the emoji string: https://gist.github.com/Vexs/629488c4bb4126ad2a9909309ed6bd71 What is a better way to do this? Much love! <:Panda_Love:1116299125705687062>...

Unmute button not working

So I have a button (end stage) which converts a stage into a voice channel: - Makes the voice channel - Moves users into that voice channel - Deletes the stage ...

How to convert code to js14?

Code is // Import required modules const { Client, Intents } = require('discord.js'); // Create a new client with necessary intents...

Where are the docs

yesterday when i entered discord.js.org i was redirected to the wiki for discordjs/@core. but now wherenever i go on there i get the old docs. is the discordjs/@core still under development or why do i get redirected there. it would be great if you guys would settle on one library and keep it that way

Forum Tag Listener

Is there a way to make a listener which listens to Forum tag changes? Use-case: I have a help forum. When someone edits the forum tags to mark is as answered (instead of using a /solve command I've added), I want the bot to send a message in the channel...

how to set my bot status to "watching"

Constants.ActivityTypes.GAME, this makes my bot status to "playing" , i want it to be "watching how?"...

TypeError: Cannot read properties of undefined (reading 'isChatInputCommand')

idk what happened, it was working fine, then I added client parameter what it was: ```module.exports = { name: Events.InteractionCreate, once: false,...

sending messages code problem

I wrote some codes that sends a image 'sendthis.jpg' to the chat if there's no messages for 45 minutes. ```js require('dotenv').config(); const { Client, Intents } = require('discord.js');...

guild icon url not working

so basically i'm having problems with fetching the icon URL of a guild, this is my code and it's giving me this error. I tried with displayAvatarURL also for a user command and that gives me a similar error where it doesn't spit out an actual string with the URL. any help?

Context Menu

Hey, I'm trying to register context menu commands but not sure how. I've a command handler that sending a put request to discord with a set of comamnds, and it does work well, but im not sure how to do that with the context menus.. example of a menu event file: ```import type { ContextMenu } from '@/types/discord'...

[TS] Argument of type 'GuildMember | APIInteractionGuildMember | null'

full error ``` [Event: ready] [Uncaught Error] src/cmds/me.ts:11:36 - error TS2345: Argument of type 'GuildMember | APIInteractionGuildMember | null' is not assignable to parameter of type 'GuildMember'. Type 'null' is not assignable to type 'GuildMember'. ...

Questions about editing ephemeral embed messages

I am working on editing ephemeral messages but I don't know how to. I dont understand how
interaction.editReply
interaction.editReply
works. I am using a button to try and edit the message...

discord.js soon deprecated by @discordjs/core ?

hey, i wanted to ask if discord.js will be deprecated soon and /core will become the "new" discord.js, because then you would have to reprogram your complete bot

Cannot read properties of undefined (reading 'applicationGuildCommands')

i keep having the problem Cannot read properties of undefined (reading 'applicationGuildCommands')

idk what

wtf, why??? how to fix it? Why is it like that?

Autocomplete + Other options involved that make the autocomplete dependent on those option values

Am I able to get the waiting values of the slash command options to be used for the autocomplete? I have a channel option and user option, and depending on those the string option with autocomplete should change. So, I'm not sure if it's that the options are considered to have values when the slash command is still under process. Is there any way I can make it so the autocomplete options depend on the other options if the other options are being used as well? Using Discord.js 14.11.0 node 18.13.0...

Property 'cmds' does not exist on type 'Client<boolean>'

It's my first time using TypeScript with discord.js & express, I used some of my JS knowledge and it is causing an error now. (if it isnt fixable then what would be the best way to approach slash command handlers on TypeScript) ``` C:\Users------\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:859 return new TSError(diagnosticText, diagnosticCodes, diagnostics);...

Error when creating embed

I'm getting the following error when trying to create an embed. My main goal is to let the user enter the name, select an image and unix time to create an embed. ```[29.07.2023 16:56.55.954] [ERROR] Error creating embed: Received one or more errors [29.07.2023 16:56.55.955] [ERROR] Error details: CombinedError (3) Received one or more errors...