#djs-help-v14

78874 messages · Page 9 of 79

ivory valve

Hello,

I have a question related to the GuildMemberUpdate event: sometimes when a member modifies his nickname, my verification doesn't work even though no role has been added. Could this be due to the cache being emptied after a while, for example? Would it be possible to check the user's roles in oldMember?

data: {
  name: Events.GuildMemberUpdate,
  once: false
},
async execute(client: Client, oldMember: GuildMember | PartialGuildMember, newMember: GuildMember) {
   const oldMemberRoles = oldMember.roles.cache;
   const newMemberRoles = newMember.roles.cache;
   if (oldMemberRoles.size === newMemberRoles.size) return;

   console.log('roles edited'); // Logs when a member change his name
}
zenith violet

so the only thing present is its id

ivory valve

D:

rose tangle

also guild member update also triggers for other things, not only roles updates and nickname changes

it also triggers for timeouts for instance

but not timeout ends

ivory valve

In our case we only observed this for changing pseudonyms
I'm going to remove the partials users to limit this

if fetches were added every day, the problem could be solved, for example?

rose tangle

do you have the GuildMembers privileged intent?

ivory valve

yep

steel trail
ivory valve

Okay, that's what I did 👍

flint zenith

do i need to use .toJSON() method while sending rows with buttons normally?

sharp ginkgoBOT

tag suggestion for @flint zenith:
In TypeScript the ActionRowBuilder class has a generic type parameter that specifies the type of component the action row holds:

const row = new ActionRowBuilder<ButtonBuilder>().addComponents(button)
const row = new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(selectMenu)
const row = new ActionRowBuilder<TextInputBuilder>().addComponents(textInput)
halcyon bison

(if this isn't the type error, please share the error)

flint zenith

no, i don't use ts, i use type: module, the esm one

halcyon bison

then please mouse over row and share what your ide is trying to tell you

halcyon bison

that definitely looks like a type error
but if you really aren't using typescript, sounds like you can ignore this

flint zenith

ahh okay

sage igloo

quick question guys, can we open another ModalBuilder() after submitting a ModalBuilder()? cuz ModalBuilders can't have more than 5 questions right?

halcyon bison

no you can't chain modals, there needs to be some intermediary interaction between
that's correct that modals cannot have more than 5 text inputs

sage igloo

gotcha. Thanks duck ❤️

rigid crest

like setColor i could use #abc123 which i found easier, i mean to me it would of made sense if components also had used setColour instead of accentColor but ig thats just a personal preference

rose tangle

ask discord

that's how they named it, embeds have color, containers have an accent color

halcyon bison

also you can always use a hex literal (e.g. 0xabc123)

rose tangle

if you're asking for the reason why setAccentColor doesn't accept a hex string, that's a separate thing

and it's probably because of djs moving away from extending (and modifying) classes from /builders, but it'll still re-export it

because setColor's hex string functionality came from djs, not the builder itself from /builders

loud quartz

(so it moved onto re-exporting /builders, instead of extending /builders in select cases AD_Giggle_1 )

sharp ginkgoBOT
steel trail

You can do the conversion yourself with 👆 though

solid summit

guys in my code it's deleting other role sometimes, any reason why its happening?

zenith violet

also roles dont need fetching

they are cached by the Guilds intent

solid summit

my db queries seem ok too, i think

rose tangle

that code in particular should only delete one role, not many

so at least the djs part is correct

zenith violet

so seems like you're passing an incorrect role id

vague echo
rose tangle

I wouldn't say djs' code is cursed, at most only the structures and actions loading part

vague echo

djs code isnt cursed, its cursed by the person who writes it xD

solid summit
rose tangle
solid summit

the role which is being created is the custom role

quick grail

can you get the clan of a user in discord.js? (referring to their server tag)

zenith violet

no

sharp ginkgoBOT

discord.js does not support features until they are officially documented.
While there might be a way for these features to work, it can change at any time without any notice

dense jackal

and tags are still in experiment, so not documented

steel trail

guildMemberUpdate for listening to the event itself. Reason is only in AuditLog

sharp ginkgoBOT
zenith violet

check if that changed

wary coral

Is there a way to get the join date of a user who leaves when the event is a partial? Typically I would fetch the user but when they leave the guild I don't believe I'm able to fetch them anymore. Is there any work around other than saving all of that information external from discord's API?

zenith violet

No, you have to save it yourself

wary coral

Darn, thanks

raven cedar

how do you get the online/idle/offline status of a user id?

snow onyx

you need the GuildPresences intent, then <GuildMember>.presence.status

sharp ginkgoBOT
raven cedar
snow onyx

yeppers

JarJarYes

raven cedar

👌

raven cedar
unique shoal

Not exactly, no

topaz bluff
unique shoal

The status is never null

The presence entirely can be

topaz bluff

^ ya that's what I was getting at...I explained it poorly

unique shoal

All good

raven cedar

so how can I check if a member is offline?

unique shoal

You'd have to fetch them withPresences

hushed mirage

is there any way to make mentions in containers not ping users?

unique shoal

The same way you do so in any message, the allowedMentions options

raven cedar
unique shoal

That is not using the withPresences option

sharp ginkgoBOT
unique shoal

I cant remember how it works on a single fetch sorry

loud quartz

single member should come with presence as long as you have the intent

or, well, it might also always come with presence

just that without the intent everyone will be permanently offline

unique shoal

? deleted message

loud quartz

without the guildpresences intent discord always sends everyone as offline ah

raven cedar

I have the intent, it's just that my code doesn't work when fetching someone who is offline

loud quartz

doesn't work in what way

unique shoal

Well its called a presence and if they're not present

raven cedar
loud quartz doesn't work in what way

My code works fine for online/idle/dnd users, but if they're offline I get the error:

return await member.presence.status;
                             ^
TypeError: Cannot read properties of null (reading 'status')
async function memberStatus(id) {
    const guild = await client.guilds.fetch(server_id);
    const member = await guild.members.fetch(id);
    //console.log(member);
    return await member.presence.status;
}```
loud quartz

ok, well yeah

?. operator comes useful for presences a lot

unique shoal

Yeah this error says that member.presence is null. They are not present, have no presence

loud quartz

if someone was never not-offline since your bot started up, the member.presence is null

if they stop being offline, they will have something there

even if they return to being offline

just double checked myself on my alt

raven cedar

okay thanks, I can now return online/idle/dnd/offline/undefined states without error using the ?. operator

async function memberStatus(id) {
    const guild = await client.guilds.fetch(server_id);
    const member = await guild.members.fetch(id);
    //console.log(member);
    return await member.presence?.status;
}```
loud quartz

there's no reason to await that status there

and also no need to fetch the guild either

raven cedar

where would I get the guild then?

loud quartz

from cache

if you have the guilds intent (without which half of d.js doesn't work), all guilds are in the cache

compact swan

so I am using
if (msg.interaction?.commandName === 'abc') but intellisense is telling me that it is depracated and to use Message.interactionMetadata instead,
how do I get the command name now?
cause Message.interactionMetadata doesnt have commandName as property

loud quartz

correct. discord doesn't document it there

pretty much the best you can do is keep using what you're using while it works

compact swan

and in future, how do I know if a message was a response from an interation command from my bot

loud quartz

because your bot authored it, and there is some interaction metadata on it

compact swan

hm okay ill see what i can do

wary coral

Also It will have a messages.type of 20(CHAT_INPUT_COMMAND) or 23(CONTEXT_MENU_COMMAND) I think

rose tangle

using the command name isn't a good approach for that either way

another bot can have the same command name you have

loud quartz

well, it tends to be a combo of author (bot xyz) + command name

and the latter is now essentially going away

so you can tell that someone used an interaction and that the bot xyz responded, but not really much beyond that.
gets slightly easier if it's your own bot, but then in this case, if you really need this, you can also just store this info on your end. interaction id is actually in the metadata and whatnot, and you should absolutely have access to that same id while handling that very interaction in your code, so chucking it into a db is pretty easy

sudden cedar

is there a way to fetch multiple users in one call

using /core

bleak owl

not that i know of, no

sudden cedar

ok ty

vital barn

if i wanted to compare the member cache to the most up to date information id have to store the cache somewhere and then fetch since fetch also refreshes the cache correct?

unique shoal

You can tell fetch not to cache

vital barn
unique shoal

yeah

thin cosmos

How can I check if the bot has an array of permissions? Previously permissions.has used to accept Array but I think that may have been changed.

steel trail

No it hasn’t

sharp ginkgoBOT
sage igloo

quick question regarding this, When I was using discord.js@13.7.0 I used to build Modal() s using discord-modals@1.3.7 (discord.js@14.19.3 : ModalBuilder()) and that package gave us TextInputComponent & SelectMenuComponent. Why can't we use SelectMenus now?

crimson gale

i don't understand the context of that question, but modals simply do not support any components apart from text inputs

if you want support for specific third party stuff like discord-modals, ask their devs i guess?
we support that stuff natively after a short time every time. if you want to use third party libs, go ahead, but that has nothing to do with us

sage igloo

No no that’s not what i meant sir, did discord or discord.js downgrade modals or something?

stable sun

Iirc, it never actually did anything (aside from showing the menu in modal)

crimson gale

oh, discord had a short period where you could send selects, yes

that's why we wait for stuff to be documented (or us getting other information from discord directly) before releasing updates

sage igloo

Oh okay that’s what i need to hear :D thanks guys, appreciate you both ❤️

novel pendant

can i display two modals right after each other

can i display two modals right after each other

dense jackal

no

no

raven cedar

Hey is there any event like guildMemberAdd, but one that is triggered after a new user completes the onboarding screen?

zenith violet

isCommand includes context menus

sharp ginkgoBOT

guide Other Interactions: Context Menus
read more

unique shoal

yeah

snow onyx

yes

raven cedar
zenith violet

the newMember is the updated member

the oldMember is the member before the update (if they were cached)

sacred torrent

yo wsg I need some help with the new components

so I'm trying to make a section in a container and for some reason it won't let me put it directly into the container I'm a little confused about this and I can't seem to find the document where it explains it in a way that I understand

I'm really new to coding so it might be a dumb mistake

Luna I know you are good at this stuff(better then me) can you take a look?

sharp ginkgoBOT
snow onyx

thats what you need to use, not addTextDisplayComponents

sacred torrent

im still so confused really new to this

I tried to put it in the sectionbuilder and it didn't work got a error

???

snow onyx

what?
You are supposed to use addSectionComponents() on the ContainerBuilder if you want to add sections to it.
If you want to add TextDisplayBuilders, you use addTextDisplayComponents() respectively.

not on the SectionBuilder

sacred torrent

oh..

AH in the container that makes sense okay ofc why am I trying to make a section within a section

obsidian rain

💀

sacred torrent

Im really smart guys
trustttttt

sacred torrent

it worke

worthy edge

is there a way to accurately get the amount of users online in a server, i have tried but even when changing my status to invisible, it still counts my user as online

        await message.guild.members.fetch({ force: true });


        const online = message.guild.members.cache.filter(member =>
            member.presence?.status !== 'offline'
        ).size;
worthy edge

yeah

snow onyx

pretty sure you need to add withPresences: true to the fetch?

sharp ginkgoBOT
sacred torrent

I DID IT IT WORKED

thanks @snow onyx(giving me usefull documents) and @loud quartz(telling me to stop using AI and just do it myself) for the help

sorry for the pings if you guys don't like that

toxic magnet

Hum... Hello ?
I need know how a bot can listen to the prefixed commands "!" in MP. Mine normally reacts in text room as seui-ci but in MP nothing, the console is empty, it detects nothing.

sacred torrent

this is supposed to be a menu so that people can choose roles iin the information channel to keep it more compact

how do I build that in/outside my container I think i'd rather have it outside but I'm assuming the pricibles is stil the same I found something called SelectMenuBuilder but I can't find documentation on it

snow onyx
toxic magnet
snow onyx

You also need to add it to the intents you provide when creating the client.

sharp ginkgoBOT
sacred torrent

thanks

toxic magnet

In my "main.js" I have that :

const intents = new Discord.IntentsBitField(53608447)
const bot = new Discord.Client({intents})```
loud quartz

and what does the number mean?

toxic magnet

For this number, I have activate everything in "Discord Intents calculator"

A website.
Sorry, my english is not good I know.

sacred torrent

like this?

toxic magnet

I don't understand.

sacred torrent
sharp ginkgoBOT

tag suggestion for @toxic magnet:
We highly recommend only specifying the intents you actually need.

  • Note, that 98303, 32767 or whatever other magic number you read that represents "all intents", gets outdated as soon as new intents are introduced.
  • The number will always represent the same set of intents, and will not include new ones. There is no magic "all intents" bit.
viral quest

Hey, my discord bot is not connnection to gateway and when I ping discord I get a 1015 so rate-limit from cloudflare (I think), how long can these take?

loud quartz

we have no idea

we're not discord

viral quest

Well people might have experience with it

rose tangle
rose tangle
loud quartz
sacred torrent
viral quest

Will do

loud quartz
snow onyx
sacred torrent

yes i've been getting this issue the entire tiem

loud quartz
rose tangle
sacred torrent
toxic magnet
rose tangle

you are using a number so it is your problem

snow onyx

for dms you need the Channel partial as well

sharp ginkgoBOT

guide Popular Topics: Partial Structures
read more

sacred torrent

I can't aswner all of you at once so I'll do it all in this message(I BLAME SLOWMORE)

tipaka is not souji didn't know it was so important to have mentioned it as it seemed pretty clear wouldn't ask if it was fine if I didn't know it wasnt

amgelo yh I remembered myself that I had to do it but forgot

Now then the issue

it's still saying that something is wrong and this time I have no cleu

snow onyx

and as we said before, you need to put the select menu in an action row

sharp ginkgoBOT
rose tangle

it is now, problem's the generic

sacred torrent

isn't it in a action row?

sharp ginkgoBOT

In TypeScript the ActionRowBuilder class has a generic type parameter that specifies the type of component the action row holds:

const row = new ActionRowBuilder<ButtonBuilder>().addComponents(button)
const row = new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(selectMenu)
const row = new ActionRowBuilder<TextInputBuilder>().addComponents(textInput)
sacred torrent

ah so Ihave to refer to the string selectmenubuilder with <>

thanks @rose tangle

steel trail
sacred torrent I can't aswner all of you at once so I'll do it all in this message(I BLAME SLOW...

Showing the error instead of asking „is this fine“ means we don’t need to read your whole code (and assume what you do with that code) and instead can point you to what common reasons for your error are (especially since your error came from a line that you didn’t even show us in your code). That‘s why it’s important.
And no, it‘s not clear at all, people ask if their code is correct instead of actually running it to try here quite a lot.

loud quartz

and from the other direction - why ask if it's fine if you genuinely already know it's not fine. you're essentially hiding the fact that you already know it's not okay and it errors and make us have to figure out if it does while all the time you already know it, just didn't say it

sacred torrent

im very smart 👍

(but yh yalll right sorry for the confusion)

imma just ask the question and the asnwer is most likely YT but I'd still like to ask first

I'm trying to make it so that if you click a button you get sent another container/embed with specific information in this I'm assuming I will need to make new files specfically for that but I'm not quite sure how I would go about doing this can anyone give tips?

steel trail

If the button is supposed to work indefinitely then you should handle it in interactionCreate event. If you have lots of different buttons a dynamic handler similar to the one for commands would be advisable. It it‘s only one single (type of) button then you can handle it directly.
If the button is however only supposed to work for a short period of time then using a messageComponentCollector in the file that sent the button would be better

rose tangle

and the answer is never yt

at least not from us

burnt quartz

is it possible for bots to know if a user specified through a slash command user input is in the group dm that the command was run from?

steel trail

No

rose tangle

you could make it a user context menu command so then they can only use it on users that are on the dm group

but then you won't be able to input any other options

if they're strings, a modal could work for that though

sacred torrent

alright that's nice then Imma just explain what needs to happen so you guys can tell me how to best go about it

The way I have my information thing set up is as a command so when I type /send information it sends the information then you had /adminsend information for one without ephemeral as there is a specific channel for information as well

Now then let's move to the multiple buttons:

I will have multiple different containers/embeds where within it you will have buttons which would send embeds/containers with specific information such as for events there is a format I want that to be in a button with a role requirement so it doens't just get sent randomly when anyone clicks on it

The problem is I have no idea how I would best do this last time chatgpt wrote me a interaction create file what did the trick but I'd like to write the code myself this time and make in infinitly scalable incase I need to

(also I will read the responses later got a headach)

burnt quartz

its just for a command where you play a game with someone else. in servers it works so it just replies saying the user isnt in the server if you try select someone not there. i guess in dms it will just have to create the game even though it wont be playable with them

rose tangle

you could mention the other user asking them to press a button to confirm

burnt quartz

at that point its just adding extra friction, doesnt really hurt to have the game start but just time out

its probably rare anyway that someone mentions someone not in the group dm, as i think you need to manually enter their user id into the command option

anyway thanks for the quick response

alpine wadi
import {
  MessageFlags,
  TextDisplayBuilder,
  ChannelSelectMenuBuilder,
  ActionRowBuilder,
  SectionBuilder,
  ContainerBuilder,
} from "discord.js";

/**
 * @type {import("../../../index.js").Mcommand}
 */
export default {
  name: "welcome",
  description: "Setup welcome system in your server",
  userPermissions: ["ManageGuild"],
  botPermissions: ["SendMessages", "EmbedLinks"],
  category: "Welcome & Leave",
  cooldown: 5,

  run: async ({ client, message, args, prefix }) => {
      const container = new ContainerBuilder();
      
    const textComponent = new TextDisplayBuilder().setContent(
      "Example"
    );
    
    const channelSelectMenuComponent = new ChannelSelectMenuBuilder()
      .setCustomId("Channel")
      .setPlaceholder("Select a channel...")
      const channelActionRowComponent = new ActionRowBuilder().addComponents(
      channelSelectMenuComponent
    );
    
    const containSection = new SectionBuilder().addTextDisplayComponents(textComponent).addActionRowComponents(channelActionRowComponent)
    
    container.addSectionComponents(containSection);
    
    await message.reply({
      flags: MessageFlags.IsComponentsV2,
      components: [container],
    });
  },
};

An error occurred while processing messageCreate event: TypeError: (intermediate value).addTextDisplayComponents(...).addActionRowComponents is not a function

turbid igloo

so if I try to dm message author,
after dming
and my next line of code is
await message.member.roles.add(findrole);
Is there any problem? here

or like will it change from guild to dm

polar karma

Depends on what message is

The best thing to do is try it

topaz bluff
alpine wadi
topaz bluff

You can't in a section. A section is a text component and a button or thumbnail

Just pass the action row directly to the container

alpine wadi

Ok ty

topaz bluff

So instead of using a section at all, just pass your TextDisplay and ActionRow directly into the container. Don't use a Section

turbid igloo

yes did got dmed.

polar karma

That error doesn't match the code you provided

You should also be posting the full error including stack

turbid igloo
polar karma You should also be posting the full error including stack
node:events:496
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read properties of null (reading 'members')
    at Client.<anonymous> (C:\Users\cutea\OneDrive\Desktop\asterism\index.cjs:92:34)
    at Client.emit (node:events:530:35)
    at MessageCreateAction.handle (C:\Users\cutea\OneDrive\Desktop\asterism\node_modules\discord.js\src\client\actions\MessageCreate.js:28:14)
    at module.exports [as MESSAGE_CREATE] (C:\Users\cutea\OneDrive\Desktop\asterism\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\cutea\OneDrive\Desktop\asterism\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
    at WebSocketManager.<anonymous> (C:\Users\cutea\OneDrive\Desktop\asterism\node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
    at WebSocketManager.emit (C:\Users\cutea\OneDrive\Desktop\asterism\node_modules\@vladfrangu\async_event_emitter\dist\index.js:282:31)
    at WebSocketShard.<anonymous> (C:\Users\cutea\OneDrive\Desktop\asterism\node_modules\@discordjs\ws\dist\index.js:1173:51)
    at WebSocketShard.emit (C:\Users\cutea\OneDrive\Desktop\asterism\node_modules\@vladfrangu\async_event_emitter\dist\index.js:282:31)
    at WebSocketShard.onMessage (C:\Users\cutea\OneDrive\Desktop\asterism\node_modules\@discordjs\ws\dist\index.js:988:14)
Emitted 'error' event on Client instance at:
    at emitUnhandledRejectionOrErr (node:events:401:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:92:21)

Node.js v22.14.0
[nodemon] app crashed - waiting for file changes before starting...

umm

polar karma

What's line 92 of your index

turbid igloo
polar karma What's line 92 of your index
  const user =
  (message.mentions.members && message.mentions.members.first()) ||
  (args[0] ? await message.guild.members.fetch(args[0]).catch(() => null) : null) ||
  message.member;
polar karma

Looks like message is a DM there, not in a guild. You need to check for these things first

turbid igloo
wary coral

to check if guild/ not DM I recommend using message.inGuild()

chilly spruce

What permission corresponds to accepting member applications? Is it available in discord.js

wary coral
chilly spruce
wary coral
chilly spruce
wary coral

sorry, I was answering you second question is it in d.js. on sec while I find the permission

zenith violet

applications arent documented

chilly spruce
sharp ginkgoBOT

discord.js does not support features until they are officially documented.
While there might be a way for these features to work, it can change at any time without any notice

wary coral
chilly spruce
halcyon bison
turbid igloo so if I try to dm message author, after dming and my next line of code is `awai...

I'd just like to clarify since this was your original question
is message the dm you send?
if so, it seems a little silly to check if it's in a guild

or like will it change from guild to dm
this seems to suggest you have something that ties this logic to a guild, so without seeing more of your code, I'd have to guess you could be overcomplicating things
(and to further elaborate, a message sent in a guild won't suddenly change to dm)

torpid elm

Hi, idk if its a known issue but I'm displaying a modal after a button interaction, and the modal interaction customId is the same as the button customId it was generated from (both button and modal have a different customId in code)

zenith violet

show your code

turbid igloo
shadow harness

This should be a stupid simple question... What's the name of the gray text boxes that have layouts and such? I only ever see them sent by bots, and want to make my own. I'll do the research, just needa know what they're called. (not modals)

topaz bluff

Embed or the new style is ComponentsV2 (in particular, a Container)

halcyon bison
torpid elm
sharp ginkgoBOT

To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.

wary coral

you are not making a comparison on line 18 and 22. use === insted of =

torpid elm

Oh bruh, thks tho

wary coral

np

vast bloom

does message.createMessageComponentCollector or whatever it is not work with components v2

wary coral

I dont see why it would not

vague echo

Is there a newer version of the Discord API than v10 rn?

vast bloom

sorry nevermind turns out i had the timeout in seconds instead of miliseconds

(forgot to do * 1000, i had it set to 20 * 60)

vague echo

ouff xD

vague echo
obsidian rain

Is this a known issue?
Custom emojis work with slash commands (left), but not with just message.send (right)
Same situation both using bot owned emoji or server owned emoji.

The code is same

radiant epoch

How can I show file inside container? MediaGallery? I can show images with getting URL of them but what about files?

sharp ginkgoBOT

documentation suggestion for @radiant epoch:
class FileBuilder discord.js@14.19.3

wary coral
steel trail
topaz bluff
obsidian rain
steel trail It looks like the link markdown is invalid in the second example. Is there a lin...
let cacheDataX = await db.getDataFromModCache(79021);
const modContainerX = await makeModUpdateContainer(cacheDataX, 24);
await interaction
  .followUp({
    components: [modContainerX],
    flags: MessageFlags.IsComponentsV2,
    allowedMentions: { parse: [] },
  })
  .catch(async (error) => {
    await postErrors(error);
  });
const cacheData = await db.getDataFromModCache(79021);
const container = await makeModUpdateContainer(cacheData, 24);
message.channel.send({
  components: [container],
  flags: MessageFlags.IsComponentsV2,
});

Both uses same code.

(The numbers are fixed just for testing)

sage igloo

guys, Why am i not getting suggested the list of ALLOWED_SIZES?

😐

zenith violet

or what is discord defined as.
not to mention js doesnt have autocomplete, and ALLOWED_SIZES is an empty array

obsidian rain
sage igloo
obsidian rain
sacred torrent

Do I need to use sections to utilise seperators or can I just do text, seperator, text, seperator?

vague echo

component limit got raised to 40 right?

sacred torrent
vague echo
sacred torrent

Damn thgat's a lot there probably is a limit on something else but who knows

vague echo

but somehow my terminal still says limit is on 10 and idk why

obsidian rain
vague echo
karmic nexus

How can I get information about a member's clan tag?

steel trail

Answered in a post already

karmic nexus

I see, thanks

raven cedar

If I want to send a message when a user completes the onboarding and picks a certain role, would this code be correct? Nothing seems to happen.

client.on("guildMemberUpdate", async (oldMember, newMember) => {
    if (oldMember.pending) {
        await sendMessage(chanTest, `pending ${newMember}!`);
    }
    if (oldMember.pending && newMember.roles.cache.has(roleId)) {
        await sendMessage(chanTest, `Welcome ${newMember}!`);
    }
});```
abstract flint

guys in discord.js what's better between commonJs and ES6 modules?

wary coral

Components V2

zenith violet

the source code is literally attached....

you even circled it

lucid forge

my english is bad, thanks you

zenith violet

and second, oldMember might be a partial, in which case the event doesnt fire (or emits with partial data if you have the partial)

@lucid forge dont delete your messages, it messes with support flow

lucid forge

👍

sacred torrent

you can do a lot of awsome stuff with it

raven cedar
zenith violet

yes

which is exactly how you check if they passed onboarding

willow cedar

i have a buffer and i created an attachment from it, how do i use the attachment in an embed with .setImage?

zenith violet

they can only interact with the server and bots after onboarding

sharp ginkgoBOT

tag suggestion for @willow cedar:
Files in embeds should be attached via the message option object and referenced in the embed:

const attachment = new AttachmentBuilder('./image.png', { name: 'image1.png' });
const embed = new EmbedBuilder()
  .setTitle('Attachments')
  .setImage(`attachment://${attachment.name}`);

channel.send({
  embeds: [embed],
  files: [attachment]
});
willow cedar

will it be saved in the codebase?

raven cedar
zenith violet
willow cedar
zenith violet

which files

willow cedar

./image.png

zenith violet

thats the image you want to send

can be a buffer too

willow cedar

oh

thanks

raven cedar
zenith violet

thats just basic boolean checking

but yes

wary coral

I like your version better

zenith violet

a simple comparision works though

wary coral

guildMemberUpdate can fire before pending is false due to server onbobaring adding roles

zenith violet

if you do that you shouldnt be using onboarding regardless

wary coral

When a role is added to a user during onboarding does it not trigger guildMemberUpdate

zenith violet

it does but it bypasses onboarding

or well, used to, idk how it works now with those roles

wary coral

first it does not by pass onboarding. second I am referring to onboarding assigning a role

zenith violet

shrug no clue then

raven cedar
wary coral

guildMemberUpdate is correct. or attest that is what I use

I check that oldmember.pending is true(it could be null if using partials) and that it does not match newMember.pending

abstract flint

hello guys in discord.js what's better between commonJs and ES6 modules?

bleak owl

that is ultimately your choice

discord.js fully supports esm

steel trail

Although there is now no reason I could think of to use commonjs for new projects in NodeJS

abstract flint

Alright, it's more modern syntax, so way better

shadow harness

How do I find the selected option from a StringSelectMenu? Using the method I've used with buttons (customId) returns the ID of the select menu, where can I get the value?

sharp ginkgoBOT
shadow harness

@steel trail Thanks mate, sometimes TS is really a bitch

steel trail

Huh? It really isn’t. Sounds more like you forced it to be a type it wasn’t

bleak owl

let’s keep the comments to ourselves

shadow harness
steel trail

Makes sense, because it could be a button instead

uncut quest

Is there a way to make a sort of Inline text for the containers like we can do in embeds ?

Something looking like ... i dont know .. addInlineTextDisplayComponents() ... or something else

vital barn

no you can't do that

sacred torrent

yo so I'm making buttons in my webhook and in discohook they were able to make it so that it first checks if you have specific roles and if you do then sent a specific webhooks example:

Person A has sr. mod he clicks on the button for information he gets information for senior mod stuff
Person B is a trial mod he clicks on the same button but instead gets information tailored towards his position

how would I best do this?

vital barn

this is not discohook support

sacred torrent

Im aware

im coding it myself I'm using discohook as example because they do something similar to what I want to achieve

zenith violet

check the roles of the member

sharp ginkgoBOT
sacred torrent
zenith violet

respond based on which role they have

sacred torrent

hmm where would I put that would I just put that in the buttonbuilder or would I put that in the interactioncreate?

wary coral
sacred torrent

makes sense

I just don't get where I would put it in general but I'll figure it out

obsidian rain

Turns out there's other working emojis in the same container 💀
Just the link emojis doesn't work

orchid latch

HI everyone I have some questions concerning DM channels:

  • When you fetch a user with let user = await client.users.fetch(userId); does the returned user automatically has a DMchannel available ?
  • Is checking for if (user.dmChannel) is enough to ensure I can send a message to the user ?
  • And does using user.createDM() is mendatory before using user.send() or do they behave the same ?

(I use the latest v14.19.3)

little pebble

<User>.send calls <User>.createDM internally so just use <User>.send() and it'll create the DM if needed

hexed marsh

How do I update my components to use the new 14.19.X stuff?

  return msg.components.some(row =>
      row.components.some(component => {
          if (!component.customId) return false;
          if (!component.customId.startsWith('button:deleteQuest:') && !component.customId.startsWith('button:delete:')) return false;
          const componentData = ComponentData.fromCustomId(component.customId);
          return componentData.discordUserId === discordUserId;
      })
  );

Are we supposed to do a conditional check on the .type and then cast it to the new ComponentTypes?

unique shoal

Im not sure what you mean

None of the old components have changed

Buttons are still buttons

hexed marsh

Well for example previously msg.components is a nested array of components within components. I think I explain that right. Anyway the code I posted above is going through each "ActionRow" and checking each "Component" property, but given the new type is TopLevelComponent[] instead of ActionRow<..> there isn't a "component" property on it any longer unless I explcitly cast it to the ActionRow component type.

unique shoal

It shouldnt be necessary to cast if youre checking the type, but TS always won't cast an array reference I did it wrong

oh actually yes it will, my bad

hexed marsh

Okay yeh so you're comparing the type property... that seems.. excessive asf

unique shoal

Thats TypeScript

How else would you do it

hexed marsh

Not create a union type xD

unique shoal

uhh

How exactly?

hexed marsh

🌈 Type Erasure? 🌈

unique shoal

No idea what you mean, sorry

hexed marsh

Ooof I shall embrace the suck lol

No easy way to do it without actually submitting a contribution and I'm sure they have their reasons of which I know nothing about lol

I'd be barking up the wrong tree haha.

unique shoal

I have no idea what youre even proposing as an alterative lol, this is the correct way to strictly type things

The alternative would be to say its an array of BaseComponent or something which would just have all the same issues, since it also wouldnt have a components property unless you work out which inherited class it is

The union is much easier to deal with

This also works if you dont specifically want ActionRows, but want to check if it has children (so could be Container, Section or ActionRow)

raven cedar
wary coral

Yes, it is working for me here is my expression
oldMember.pending && oldMember.pending !== newMember.pending

slender scarab

by any chance does anyone know if 14.18.0 had a bug sending wrong pings? im not sure if its a me bug or djs

i updated it for now, but its such a random bug, its working fine rn but at times it was just pinging the wrong user

unique shoal

yes it did

slender scarab

omg thankks! i was going crazy thinking its a me bug

feral thunder

Why does it throw this error? The enum "admin" seems to exist for TeamMemberRole on docs?

uneven crater
feral thunder

I see, but isn't it supposed to convert the enum value to the name or does this only work for numerical enums

uneven crater

Pretty sure all enums are numerical enums, TypeScript compiles away the key names.

raven cedar

I'm having the same issue, is it some bug maybe?

client.on("guildMemberAdd", member => {
    console.log(`MemberAdd: ${member}`);
    console.log(`pending: ${member.pending}`);
    sendMessage(chanTest, `joined ${member}`);
});

client.on("guildMemberUpdate", async (oldMember, newMember) => {
    console.log(`MemberUpdate: ${newMember}`);
    console.log(`oldMember.pending: ${oldMember.pending}`);
    console.log(`newMember.pending: ${newMember.pending}`);

    if (oldMember.pending !== newMember.pending) {
        console.log('Pending status changed');
    }
    if (oldMember.pending && !newMember.pending) {
        await sendMessage(chanTest, `pending ${newMember}!`);
    }
    if (oldMember.pending && !newMember.pending && newMember.roles.cache.has(roleId)) {
        await sendMessage(chanTest, `Welcome ${newMember}!`);
    }
});

Gives me

MemberAdd: @toxic widget
pending: false
MemberUpdate: @toxic widget
oldMember.pending: false
newMember.pending: false

Pending is always false. I guess I will have to write some custom code that saves the guildMemberAdd user-id to a variable, then compares the user-id of guildMemberUpdate against the variable to determine if it is a new user getting roles.

orchid latch

Is there a Client method that can allow me to display my slash commands as clickable (</slash:id>) in a template string ? (As we can do with emojis for exemple)

clear garnet

Not a Client method specifically, but you can import the chatInputApplicationCommandMention() function from discord.js and use that

sharp ginkgoBOT
hexed marsh

With components V2, what's the appropriate structure to do an inline "Field" and "Value"? For example this code will produce a view that looks something like this, however I'm wanting to in-line additional fields, but I'm not seeing a "Clear" way to do that without creating excessive TextDisplayBuilders...

SomeQuest

User

@inland portal

const containerTitle = new TextDisplayBuilder()
    .setContent(`# ${questName}`)
    
const containerSubtitle1 = new TextDisplayBuilder()
    .setContent(`### User`)

const containerDescription = new TextDisplayBuilder()
    .setContent(`<@${discordUserId}> | \`${displayName} (${username})\``)

const section = new SectionBuilder()
    .setButtonAccessory(deleteQuestButton)
    .addTextDisplayComponents(containerTitle, containerSubtitle1, containerDescription)
    
const separator = new SeparatorBuilder();
    
const container = new ContainerBuilder()
    .addSectionComponents(section)
    .addSeparatorComponents(separator);

const message = await channel.send({
    components: [container],
    flags: MessageFlags.IsComponentsV2
});
rose tangle

or fields at all

hexed marsh

Ouch, so I have to get hacky with sections...

rose tangle

or you could re-think your ui to not use something like fields

like if they never existed

bronze gorge

Does anyone have any cool things they've made with v2?

unique shoal
toxic moat
hexed marsh

Just got through with this using V2 😎

toxic moat
hexed marsh

You can't add group of buttons to sections

toxic moat
hexed marsh

You can only have a single accessory. Basically the wording tells you "add" means multiple, "set" means single.

Oh that is added as an ActionRow, to the containerBuilder.

toxic moat

ohh

that make sense

hexed marsh

I do, already miss, the inline of V1 quite a bit. That feels sooo limiting, but I digress.

unique shoal
toxic moat
hexed marsh

Oh no, you can't send multiple containers in the same message either...

unique shoal

yeah you can?

I do in one of my commands

toxic moat
hexed marsh

nope doesn't work.

This only shows the second container, first is lost to the void.

const message = await channel.send({
    components: [statusContainer, questContainer],
    flags: MessageFlags.IsComponentsV2
});
silver orchid

In components v2 it is possible to place a button below the text, here it only goes to the side.

hexed marsh
toxic moat
rose tangle
crystal cargo

i need to do it like this in v14? (msg.resource.message)

const msg = await interaction.reply({ content: "String", components: [btn], withResponse: true });
const awaiting = await msg.resource.message.awaitMessageComponent({ filter, time: 20000 })```
rose tangle

if you want to use withResponse, yes

and msg is a response, not a message, so that's a missname

hence why you'd do something like response.resource.message.await...

crystal cargo
rose tangle

it's a single api call

fetchReply, as the name implies, fetches the reply in a second call, which was the way to get the message before discord created the with_response parameter

and withResponse won't be removed in v15

crystal cargo
rose tangle

if you use fetchReply yes, the return type will be a Message

if you don't use any of them you can still await in the InteractionResponse but iirc there are some issues with that

crystal cargo

fetchReply will be removed in v15?

rose tangle

yes

every currently deprecated option/method/property will be removed in v15

which includes fetchReply

crystal cargo

what is the difference if it return Message or response

rose tangle
crystal cargo

i mean if i used withResponse , i will be able to use awaitMessageComponent, deferReply and all other feature, right?

rose tangle

where "msg" isn't a Message, it's an InteractionCallbackResponse

crystal cargo

this is new type?

rose tangle

define "new"

crystal cargo

new mean something i see for first time

rose tangle

I don't really know what you have seen

crystal cargo

and if i want to edit the message, i need to do it like this
msg.resource.message.edit({ components: [btn] }).catch(() => { });

rose tangle

but it's been around for like half a year

so not too new but not too old

rose tangle

if it's ephemeral, you need to use editReply on the interaction, but if it's after 15 mins, you need to edit it that way you just shared, unless it's ephemeral

you can't edit an ephemeral reply after 15 mins

it's unlikely any person will have an ephemeral reply still open after that time either way

crystal cargo

if it's not ephemeral, what is the best way to edit it within 15 mins

rose tangle

I'd say you should editReply

it doesn't fall into any route ratelimits, and you'd be re-using the interaction token which is the expected way you should edit

crystal cargo

editReply works with Message or InteractionCallbackResponse or both

rose tangle

neither, it works with the original interaction

the same object where you call interaction.reply()

crystal cargo
rose tangle

yes, that interaction

crystal cargo

so i do interaction.editReply, not msg.editReply

rose tangle

yes, that operation doesn't make sense for messages

you don't "edit a message's reply", you edit an interaction's reply

messages come from anywhere, not just interactions

crystal cargo

awesome, that's new information

crystal cargo
rose tangle
crystal cargo
rose tangle

you named your interaction.reply() returned value as "msg"

which implies that it's a Message

it's not, it's an InteractionCallbackResponse

just "response" would be a better name

crystal cargo

aha

i wish you have access to my code to modify variable names

rose tangle

you'll get better at it the more you program

you'll know how to name things so you can understand yourself better in the future

and hopefully so others can as well

crystal cargo

thx

crystal cargo
rose tangle

yes, you don't need the response to edit the reply, unless you want the message to call message.edit(), or maybe for other reason like storing on a db

and calling message.edit() on the response, as mentioned before, is only possible if it's not an ephemeral reply

hexed marsh
rose tangle

are you on ts?

wary coral

Is withResponse preferred over Client#InteractionCreate? What is best practice

hexed marsh

Who on TS?

rose tangle

wdym by "perfumed over"?

rose tangle
hexed marsh

Yes I'm using Typescript

wary coral
rose tangle
topaz bluff
rose tangle
wary coral typo

they're not really the same thing, nor an alternative to the other? not sure what's the question about

hexed marsh

Negative, apparently I have uncovered a bug if it's intended to be able to support multiple containers.

rose tangle

many people are already using multiple containers, it's kind of weird your specific case doesn't work

the rest of the code would be helpful

hexed marsh
  const statusContainer = new ContainerBuilder()
      .addTextDisplayComponents(
          new TextDisplayBuilder()
              .setContent(`### Quest Status: ${ApplicationStatus.PENDING} Pending`)
      )
      .addSeparatorComponents(separator)
      .addActionRowComponents(
          new ActionRowBuilder<ButtonBuilder>()
              .addComponents(approveQuestButton, delayQuestButton)
      )
      
  const questContainer = new ContainerBuilder()
      .addSectionComponents(section)
      .addSeparatorComponents(separator)
      .addActionRowComponents(
          new ActionRowBuilder<ButtonBuilder>()
              .addComponents(
                  reportInfoButton,
                  reportUserButton
              )
      )
      
  const message = await channel.send({
      components: [statusContainer, questContainer],
      flags: MessageFlags.IsComponentsV2
  });
wary coral
rose tangle

you mean like, using the Message to create a collector vs listening to interactionCreate?

topaz bluff
rose tangle

your code is incomplete so I had to generate some components and leave others

wary coral
rose tangle

well collectors can be useful for temporal buttons

or any temporal component in general

topaz bluff
crystal cargo

do i need to do that same thing if it's a Message?
withResponse and resource.message.awaitMessageComponent

const confirmMsg = await message.reply({ embeds: [embed], components: [btn] });
const awaitConfirm = await confirmMsg.awaitMessageComponent({ filter, time: 1000 * 20, max: 1 })```
@rose tangle
rose tangle

no, withResponse is an interaction parameter

Message#reply() does return the new message, your code is correct

you can see the docs to see what options each method has

sharp ginkgoBOT

method Message#reply() discord.js@14.19.3
Send an inline reply to this message.


// Reply to a message
message.reply('This is a reply!')
  .then(() => console.log(`Replied to message "${message.content}"`))
  .catch(console.error);

crystal cargo

so no change whem upgrading from v13

rose tangle

none that I remember, but every change is on the guide in this channel's description

wary coral
cloud solstice

public static void FizzBuzz(int i, int x) {
Scanner get = new Scanner(System.in);
System.out.println(i);
i++;
String[] letters = new String[x];
for (int j = i; j <= x; j++) {
System.out.println("Now what is the next thing to say?\n Fizz/Buzz or a number?\n (Type out 'Fizz'/'Buzz' or 'number')");
letters[j] = get.nextLine();
System.out.println(letters[j]);
if (letters[j].equals("Fizz") && j % 3 == 0){
System.out.println("Congratulations!, it is Fizz!");
System.out.println(letters[j]);
}
else if (letters[j].equals("Buzz") && j % 5 == 0){
System.out.println("Congratulations!, it is Buzz!");
System.out.println(letters[j]);
}
else if (letters[j].equals("number") && (j % 3 != 0 && j % 5 != 0)){
System.out.println("Yes it is indeed a number, now what number could it be?");
int number3 = get.nextInt();
if (number3 == j){
System.out.println("Congratulations!, it is right!");
System.out.println(letters[j]);
}
else{
System.out.println("Congratulations!, it is wrong!");
System.exit(0);
}
}
else {
System.out.println("WRONG, goodbye");
System.exit(0);
}
Everytime i run this code, after the second iteration, it always jumps to my else statement, how do I fix that?

rose tangle

yeah, that's djs code if I've ever seen one

polar karma

That's not js

cloud solstice

Oh whoops this is javascript not java

any tips tho 🙏

rose tangle

and discord.js not any javascript usage

polar karma
rose tangle

or the coding den which seems more for general programming

cloud solstice

thanks y'all

tired wasp

Hi, does the Bulk Delete api handle rate limiting itself and the 2-100 limits that show up in the Discord API Docs? Does it also throw Bad Request error if any of the messages fail?

topaz bluff

bulkDelete in particular doesn't handle rate limiting...but DJS as a whole should handle rate limiting and queue requests when you hit the limit...however the best rate limit prevention is just not triggering the rate limit in general

tired wasp

I understand, I need to implement a way to delete potentially hundreds/thousands of messages accross multiple servers, and i'm not currently storing age of those messages in my database, so i'm wondering what the best approach to this is >.<

topaz bluff

This endpoint will not delete messages older than 2 weeks, and will fail with a 400 BAD REQUEST if any message provided is older than that or if any duplicate message IDs are provided.

Source: Discord Docs

if you are deleting that many messages, then honestly, just replace the channel

tired wasp

Can't, the idea is automated deletion for "events" embed messages users send to their channels with the bot, usually multiple a day, so currently because i'm not actually storing when the message was sent, that's kind of an issue haha.

But i'll guess i'll figure it out

high oxide

whats the interaction name for member joining a guild

nvm found it guildMemberAdd

high oxide

can i pass roleID into guildMember.roles.add(roleID)?

unique shoal

yes

upbeat saffron

how do i listen to the creation of a forum entry?

sharp ginkgoBOT
crystal cargo
const msg = await interaction.reply({ content: "String", components: [btn], withResponse: true });```
How to delete this message?

msg?.delete is not a function

clear garnet

Listen for that event and then use <ThreadChannel>.send()

sharp ginkgoBOT

method ThreadChannel#send() discord.js@14.19.3
Sends a message to this channel.


// Send a basic message
channel.send('hello!')
  .then(message => console.log(`Sent message: ${message.content}`))
  .catch(console.error);

clear garnet
sharp ginkgoBOT

method CommandInteraction#reply() discord.js@14.19.3
Creates a reply to this interaction. Use the withResponse option to get the interaction callback response.


// Reply to the interaction and fetch the response
interaction.reply({ content: 'Pong!', withResponse: true })
  .then((response) => console.log(`Reply sent with content ${response.resource.message.content}`))
  .catch(console.error);

devout dagger

are there any updates on this?

wild thunder

How do I make a Channel Option only for Voice Channels, as when I do this:
(edit, needs to be an Array)

      .addChannelTypes(
        ChannelType.GuildVoice |
        ChannelType.GuildStageVoice
      )

It seems to not show any channels...

dense jackal
unkempt quarry

For slash options what is minValue called when using rest.put

unkempt quarry

Thanks

sharp ginkgoBOT

discord Application Commands - Bulk Overwrite Global Application Commands
read more

sacred torrent

is there a way to add field in the new component builder?

wary coral
sacred torrent
solid snow

Are there not docs for older versions v12/v13 anymore?

steel trail

Those versions are no longer supported

dense jackal
solid snow

Yeah I understand

I just had someone open a support ticket with an error for an old application and was trying to debug

but it's fine now, pretty sure they installed the latest version of djs instead of what it was made for (v12.5.3) 😮

tardy sable

is it possible to manage the new role colors, is there any documentation for it?

crimson gale

early rollout, no docs, not supported in djs

tardy sable

alright

toxic moat

Is it available???

rose tangle

yeah, released = available

toxic moat
sharp ginkgoBOT

class ContainerBuilder discord.js@14.19.3
A builder that creates API-compatible JSON data for a container.

toxic moat
snow onyx
toxic moat
snow onyx

shruggie

rose tangle

module typescript

typescript+esm imports

toxic moat

Okej, but can i use this in discord.js?

rose tangle

well if you use typescript + esm imports yeah you can just copy and paste it

toxic moat

Can I modfiy this code for js?

rose tangle

sure

I mean no feature is fully locked behind typescript

that's not really possible either way

ts just gives you much more safety while coding

toxic moat

Can you modify this code for discord.js@v14? I need this for my bot ;3

snow onyx

its already written in v14

toxic moat

But if I paste it into my bot in .js it probably won't work

shut musk

So when I want to get data under the application in client, I have to fetch it but is that fetch only 1 time or everytime I want to access the data (ie does it cache future updates or no)

Trying to access approximateUserInstallCount

snow onyx
rose tangle
zenith violet
shut musk

oh interesting, so I need to fetch it everytime i suppose

zenith violet

Correct

shut musk

bet ty

steel trail
toxic moat
snow onyx

Then you will need to learn it.

steel trail
shut musk

This is my side or discord?

First time seeing it ngl

zenith violet
shut musk

Gotcha, ty

I think it happened because I fetched the client application on startup? No idea, first time happening and I've been doing this for a while

zenith violet

not even sure if its discord

rose tangle
ruby bane

may not be directly djs, but are discord automod messages considered bot or system? trying to parse its content

sharp ginkgoBOT
delicate needle

Can we resize the image of component ?

sacred valve

how do i attach a file in the cv2 thumbnail? like, a file on the backend in another folder (it has perms)

sharp ginkgoBOT

tag suggestion for @sacred valve:
Files in embeds should be attached via the message option object and referenced in the embed:

const attachment = new AttachmentBuilder('./image.png', { name: 'image1.png' });
const embed = new EmbedBuilder()
  .setTitle('Attachments')
  .setImage(`attachment://${attachment.name}`);

channel.send({
  embeds: [embed],
  files: [attachment]
});
halcyon bison

This but with a thumbnail component

sacred valve
sacred valve
halcyon bison

as in the example, you still need to send the attachment otherwise the attachment uri references nothing
so if you're not sending them outside of index.js, sure

pearl roost
sacred valve

also tell us which line is line 730

zenith violet
halcyon bison
zenith violet

How did you obtain it

pearl roost
halcyon bison

then delete the channel after you reply

pearl roost

is that work?

halcyon bison

well you wouldn't be attempting to create a message in a channel that doesn't exist

sacred valve

modal close, and then channel delete

you want it to delete the channel after u submit

pearl roost

oh yeah, it work. thank you!

sacred valve
halcyon bison

care to share your implementation?

sacred valve
const logo = new AttachmentBuilder("../../media/logo.png", {
            name: "logo",
        });

        const components = [
            new ContainerBuilder()
                .setAccentColor(3447003)
                .addSectionComponents(
                    new SectionBuilder()
                        .setThumbnailAccessory(
                            new ThumbnailBuilder().setURL("attachment://logo")
                        )
                        .addTextDisplayComponents(
                            new TextDisplayBuilder().setContent("Ping"),
                            new TextDisplayBuilder().setContent(
                                `The API latency is:${
                                    client.ws.ping
                                }\nThe Client ping is: ${
                                    message.createdTimestamp -
                                    interaction.createdTimestamp
                                }`
                            )
                        )
                ),
        ];
        await interaction.editReply({
            flags: MessageFlags.IsComponentsV2,
            components: components,
        });
``` this is my code, and this is the error im getting:
```js
DiscordAPIError[50035]: Invalid Form Body
components[0].components[0].accessory.media.url[UNFURLED_MEDIA_ITEM_REFERENCED_ATTACHMENT_NOT_FOUND]: The referenced attachment ("attachment://logo") was not found```
sacred valve
halcyon bison
sacred valve

oh im stupid

omg

prisma ruin

is this a discord thing or external lib? also idk if this is the proper chat to ask this so im sorry if it isnt

leaden atlas

I might be wrong but it looks like an external library to me

wary coral

The chart is 100% an external library. added to an embed

prisma ruin

found it, charts.js if anyones interestedf

wary coral

it looks like an embed. the color looks like the default gray for embeds. containers don't have a default color

steel trail

They can though, if you set their accent color

wary coral

sure it is possible I just would not imagen someone to set it to that gray. but I degrees

sharp ginkgoBOT
toxic moat

Please add example for components v2 in discord.js guide ❤️

zenith violet
rigid ridgeBOT
toxic moat

❤️

wary coral
viral hinge

Hi i have a question can I accpet or reject a application for a clan guild?

wary coral
viral hinge
tardy sable

for autoModerationRuleUpdate oldRule event, its not possible to fetch with partial? it logs as null for me

wary coral
zenith violet
tardy sable
zenith violet

depends what scale you are talking about

tardy sable
steel trail

Sure, you can fetch them on ready

lucid forge

hello everyone, where are i can find limits of ContainerBuilder() ?
how many components can be placed in one message?

wary coral
lucid forge
sharp ginkgoBOT
lucid forge

@steel trail thanks you human

wary coral
ripe violet

can i put 4 attachments in a embed?

stable sun
steel trail
wary coral
ripe violet can i put 4 attachments in a embed?

Yes*, I am not sure it is documented but I had a bot were I did the fooling to get multi images in one embed embed

const url = 'https://localhost'
const embeds = [
 new EmbedBuilder().setURL(url).setImage('image url 0').setTitle('Main embed with content'),
 new EmbedBuilder().setURL(url).setImage('image url 1')
 new EmbedBuilder().setURL(url).setImage('image url 2')
 new EmbedBuilder().setURL(url).setImage('image url 3')
]
zenith violet
steel trail

or you could just use media gallery component now

wary coral
drifting pecan

Will ContainerBuilder.setAccentColor hopefully maybe support hex color codes like EmbedBuilder does?

ripe violet
dense jackal

it doesnt already??

sharp ginkgoBOT

documentation suggestion for @ripe violet:
discord Using Message Components
read more

vernal blaze

how does the new ephemeral option works?

dense jackal

just like the warning is telling you

sharp ginkgoBOT

tag suggestion for @vernal blaze:

The ephemeral option when replying to an interaction will be removed in v15

- {..., ephemeral: true}
+ {..., flags: MessageFlags.Ephemeral}
``` Read [here](<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR>) on how to specify multiple flags
drifting pecan
sharp ginkgoBOT
drifting pecan

Ah ok EmbedBuilder took a string so I've just been trying that lmao thanks!

wary coral
ripe violet How i use

from the preview guide

const { AttachmentBuilder, MediaGalleryBuilder, MediaGalleryItemBuilder, MessageFlags } = require('discord.js');

const file = new AttachmentBuilder('../assets/image.png');

const exampleGallery = new MediaGalleryBuilder()
    .addItems(
        new MediaGalleryItemBuilder()
            .setDescription('alt text displaying on an image from the AttachmentBuilder')
            .setURL('attachment://image.png'),
        new MediaGalleryItemBuilder()
            .setDescription('alt text displaying on an image from an external URL')
            .setURL('https://i.imgur.com/AfFp7pu.png')
            .setSpoiler(true), // Will display as a blurred image
    );

await channel.send({
    components: [exampleGallery],
    files: [file],
    flags: MessageFlags.IsComponentsV2,
});
coarse bear
dense jackal

it looks so clean

although I think this was already possible with embed image right (wait this isnt #archive-offtopic oops)

coarse bear

You can do this with @napi-rs/canvas, but it's a challenge

lucid forge

in components v2 Is it possible to add videos to the "Media" section or only images?

steel trail

yes, videos too

lucid forge
calm elm

I have a select box that has an item in it called Add new tab. If this particular item is selected, then a modal is supposed to come up where the user can type the name they want to use for the new tab. Some of the time when I click Add new tab in the select box it works fine. Other times when it tries to display the modal it says "Interaction has already been acknowledged." It seems to be random when it works and when it does not. Does anyone have any ideas?

else if (selectInteraction.customId === 'tab_select') {

const selectedValue = selectInteraction.values[0];
if (selectedValue === 'add_new_tab') {

// Show modal to create new tab (this acknowledges the interaction)

const modal = new ModalBuilder()
  .setCustomId('create_tab_modal')
  .setTitle('Create New Tab')
  .addComponents(new ActionRowBuilder().addComponents(
    new TextInputBuilder()
      .setCustomId('tab_name_input')
      .setLabel('Tab Name')   
      .setStyle(TextInputStyle.Short)
      .setRequired(true)
  ));

await selectInteraction.showModal(modal);
try {
  const submitted = await   selectInteraction.awaitModalSubmit({

filter: (i) => i.customId === 'create_tab_modal' && i.user.id === selectInteraction.user.id
});

const tabName = submitted.fields.getTextInputValue('tab_name_input');```
zenith violet

you need to provide a nonce in the modal custom id (like the interaction id) and filter it out

if you cancel the modal the collector will keep running

and collect the next interaction

calm elm

Ok, I will take a look at that. Could the behavior I mentioned still happen even if the modal was not canceled? (The error happens immediately when add new tab is clicked)

zenith violet

not unless you have a different listener trying to handle that interaction somewhere

and have you tried

calm elm
zenith violet and have you tried

You nailed it....another listener was picking it up. So for the nonce, I would just append that to my .setCustomId('create_tab_modal')

and then adjust customId below to use the same thing that was appended above

const submitted = await selectInteraction.awaitModalSubmit({

filter: (i) => i.customId === 'create_tab_modal' && i.user.id === selectInteraction.user.id});```

Thanks again!

cedar wigeon

Sorry for the dumb question in advance as I'm outside and can't check right now,
Does the bots have access to check the member guild-tags yet?.

cedar wigeon
zenith violet

the members tab has been out for a while, but no, bots do not have access to it

cedar wigeon
rancid shoal

bro reacted with a wolf

fair cobalt
zenith violet
fair cobalt

Just to reduce the amount on the log for the pic, not there usually

zenith violet

you cannot rely on it to show everything

not all properties are enumerable

fair cobalt
rancid shoal correct intents enabled ?

Which intents would be needed, currently using Guilds,GuildMembers,GuildVoiceStates,GuildMessages,GuildMessageReactions,DirectMessages,DirectMessageReactions,GuildModeration

zenith violet
rancid shoal

yes for activties

zenith violet

that has nothing to do here

this is just about a console log not returning everything

rancid shoal
zenith violet

while yes, the intent is needed to access presence, it does not cause the presence proeprty to magically show up

it is always present

uneven crater

the presence is always present lmao

magic flume

Hi, does this mean that discord limits to 2 embeds per message ?

hallow mesa

It means see note [2] below the table

zenith violet

also not djs related

magic flume

oh f

hearty quest

what are the dropdown option lists called on embeds

zenith violet

still select menus

unique shoal

And they dont go on embeds

proper monolith

using discord.js i have a question, which database is better for bot with large servers?

unique shoal

That is not a discord.js question, any scalable database will do fine. postgres is a popular choice

wooden karma

what happend on this day XD

barren nacelle

With a discord.js Container how can i make a image go to the top right or the right side of the components V2 thing like the old embed.

i have no clue how to even use this new components V2 thing

wooden karma

In my bot code I have set that when a specific code error is thrown i.e. missing access error I have set NOT TO DISPLAY i.e. in the cmd it just says "I had an error trying to access channel x of guild such and such" and in the response messages it says the same (except the guild).

and why send message-limit 100

hallow mesa
barren nacelle
hallow mesa You would need to use a section component with the text display and the image as...
        const container = new ContainerBuilder()
          .setAccentColor(project.color)
          .addTextDisplayComponents(
            new TextDisplayBuilder().setContent("Testing for a reason.")
          )
          .addSectionComponents(
            new SectionBuilder().setThumbnailAccessory(
              new ThumbnailBuilder()
                .setURL(project.icon_url)
                .setDescription("test")
            )
          );```

this is what i got now but i have a weird error not sure what it's coming from.

unless it's from something else but my code worked fine before i started using components V2

wary coral
hallow mesa
barren nacelle
hallow mesa

Yep

barren nacelle

let me try it btw thank you for helping me this stuff is SO confusing to me

i still got the same error somehow

hallow mesa
barren nacelle

Your builder works on my machine, assuming the properties of project are valid. How are you sending the component?

barren nacelle

Huh it's working now...

hallow mesa

Alright cool. Yeah I had tried it and was not able to reproduce the error.

barren nacelle

Yeah idk what it was but it's working i'll add extra checks and stuff in later to maybe catch whatever it was

Thank you for helping me

hallow mesa

Np

barren nacelle

Do you know how i can add like the line thing to seperate the bottom from underneath the icon?

it does this:

sharp ginkgoBOT
barren nacelle

i have a question my button isn't even showing here idk why...

ornate elk

Is it normal that the doc has the "update" property but not in the class ?

Property 'update' does not exist on type 'ModalSubmitInteraction<CacheType>'.ts(2339)

hallow mesa
barren nacelle
hallow mesa Sections can only have one accessory, so you're overwriting the button when you ...

thank you for telling me that i didn't know.

        const container = new ContainerBuilder()
          .setAccentColor(project.color)
          .addSectionComponents(
            new SectionBuilder()
              .addTextDisplayComponents(
                new TextDisplayBuilder().setContent(project.description)
              )
              .setThumbnailAccessory(
                new ThumbnailBuilder()
                  .setURL(project.icon_url)
                  .setDescription("test")
              )
          )
          .addActionRowComponents(
            new ActionRowBuilder<ButtonBuilder>().addComponents(
              new ButtonBuilder()
                .setCustomId("modrinth-link")
                .setLabel("Link")
                .setStyle(ButtonStyle.Link)
                .setURL(`https://modrinth.com/mod/${project.slug}`)
            )
          )
          .addSeparatorComponents((builder) =>
            builder.setDivider(true).setSpacing(SeparatorSpacingSize.Small)
          );

am i able to move the buttons somewhere i want?

i've seen some people put them on different sides before

hallow mesa

You can only align it to the right if it's part of a section. You'd have to add another section with its own text display to do that

It can go above or below other components though

barren nacelle

hm okay i'll try to mess around and see what i can do

barren nacelle
hallow mesa You can only align it to the right if it's part of a section. You'd have to add ...

so i added a new Section with the button but do you know how i can set it too the right side.

const container = new ContainerBuilder()
          .setAccentColor(project.color)
          .addSectionComponents(
            new SectionBuilder()
              .addTextDisplayComponents(
                new TextDisplayBuilder().setContent(
                  [`# ${project.title}`, `${project.description}`].join("\n")
                )
              )
              .setThumbnailAccessory(
                new ThumbnailBuilder()
                  .setURL(project.icon_url)
                  .setDescription("test")
              )
          )
          .addSeparatorComponents((builder) =>
            builder.setDivider(true).setSpacing(SeparatorSpacingSize.Small)
          )

          .addSectionComponents(
            new SectionBuilder().setButtonAccessory((button) =>
              button
                .setLabel("Link")
                .setStyle(ButtonStyle.Link)
                .setURL(`https://modrinth.com/mod/${project.slug}`)
            )
          );
hallow mesa
barren nacelle

I just tried that yeah and it moved it over thank you

The link to the MC mod looks much nicer being under the icon for it.

hallow mesa

Just a heads up it might not look as pretty on mobile though. They render differently

primal edge
fathom warren

is there any possibility to display emoji added in ddev as an usable only by client itself to a custom status?

because right now it doesnt work 9563bruh

ight, i searched it up
-# shame tbh

elder rock

how would i make this visible to only the user? i know ephemeral is deprecated but i can't add the flag '1 << 6' to this line.
await interaction.reply({ flags: MessageFlags.IsComponentsV2, components: [container], allowedMentions: { parse: [] } })

halcyon bison

message flags are a bitfield, so you can just bitwise OR flags together to add both IsComponentsV2 and Ephemeral

rose tangle

can also pass an array of flags

elder rock

ah ok, thank you. got it

raven hearth
loud quartz
raven hearth
narrow geode

How reliable is Role.members? Since the docs say it's a cache, will it not be fully populated if it hasn't seen activity from all uses with the role?

primal edge

how can I do sub commands?

coarse bear

the separator is part of the image, it is a border

rose tangle
sharp ginkgoBOT

guide suggestion for @primal edge:
guide Slash Commands: Advanced command creation - Subcommands
read more

narrow geode
stable sun

Just fetch all members then filter it or you can use role.members

merry hamlet
const client = new CommandClient({
    intents: [
        GatewayIntentBits.Guilds,
        GatewayIntentBits.DirectMessages,
        GatewayIntentBits.DirectMessageTyping,
        GatewayIntentBits.DirectMessageReactions,
        GatewayIntentBits.GuildMessages,
        GatewayIntentBits.MessageContent,
        GatewayIntentBits.GuildMessageTyping,
        GatewayIntentBits.GuildMessageReactions,
    ],
    partials: [Partials.Channel],
});

if im installing the bot for user only, which of these intents do i need to get rid of?
all of the guild related ones?

stable sun

Besides interactionCreate

merry hamlet

no
but maybe ill use messagecreate in the future

rose tangle

you don't need any intent to receive interactions

but user installed apps don't receive events apart from interactions

merry hamlet

oh okay
so i basically dont need any intents or partials for user apps

stable sun

Unless you will use the message create event, you should reconsider using d.js tbh

merry hamlet

what... why

rose tangle

but to receive messageCreate the app must be installed on the guild, unless you're talking about the bot's dm

merry hamlet

so for user app
its just

const client = new CommandClient();

nvm that doesnt work

stable sun
sudden cedar

im using /core and for some reason im struggling to get this to properly be typed as an APIChatInputApplicationCommandInteraction:

if (
    interaction.type === InteractionType.ApplicationCommand &&
    interaction.data.type === ApplicationCommandType.ChatInput
) {

as far as i can tell its identical to BaseInteraction.isChatChatInputCommand

instead its being typed as just an APIApplicationCommandInteraction

not sure if im misunderstanding it but i cant figure this out

crystal cargo

embed.setFooter({ text: target.username, iconURL: target.displayAvatarURL() })

CombinedPropertyError (1)
Received one or more errors

input.text
| CombinedError (2)
| Received one or more errors
|
| 1 ExpectedValidationError > s.literal(V)
| | Expected values to be equals
| |
| | Expected:
| | | null
| |
| | Received:
| | | undefined
|
| 2 ValidationError > s.string()
| | Expected a string primitive
| |
| | Received:
| | | undefined

weary minnow

i have deployed my bot to production. should i create a seperate new bot for development or there's already a feature for that?

rose tangle
rose tangle
rose tangle

djs only handles the discord connection part, how your infrastructure works is up to you

crystal cargo

console.log({ u: target.username, icon: target.displayAvatarURL() })

hmmm, my mistake

rose tangle

ah, username

thought it was talking about the display avatar

if it's a member then yeah that's undefined

undone coral

i'm getting this issue with the fonts, someone knows why?

const fontsToRegister = [
    { filePath: path.join(projectRoot, 'app', 'fonts', 'Audiowide-Regular.ttf'), details: { family: 'Audiowide', weight: 'regular', style: 'normal' } },
    { filePath: path.join(projectRoot, 'app', 'fonts', 'Oxanium-Regular.ttf'), details: { family: 'Oxanium', weight: 'regular', style: 'normal' } },
    { filePath: path.join(projectRoot, 'app', 'fonts', 'Orbitron-Regular.ttf'), details: { family: 'Orbitron', weight: 'regular', style: 'normal' } } 
];

let allFontsRegisteredSuccessfully = true;
rose tangle

that's not djs related in any way

hexed marsh

What is the proper way of editing components on a container view? I have this message, that has effectively message.components[X].components[X].components[X] blah blah blah and it feels incredibly cumbersome to get a component from said view. Is there a clean way to pull these buttons out and modify their state? One way I've been doing it is to completely toss the view in the trash and edit the entire thing, but that feels like overkill. Thoughts?

rose tangle

there isn't something built-in

ripe violet
rose tangle

data.embeds[MESSAGE_CANNOT_USE_LEGACY_FIELDS_WITH_COMPONENTS_V2]: The 'embeds' field cannot be used when using MessageFlags.IS_COMPONENTS_V2

ripe violet

I confused

rose tangle

about which part?

ripe violet

why it erroring 😭

rose tangle

you're doing exactly what the errors says you can't do

steel trail

because you tried to use embeds and components v2 in the same message

ripe violet

you can't do both?

steel trail

No, components v2 are a replacement for embeds

ripe violet

oh

rose tangle

(the error literally says you can't)

ripe violet

so then what i do for my embeds?

rose tangle

you can only use components, eg containers

dense jackal

discord added some that match most of the embed layout, as well as some new layout components that didnt exist before on discord

ripe violet

uhh
Download failed: TypeError: gallery.addItem is not a function
at /home/container/structures/slashcommands/fun/image.js:244:13
at Array.forEach (<anonymous>)
at sendFinalGallery (/home/container/structures/slashcommands/fun/image.js:243:19)
at Socket.handleProgress (/home/container/structures/slashcommands/fun/image.js:202:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

rose tangle

yeah there's no addItem

it's addItems

ripe violet

oh.

sharp ginkgoBOT
rose tangle

you can check the docs to see what methods exist

ripe violet

Thank you.

sharp ginkgoBOT
ripe violet

where is the docs for the entire v2 compoents?

rose tangle

there isn't

docs let you see methods and properties of individual classes

there's no docs that "group" djs features

you may be talking about the guide, but there's no v2 guide yet

ripe violet

alright

ripe violet
rose tangle

it accepts a url

which can be an image on the internet or an attachment (url with attachment protocol)

sharp ginkgoBOT

Files in embeds should be attached via the message option object and referenced in the embed:

const attachment = new AttachmentBuilder('./image.png', { name: 'image1.png' });
const embed = new EmbedBuilder()
  .setTitle('Attachments')
  .setImage(`attachment://${attachment.name}`);

channel.send({
  embeds: [embed],
  files: [attachment]
});
rose tangle

similar to this ^^

ripe violet

so i can do it the same way as attachment alright

rose tangle

you need an attachment, the only thing you change is that you're doing it on a media gallery item, not an embed

toxic moat

is there a way I can fetch guild tags? I have seen on a cetain website also a few discord bot. They can fetch the badge and the guild tag using an invite link

sharp ginkgoBOT

discord.js does not support features until they are officially documented.
While there might be a way for these features to work, it can change at any time without any notice

rancid shoal

can i fetch who created/deleted/updated a channel

dense jackal
rancid shoal

you would have to fetch audit log entrys right ?

dense jackal

oh for in the past, then yes you need to fetch them

but audit logs are only up for 90 days iirc

rancid shoal

wdym only 90 days? till it expires

novel mauve

45 not 90

wraith reef

Is this a valid way of making slash commands only visible to certain roles?

(I do also have a check in each command just to make sure)

excuse my awful practises if there are any, I tend to use lua and python and I'm learning javascript

steel trail

Only human admins of a guild can do that. You‘d need an oauth2 token from a guild admin to do it in bot code. Otherwise just do it manually in the guild

errant inlet

anyone coding in python?

loud quartz
wraith reef
wraith reef
sharp ginkgoBOT
wraith reef

thanks

steel trail
rancid shoal

cant seem to get emoji creator

fallen trellis

Does anybody know how bots like appeal.gg have completely no status? no presence, no online, dnd, idle or invisible status

vast grotto
fallen trellis

oh okay thanks

rancid shoal
vast grotto
rancid shoal
vast grotto

i'm not sure if discord.js supports http interactions, but there's official discord docs for that

sharp ginkgoBOT

HTTP-only applications receive interactions through HTTP webhooks instead of the Discord Gateway. Bots that are not connected to the Gateway, but use HTTP interactions appear as online without a status. Discord.js does not support HTTP interactions. Use discord-interactions instead.

upbeat saffron

why do i get this error when someone opens a forum post with an image? without Image everything works fine

DiscordAPIError[40058]: Cannot message this thread until after the post author has sent an initial message.
vestal sun
zenith violet

probably because the message is delayed because of the image

this server has some

upbeat saffron
zenith violet

/bitfields intents is one

steel trail
upbeat saffron
steel trail

Listen to messageCreate event, wait for a second or catch that rejection and retry after short period

oblique seal
const logEmbed = new EmbedBuilder()
   .setTitle('Kanal Rollenänderung')
   .setColor('#00a5ff')
   .setFooter({ text: 'WARTHUNDER VOICE LOGS' })
   .setTimestamp()
   .addFields(
      { name: 'Ausgelöster Nutzer', value: `${chmember} (ID: ${chmember.id})`, inline: true },
      { name: 'Kanal', value: `${channel.name} (ID: ${channel.id})`, inline: true },
      { name: 'Betroffener Nutzer', value: `<@${selectedUserId}> (ID: ${selectedUserId})`, inline: false },
      { name: 'Neue Rolle', value: selectedValue, inline: false }
   );

Error:

CombinedError (3)
  Received one or more errors

  1 ExpectedValidationError > s.literal(V)
  |   Expected values to be equals
  | 
  |   Expected:
  |   | null
  | 
  |   Received:
  |   | '#00a5ff'

  2 ValidationError > s.number()
  |   Expected a number primitive
  | 
  |   Received:
  |   | '#00a5ff'

  3 ValidationError > s.tuple(T)
  |   Expected an array
  | 
  |   Received:
  |   | '#00a5ff'

    at _UnionValidator.handle (C:\Users\Marc-\Documents\GitHub\Discord-Development-Private\wt-tempvoice\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1965:23)
    at _UnionValidator.parse (C:\Users\Marc-\Documents\GitHub\Discord-Development-Private\wt-tempvoice\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
    at EmbedBuilder.setColor (C:\Users\Marc-\Documents\GitHub\Discord-Development-Private\wt-tempvoice\node_modules\@discordjs\builders\dist\index.js:310:20)
    at Object.execute (C:\Users\Marc-\Documents\GitHub\Discord-Development-Private\wt-tempvoice\events\temp-voice\string_menus\select_channel_role.js:74:8)
    at async BotClient.<anonymous> (C:\Users\Marc-\Documents\GitHub\Discord-Development-Private\wt-tempvoice\events\temp-voice\interaction-handler.js:25:9)

Someone know why i got this error? Is it because the hex color code or why?

steel trail

Import EmbedBuilder from discord.js, not /builders

oblique seal
solid summit

can i filter bots in userselectmenu builder?

proud arrow

No

indigo yarrow

whats this about

deft wedge
indigo yarrow
steel trail

And it looks like you tried to setPresence before calling login

index.js line 61

indigo yarrow
deft wedge

search for setToken

steel trail

Irrelevant

That’s not their issue (and your code shouldn’t call that manually in this case anyway)

deft wedge
indigo yarrow
steel trail

Is that the only place that rotateStatus is called? And when did you get that error? Immediately on start of process or later on?

indigo yarrow
steel trail

Please show client constructor too

steel trail
steel trail
indigo yarrow
steel trail
indigo yarrow
steel trail

Are there any logs in console before that error?

indigo yarrow
steel trail

Then start with the first error you get in console. Because the latter are just symptoms of that first one

indigo yarrow
deft wedge

also

anyone have any decent knowledge of CV2? only just found out about them, however, as youll know, docs are very limited, im wanting to add a logo to my container

see screenshot attached

https://cdn.void-hosting.cloud/u/Discord_9xU8BGQd1y.png

const verificationPanel = new ContainerBuilder()
      .setAccentColor(0x8b3e1a)
      .addTextDisplayComponents(
        new TextDisplayBuilder().setContent('## Account Verification')
      )
      .addSeparatorComponents(new SeparatorBuilder())
      .addTextDisplayComponents(
        new TextDisplayBuilder().setContent(
          "If You're Unable To Receive Direct Messages From Server Members, Please Ensure That Your DMs Are Enabled, To Do So, Follow These Steps:\n\n- Go To Your Discord Settings\n- Navigate To The `Privacy & Safety` Section\n- Under `Server Privacy Defaults`, Toggle `Allow Direct Messages From Server Members`"
        )
      )
      .addSeparatorComponents(
        new SeparatorBuilder({ spacing: SeparatorSpacingSize.Large })
      )
      .addTextDisplayComponents(
        new TextDisplayBuilder().setContent(
          "> Once You've Done That, Click The Button Below To Verify!"
        )
      )
      .addSeparatorComponents(new SeparatorBuilder())
      .addSectionComponents(
        new SectionBuilder()
          .addTextDisplayComponents(
            new TextDisplayBuilder().setContent('Verify Your Account')
          )
          .setButtonAccessory(
            new ButtonBuilder()
              .setCustomId('verify_account')
              .setLabel('Verify Account')
              .setStyle(ButtonStyle.Primary)
          )
      );
steel trail

was it a one-time thing or reproducible?

indigo yarrow
steel trail

Same way you did for the button accessory later

deft wedge
steel trail
sharp ginkgoBOT

Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.

client
    .on("debug", console.log)
    .on("warn", console.log)
  • Note: if you initialize your Client as bot or other identifiers you need to use these instead of client
  • If the output is too long to post consider using a bin instead: gist | paste.gg | sourceb.in | hastebin
indigo yarrow

alright thanks