#djs-help-v14

78874 messages · Page 8 of 79

umbral prairie

What I did wrong here?

 const textcomponent = new TextDisplayBuilder()
                .setContent("This is a demo command")

            const section = new SectionBuilder()
                .addTextDisplayComponents(textcomponent)

            interaction.reply({
                components: [section],
                flags: [MessageFlags.IsComponentsV2]
            });

The error is return Result.err(new CombinedError(errors, this.validatorOptions));

zenith violet

Your section doesnt have an accessory

And please next time show the full error

agile nest

how do i check if member is owner

umbral prairie

👍🏻

sharp ginkgoBOT
modest plover

Hello, is it possible to record a voice channel including screensharing in the recorrrd ?

hushed mirage

if you use components v2, can the buttons there have a different type than persistent?

because something is not working for me

modest plover

I need something for +1h

polar karma

Afaik bots can't access screen share, recording audio is possible but is largely outside the scope of the library

wary coral
hushed mirage
steel trail

What is persistent, what is multi? Neither are words discord or djs uses to describe buttons

hushed mirage

ok never mind XD

icy surge

Hello I am getting the below error when trying to implement components v2
CombinedError (2)
Received one or more errors

1 ExpectedValidationError > s.instance(V)
| Expected
|
| Expected:
| | [Function: ButtonBuilder]
|
| Received:
| | undefined

2 ExpectedValidationError > s.instance(V)
| Expected
|
| Expected:
| | [Function: ThumbnailBuilder]
|
| Received:
| | undefined

at _UnionValidator.handle (C:\Users\Owner\OneDrive - The University of Akron\College\CIS\Projects\BOTS\TBOT\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1965:23)
at _UnionValidator.parse (C:\Users\Owner\OneDrive - The University of Akron\College\CIS\Projects\BOTS\TBOT\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
at SectionBuilder.toJSON (C:\Users\Owner\OneDrive - The University of Akron\College\CIS\Projects\BOTS\TBOT\node_modules\@discordjs\builders\dist\index.js:2169:37)
at C:\Users\Owner\OneDrive - The University of Akron\College\CIS\Projects\BOTS\TBOT\node_modules\@discordjs\builders\dist\index.js:1870:64
at Array.map (<anonymous>)
at ContainerBuilder.toJSON (C:\Users\Owner\OneDrive - The University of Akron\College\CIS\Projects\BOTS\TBOT\node_modules\@discordjs\builders\dist\index.js:1870:35)
at C:\Users\Owner\OneDrive - The University of Akron\College\CIS\Projects\BOTS\TBOT\node_modules\discord.js\src\structures\MessagePayload.js:151:46
at Array.map (<anonymous>)
at MessagePayload.resolveBody (C:\Users\Owner\OneDrive - The University of Akron\College\CIS\Projects\BOTS\TBOT\node_modules\discord.js\src\structures\MessagePayload.js:150:49)
at DMChannel.send (C:\Users\Owner\OneDrive - The University of Akron\College\CIS\Projects\BOTS\TBOT\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:191:61)

Here is my code below
http://sourceb.in/eIooyVqLBH

steel trail

An accessory is required on a section

wary coral
stiff forge

Do container thumbnails allow undefined as a url? will it error or would it still send?

rose tangle

what would that show then?

if you don't want a thumbnail don't use a section

and yeah, it should error both on builders and dapi

steel trail

Containers can‘t even have thumbnails. Only sections can

sand heart

https://sourceb.in/QGZnwf9Tk0

Reason: Error: Invalid Array length
Stack: Error: Invalid Array length
    at Object.run (C:\Users\Qayyum\Desktop\Components v2\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1045:79)
    at C:\Users\Qayyum\Desktop\Components v2\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:67
    at Array.reduce (<anonymous>)
    at _ArrayValidator.parse (C:\Users\Qayyum\Desktop\Components v2\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:29)
    at validateComponentArray (C:\Users\Qayyum\Desktop\Components v2\node_modules\@discordjs\builders\dist\index.js:1532:233)
    at SectionBuilder.toJSON (C:\Users\Qayyum\Desktop\Components v2\node_modules\@discordjs\builders\dist\index.js:2165:5)
    at C:\Users\Qayyum\Desktop\Components v2\node_modules\@discordjs\builders\dist\index.js:1870:64
    at Array.map (<anonymous>)
    at ContainerBuilder.toJSON (C:\Users\Qayyum\Desktop\Components v2\node_modules\@discordjs\builders\dist\index.js:1870:35)
    at C:\Users\Qayyum\Desktop\Components v2\node_modules\discord.js\src\structures\MessagePayload.js:151:46```

trying to make this.

rose tangle

a section cannot have only a thumbnail

you're looking for a media gallery component

sharp ginkgoBOT

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

sand heart

ohh so it's media gallery, mb. thanks

winter vine
node:events:496
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read properties of undefined (reading 'bot')
    at Object.execute (C:\Users\User\Desktop\projects\fuynex\events\messages.js:7:37)
    at Client.<anonymous> (C:\Users\User\Desktop\projects\fuynex\bot.js:55:50)
    at Client.emit (node:events:518:28)
    at MessageCreateAction.handle (C:\Users\User\Desktop\projects\fuynex\node_modules\discord.js\src\client\actions\MessageCreate.js:32:14) 
    at module.exports [as MESSAGE_CREATE] (C:\Users\User\Desktop\projects\fuynex\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\User\Desktop\projects\fuynex\node_modules\discord.js\src\client\websocket\WebSocketManager.js:351:31)
    at WebSocketManager.<anonymous> (C:\Users\User\Desktop\projects\fuynex\node_modules\discord.js\src\client\websocket\WebSocketManager.js:235:12)
    at WebSocketManager.emit (C:\Users\User\Desktop\projects\fuynex\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:287:31)     
    at WebSocketShard.<anonymous> (C:\Users\User\Desktop\projects\fuynex\node_modules\@discordjs\ws\dist\index.js:1190:51)
    at WebSocketShard.emit (C:\Users\User\Desktop\projects\fuynex\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:287:31)       
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
PS C:\Users\User\Desktop\projects\fuynex> ```
rose tangle

no djs property is called "bot"

if you're trying to access the client, it's .client

and you're accessing it in undefined, so that won't work either

if you need more specific help we'll need your code

specifically messages.js line 7

winter vine

ok wait

    name:"messageCreate",
    async execute(client, message){
        // console.log("messages.js loadded")
        console.log('Received message:', {
            content: message.content,
            fromBot: message.author.bot
        });
        
        const default_prefix = "."
        if (!message.content || !message.content.startsWith(default_prefix) || message.author.bot) {
            console.log('Message skipped due to filtering.');
            return;
        }
        console.log(`${message.author.username}: ${message.content}`)
        const args = message.content.slice(1).trim().split(/ +/);
        const commandName = args.shift().toLowerCase();

        const command = client.prefixCommand.get(commandName)
        if(!command) return;

        try{
            await command.execute(client,message,args);
        } catch(error){
            console.log(`error while executing ${commandName}`)
        }
    }
}```
sharp ginkgoBOT

The order of function parameters must match between definition and function call.

function execute(client, interaction) { ... };
execute(interaction, client);
  • mismatch! you pass an interaction where the client is expected
  • mismatch! you pass the client where an interaction is expected
zenith violet

you dont even need to pass in the client

All djs structures have a client property

winter vine

im new

can you explain

rose tangle

did you write that code?

zenith violet

<Message>.client is your client

winter vine
rigid hinge

how can i exlucde bots from the user "dropdwon" in slash command option?

zenith violet

if you're confused about the ordering of parameters, then you should brush up on your js knowledge

winter vine
zenith violet

i just did

sharp ginkgoBOT

Explaining <Class> and Class#method notation: learn more

zenith violet

I suggest you brush up on your js knowledge first

rigid hinge
winter vine
rigid hinge

You dont need to pass client to the function, because if you pass message it will have property client already (so message.client)

winter vine

oh

sage igloo

Hey guys, just a small question, How can I get permissions list using channelUpdate:oldChannel/newChannel?

sharp ginkgoBOT
winter vine
rose tangle

which you can get with message.client

steel trail

Then do message.client.prefixCommand… but honestly you shouldn’t use prefix commands. SlashCommands are way easier to implement and use

rose tangle

and the guide actually covers those ^^

sage igloo
sharp ginkgoBOT
steel trail

If you want them as strings to show

rose tangle

if you're looking for the difference, I think you'll have to implement that

steel trail

Difference of what?

rose tangle

permission difference, between the old and new one

sharp ginkgoBOT
sage igloo
rigid hinge

For how long will deprecated functions be supported?

wary coral

I believe it is for the current version(v14) of the library.

steel trail

Yep, until the next major. As removing methods or exported functions is a breaking change

rigid hinge

Alright thanks guys. V14 has been here for a long time, is the next major update going to be soon? And is/will there be a list of all deprecated functions?

dense jackal
steel trail

No idea. the docs have a list of all deprecated functions. And the update guide will have a list of all removed/replaced things, yes

rigid hinge

okay thanks
i forgot discord isnt adding much stuff now :D

steel trail
steel trail
dense jackal
rigid hinge
steel trail
rigid hinge

oh shit thats cool, i guess ill have to check that out 😅

winter vine

what is wrong message.member.permisson.has(ManageMessages || ManageGuild)){

rose tangle

that's not how or (||) comparisons work

and there's no member.permission, it's member.permissions

crystal cargo

i can't create an emoji using it's <:name:id> with guild.emojis.create?

rose tangle

no, you need the url

or well some way to resolve the image

the url, the buffer, etc

crystal cargo

does parseEmoji help?

steel trail

With creating an emoji? You still… need the emoji image

crystal cargo

is thier something help doing this in discordJs?

sharp ginkgoBOT
crystal cargo

thx

woeful kraken

is there's actual a guide for new message componenets?
#discord-dev-news message

can't understand why they are not working (for Discord.js) obv

halcyon bison

also feel free to share your code if you'd like some help here

woeful kraken

yeah ok, ill try to follow what mafia sent

ivory furnace

what is UseEmbeddedActivities ?

rose tangle

where?

topaz bluff

Ya I don't see that in the DJS docs...

ivory furnace

here

I was setting up the permission on developer site

rose tangle

ah, a permission then

sounds like a permission for using activities

not sure what it does on bots though

since it's an api question, not a djs one, you should ask in ddevs #useful-servers

ivory furnace

okay

safe kelp
const container = new ContainerBuilder()
    .addFileComponents([fileComponent, fileComponent2])

When I set up the file component in this way, the files are arranged vertically, is there any way to make this horizontal?

topaz bluff

Are they images? You could use a media gallery instead

safe kelp

Currently trying with simple text files, but will use audio files

proud arrow
safe kelp

Okay, thank you bothMinoriLove

rigid hinge

any way i can add the same select menu with the same custom id twice, or are there any other ways i could go about this?

rose tangle

there isn't, but why would you want that?

how would you distinguish them

rigid hinge

by their values, i have two menu each for a different user and they can contain the user id with the option id

i wanted to make two separate functions but i realized i could just merge them

rose tangle

it'd be easier to filter by unique customId than figure out if the option you received is a user id

if you really want to "merge" them you could do something like select-1 and select-2, then just use startsWith

crimson thistle

this is probably not possible, but is there a way i can only allow commands from members that have a certain role?

rigid hinge
rose tangle
proud arrow
crimson thistle
crimson thistle

i'll also take a look at that
thanks

rigid hinge
wary coral
rigid hinge

thank youu

stiff forge
steel trail

Then check for it being null before deciding whether it‘ll be a section or not

rigid hinge

https://cdn.discordapp.com/embed/avatars/0.png

sharp ginkgoBOT
steel trail

Already does that for you👆

rigid hinge

oh thanks 😅

undone coral

someone knows how i can add a prefix detector in the index.js

sharp ginkgoBOT

mdn String.prototype.startsWith()
The startsWith() method of String values determines whether this string begins with the characters of a specified string, returning true or false as appropriate.

wary coral

also Would recommend slash commands vs prefix commands

ivory sable

Hi, I have an array that looks something like

  TextDisplayBuilder {
    data: { type: 10, content: '# a guide to the exoparia' }
  },
   MediaGalleryBuilder {
    data: { type: 12 },
    items: [ [MediaGalleryItemBuilder] ]
  }
]

and I want to figure out a way to check if the last element of the array is a MediaGalleryBuilder but I can't for the life of me figure out how

Sorry if this is more of a general js, and not d.js I wasn't sure

steel trail

array[-1] instanceof MediaGalleryBuilder

ivory sable

[-1] doesn't work, I have to use either array.at(-1) or array[array.length-1], but other than that it works! thank you so much

steel trail

Oh true, js is still js. Mb

torn plinth

can anyone tell me how to disable a button after click

wary coral
torn plinth

owh

same for componentV2 ?

wary coral

Yes

torn plinth

Ahhh.. they should add a disable option after response : )

steel trail

And how do you expect that option to look? What button(s) would it disable?

wary coral

I mis-read the last message. I dont think that there should be a disable after response property. it would lead to wired edged cases

torn plinth
dense jackal
torn plinth

really !!! bruh

torn plinth
steel trail

Yes

torn plinth

can u give me an example :3

wary coral
torn plinth

nvm thanks...

lavish escarp

Is it possible to make two columns of text in ContainerBuilder?

hollow edge

Hey, I know that you could have mentions in embeds without pinging anyone, but in components v2, is there way to have mentions without pings?

Examples:

dense jackal
sharp ginkgoBOT
hollow edge

Hm, okay, thank you!

crisp finch

When I do .getTextInputValue() from a modal, and if that is empty, it errors, how can i make it if its empty it doesnt error but just stay undefined

wary coral
crisp finch
wary coral

So the field is some times not present in your modal?

I am a little confused on on the problem. correct me if I am wrong:
You have a modal and a field is not always present. which causes an error when your execute function runs

sharp ginkgoBOT
wary coral

I think you can use fields property on fields it is a collection
interaction.fields.fields.has()

pallid sparrow

in .setURL can i use a file path?

const text= container.addTextDisplayComponents(new TextDisplayBuilder().setContent([
    ...
].join('\n')));

const img = container.addMediaGalleryComponents(new ThumbnailBuilder().setURL('./assets/img.png'))

i just got "Error: Received one or more errors"

wary coral

You can not uses a local file path

rose tangle

a thumbnail component isn't a media gallery component

wary coral

also that

rose tangle

you need a MediaGalleryBuilder

pallid sparrow

so whats the difference? sorry im very new to components 2.0

rose tangle

one is a thumbnail, one is a media gallery

they're different kinds of components

pallid sparrow

somebody showed me this
would this be a gallery? the image?

rose tangle

thumbnails go inside sections as an accessory

that's a thumbnail as an accessory inside a section

unique shoal

Neither supports local file paths - you must upload them as attachments and reference that

pallid sparrow

so then id use addFileComponents()

unique shoal

Same way as it was done previously for embeds

No, not unless you want them displayed as files

pallid sparrow

so then how do i use it as an accessory?

unique shoal

One sec

pallid sparrow

take your time

unique shoal

Here's the example from the WIP guide which uses a local file, attaches it, and references it in the thumbnail

const { AttachmentBuilder, SectionBuilder, TextDisplayBuilder, ThumbnailBuilder, MessageFlags } = require('discord.js');

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

const exampleSection = new SectionBuilder()
    .addTextDisplayComponents(
        new TextDisplayBuilder()
            .setContent('This text is inside a new Text Display component! You can use **any __markdown__** available inside this component too.'),
    )
    .setThumbnailAccessory(
        new ThumbnailBuilder()
            .setDescription('alt text displaying on the image')
            .setURL('attachment://image.png'), // Supports arbitrary URLs such as 'https://i.imgur.com/AfFp7pu.png' as well.
    );

await channel.send({
    components: [exampleSection],
    files: [file],
    flags: MessageFlags.IsComponentsV2,
});
pallid sparrow

ohhhhh

ok ok this makes a lot of sense

versed current

Guys, how can I definitly get all role IDs? 😅
I forgot how to type guard this...

loud quartz

what do you need the ids for?

unique shoal

This doesn't typeguard since that variable can still end up as either one of them

versed current

checking if user has any specific roles

versed current
unique shoal

Its the right method, used incorrectly

if(ctx.inCachedGuild()) {
  // inside this block, known to be Collection<string, Role>
} else {
  // inside this block, known to be string[]
}```
versed current

xD

versed current
unique shoal

wdym why

versed current

shouldn't my approach work the same way?

unique shoal

nope

rose tangle

.cache is a collection, not string[]

minor maple

yh

unique shoal

Because the scope of execution is still in a context where it could have resolved either way

Where as with an explicit if/else you have blocks with only one possibility

versed current
unique shoal

Exactly

The other type

There were multiple types that line could have resolved to

unique shoal

Therefore it wasnt guarded, even though you did check the same thing

versed current

hmm... now it's not working either Thinkeng
Is something wrong with djs?

unique shoal

hmm

versed current

when I do this, then it works...

unique shoal

exhaustive typeguarding though Im unsure what its excluding

versed current

xD

unique shoal

Ahh, okay. The Cached generic has three types

Thats why

versed current

I thought that too, but what else is there? 😅

unique shoal

undefined

¯_(ツ)_/¯

So I think your ternary might actually have worked in a situation with only two possible outcomes

But imagine if it was like channel.type === ChannelType.Text ? <TextChannel> : <Still so many other possibilities>

versed current

Funny thing, when I turn my tsconfig.strict to true it shows me this
-# I have planned to make a refactor with strict mode, but the codebase is very big and I'm currently more focused on the dashboard

versed current

wait what. Now it works. What the hell

thanks y'all ^^

unique shoal

Yeah because doing it that way leaves only one possible result - its definitely cached

return if not cached eliminated both raw and undefined

versed current

aaah, true

wooden jetty

i don't know if my server is fast af or the discord audit log is slow
when a user create a channel and the bot search in the audit log to get the creator id and see if he is allowed some times the audit log don't show it
it works if i put a timeout for the audit log search

this will show the last one not the current one

const auditLogs = await channel.guild.fetchAuditLogs({
    type: 'CHANNEL_CREATE',
    limit: 1
});

this will show the current one

setTimeout(async () => {
    const auditLogs = await channel.guild.fetchAuditLogs({
        type: 'CHANNEL_CREATE',
        limit: 1
    });
}, 1000 * 5);

how to fix it without adding timeout?
btw i use djs@13.17.1

uneven crater
tribal warren
unique shoal

Reliably there at exactly the same time as the channel create event? No. This is exactly where the unreliability is

wary coral

I haven't had an issue with audit logs related to timeouts. Although there are other events that aren't captured like moving a channel in the channel order

burnt pilot

Can I put this in a new version container?

bleak owl

what is “this”

the embed author? no that doesn’t exist in a container

safe kelp

When I add an audio file to a container using FileBuilder, it shows up as a regular file, and there's no play button.
Is there a way to make it playable directly, or is there any known workaround?

rose tangle

there isn't for both questions

it's a design choice by discord afaik

in the future they plan to add more components, probably including a playable audio one

topaz bluff

DateInputField pls 🙏

safe kelp

Ohh I see, thanks for the clarification MinoriNotes
Hope they add it soon.

vernal nexus

sb help?

zenith violet
vernal nexus

but i cant install it withou? where do i find this man?

rose tangle

djs doesn't need that package, that's not how dependencies work anyways

something is messed up in your npm installation

vernal nexus

i try to install discord.js and it tried to reinstall my whole package.js, then it said it required python, so i installed python and it still wont install

rose tangle

what is "package.js"?

and djs doesn't require python

the only step required to install djs is running npm install discord.js

nothing else

nimble otter

i knew we could do it

rose tangle

yeah that is possible

nimble otter

it's documented, just like any other attachment things

rose tangle

pretty sure it's possible in djs?

or do you mean through the builder?

nimble otter
rose tangle

(pre edit) it's a recent thing and that builder has been around for a long time

that voice message is still an attachment, it's not sent through a special property or anything

so the right place would still be the AttachmentBuilder

it does allow you to send voice messages, or any attachment in general

not just with that "preview"

because it doesn't support that recent addition

rose tangle

also builders are supossed to validate before sending, I'm not sure how the validation would work for the waveform

nimble otter
rose tangle

can you elaborate on "adding the IsVoiceMessage flag isn't supported"?

djs simply sends the flags you set

it doesn't validate or exclude any

if you send an invalid payload that'll cause an error on dapi's side

rose tangle

ig that makes sense, considering it wasn't added in the attachment builder either yet

it should work in runtime though, it's a types issue

nimble otter

then i'll need to extend the AttachmentBuilder class, lemme see

rose tangle

if you want to use builders, sure

raw data should also work though

crystal terrace

Hello Everybode, I'm a newbie

I want to create a reminder task discord for my company, I don't know where to start

signal jewel

the docs and guide. perhaps a yt video

zenith violet

yt videos are a bad idea for djs

zenith violet

as for djs

sharp ginkgoBOT
zenith violet

The guide has everything you need

orchid radish

okay so i have the exact same .env file on both my pc and my host but starting the bot via node . the same way i do on my pc returns invalid token?

i am very very confused

summer spoke

hi, how can i add buttons on the container?

my codes looks like this

https://sourceb.in/f5r0Ps2OAH

and the errors looks like this

ExpectedConstraintError > s.array(T).lengthGreaterThanOrEqual()
  Invalid Array length

  Expected: expected.length >= 1

  Received:
  | []

    at new BaseError (unknown:1:28)
    at new BaseConstraintError (D:\Projects\Velvia\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:761:5)
    at new ExpectedConstraintError (D:\Projects\Velvia\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:780:5)
    at run (D:\Projects\Velvia\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1045:83)
    at <anonymous> (D:\Projects\Velvia\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:67)
    at reduce (native:1:11)
    at validateComponentArray (D:\Projects\Velvia\node_modules\@discordjs\builders\dist\index.js:1532:233)
    at toJSON (D:\Projects\Velvia\node_modules\@discordjs\builders\dist\index.js:2165:5)
    at map (native:1:11)
    at toJSON (D:\Projects\Velvia\node_modules\@discordjs\builders\dist\index.js:1870:35)
orchid radish

i even regenerated my token

summer spoke
orchid radish

yes otherwise it wouldnt work on my pc

yes otherwise it wouldnt work on my pc

dense jackal
summer spoke
zenith violet
orchid radish
dense jackal
zenith violet
orchid radish

i did not its stored in my private repo and pulled to my host

literally its the EXACT same as on my pc and it works fine here

dense jackal
summer spoke for example?

example? a Section component is required to have 1 to 3 text display components and an accessory (thumbnail/button)

if you just want a button to be displayed use an action row component instead of a section component

sharp ginkgoBOT
sacred torrent

I have so much else to do before Ican try to do components V2 it's so annoying like i have to work on some of my school projects

it looks so sick though it's so nice I already know exactly how I want to make some embeds

undone coral

Does anyone know how to give XP to a user who is in a voice channel? I have a working level system, but I don’t know how to do that.

dense jackal

you have to fetch the client application first

sharp ginkgoBOT
zenith violet
robust sundial

Do the new containers have a way to add inline-field-like texts ? (just like regular embed fields)

dense jackal

no

robust sundial

Is there a workaround ?

dense jackal

the discord api devs did not want to recreate everything

robust sundial

I see

dense jackal
robust sundial

That's unfortunate. I really needed the inline-texts mixed with the components v2 thing.

I'll see what I can do to get this working/similar result, thanks for the help.

Might just use disabled Buttons on separate ActionRows, it's a bit wonky though..

subtle girder

My client options:

const client = new Client({
    intents: [MANY INTENTS],
    partials: [
        Partials.Message,
        Partials.Channel,
        Partials.GuildMember,
        Partials.User,
        Partials.GuildScheduledEvent,
        Partials.Reaction,
    ],
    rest: {
        timeout: 15000
        retries: 3
    },
    allowedMentions: {
        repliedUser: false,
    },

but why

I added

    allowedMentions: {
        repliedUser: false,
    },

option

wary coral
subtle girder

or update to 14.19.3?

wary coral

Give me a sec I am going to try and replicate your issue

loud quartz
wary coral

looks like a bug I was able to replicate on 14.19.3

interaction.targetMessage.reply({
 content:'test',
 allowedMentions: {
   repliedUser:false
 }
})

unless I am missing something

subtle girder

i also tried add

 allowedMentions: {
   repliedUser:false
 }

options to message.reply, but same

loud quartz

well, the options set in ClientOptions are used as default if you don't pass them to the specific send() or reply() or whatever

wary coral

So is the conclusion that this is a bug?

loud quartz

looks like it, but unsure

i asked internally about it

wary coral

If it is I am drafting an issue for it

winter vine

whats the issue in it it deletes message but also give error or catch block ````} else{
try{
message.channel.bulkDelete(args[0], true)
const deleted_embed = new EmbedBuilder()
.setTitle("Successfully deleted")
.setColor("#00FFFF")
.setDescription(messages deleted successfully)
.addFields(
{name:"amount", value:args[0]},
{name:"moderator", value:message.author.tag}
)

                return message.channel.send({ embed: deleted_embed })
            } catch(err){
                message.reply(`get an error while executing command
                    error: ${err}`)
            }
loud quartz

and the error is..?

winter vine
loud quartz

then you're building embed incorrectly

which happens after you bulkDelete

so everything works as expected in this case

winter vine

oh

i named embed variable as deleted_embed

wary coral

@subtle girder I have a work around pass an empty object to allowedMentions this will disable the reply mention

targetMessage.reply({
            content:'test',
            allowedMentions: {}
        })
loud quartz

variable name makes 0 difference here

zenith violet

also its embeds and needs to be an array

winter vine
loud quartz

is args[0] a string or a number?

or even better

could you do console.log(err) instead of just stringifying it and sending through discord?

this way you will have the full error

and will know exactly what's wrong and where

winter vine

ok wait

winter vine
loud quartz

then that's (at least one of) the reason why

field value needs to be a string

just call .toString() on it

that said

"i provided as number" - given how it's args, is it just that you send like !delete 10 on discord? and args is just split() message content?

winter vine
  Received one or more errors

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

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

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

    at _UnionValidator.handle (C:\Users\User\Desktop\projects\fuynex\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1965:23)
    at _UnionValidator.parse (C:\Users\User\Desktop\projects\fuynex\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
    at EmbedBuilder.setColor (C:\Users\User\Desktop\projects\fuynex\node_modules\@discordjs\builders\dist\index.js:310:20)
    at Object.execute (C:\Users\User\Desktop\projects\fuynex\commands\prefix\clear.js:29:22)
    at Object.execute (C:\Users\User\Desktop\projects\fuynex\events\messages.js:17:27)
    at Client.<anonymous> (C:\Users\User\Desktop\projects\fuynex\bot.js:55:50)
    at Client.emit (node:events:518:28)
    at MessageCreateAction.handle (C:\Users\User\Desktop\projects\fuynex\node_modules\discord.js\src\client\actions\MessageCreate.js:32:14) 
    at module.exports [as MESSAGE_CREATE] (C:\Users\User\Desktop\projects\fuynex\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\User\Desktop\projects\fuynex\node_modules\discord.js\src\client\websocket\WebSocketManager.js:351:31)
loud quartz

if so - it isn't a number unless you convert it to one

loud quartz
winter vine
loud quartz

then it's a string

not a number

winter vine
loud quartz

that's just invalid syntax

hex numbers start with 0x, 0x00FFFF in this case

sharp ginkgoBOT

documentation suggestion for @winter vine:
typealias ColorResolvable discord.js@14.19.3
Can be a number, hex string, an RGB array like:[255, 0, 255] // purple
or one of the following strings: - Default - White - Aqua - Green - Blue - Yellow - Purple - LuminousVividPink - Fuchsia - Gold - Orange - Red - Grey - Navy - DarkAqua - DarkGreen - DarkBlue - DarkPurple - DarkVividPink - DarkGold - DarkOrange - DarkRed - DarkGrey - DarkerGrey - LightGrey - DarkNavy - Blurple - Greyple - DarkButNotBlack - NotQuiteBlack - Random

loud quartz
wary coral

sorry i wanted the helper function

undone bay

Hey guys idk if i'm on the right server to ask that but, i've got a bot running but since this bot is running i've got my active developer badge get removed (wich makes no sense btw), anyone does know why ?

loud quartz

they have the rgb already, just need to replace # with 0x and not make it a string

winter vine

now it didnt give any error but error while executing clear error: DiscordAPIError[50006]: Cannot send an empty message

undone bay
loud quartz
winter vine

thanks

but before it was working whitout passing it in arey

loud quartz

"before"?

you mean, years ago? or before you updated from v12? (or v13, don't remember)

winter vine

but in that time i was only have one embed in code

loud quartz

then you're missing something

embeds is an array, and was ever since v14 released

winter vine

ok

loud quartz

if you did embeds: myVariable or whatever, than that myVariable is already an array

winter vine

before i did embed: embed

loud quartz

again, "before"? few minutes ago? were you on an ancient d.js version?

for solid couple years bots can send multiple embeds in single message (they couldn't do that originally). we have removed the embed option taking single embed in favor of embeds array

if you need to send a single embed, you just put one embed into the array

winter vine

ok thanks

wary coral

@subtle girder are you still experiencing the replied User mention issue

balmy kraken

how many choices can there be in select menus?

unique shoal

25

subtle girder
wary coral
subtle girder

huh hmmmm

wary coral

right I was before and now I am not

subtle girder

cool
me too
tysm

wary coral

Guess It was a discord API issue

snow onyx

5

leaden shuttle
interaction.reply({
  content: "",
  components: [container],
  flags: [
    MessageFlags.IsComponentsV2,
    ...(ephemeral ? [MessageFlags.Ephemeral] : [])
  ]
});
Type 'MessageFlags' is not assignable to type '`${bigint}` | MessageFlags.SuppressEmbeds | MessageFlags.Ephemeral | MessageFlags.SuppressNotifications | MessageFlags.IsComponentsV2 | "SuppressEmbeds" | "Ephemeral" | "SuppressNotifications" | "IsComponentsV2" | Readonly<...> | RecursiveReadonlyArray<...>'.

any ideas?

hm it seems that i can only pass one flag

snow onyx
leaden shuttle

oh ty

barren nacelle
rose tangle

yes, that's also possible

barren nacelle

Thanks Amgelo

leaden shuttle

can we not add message content if we attach a container?

wary coral

That is correct content and embeds must be null when using components V2

leaden shuttle

alright

wary coral

to clarify you just don't populate those prosperities in the message

additional if you want to add text out side of the container uses the text Display component

earnest rivet
const container = new ContainerBuilder();
      
        const text1 = new TextDisplayBuilder().setContent(
          ['This is a test', '- want like this?'].join('\n')
        );
      
        const section1 = new SectionBuilder().addTextDisplayComponents(text1);
        container.addSectionComponents(section1);
      
        msg.reply({
          components: [container],
          flags: MessageFlagsBitField.Flags.IsComponentsV2,
        });

hey guys! I've been trying to figure out components v2. I've went step by step as provided in the source code that was sent when v14.19.0 was released. Can anyone help me?

zenith violet

And please next time also describe your issue directly

earnest rivet
winter vine

why it is not working

module.exports={
    name:"messageCreate",
    async execute(message){
        const guildDataFile = `./data/guilds/${message.guild.id}.json`
        let server_prefix = null
        const default_prefix = "."
        if(fs.existsSync(guildDataFile)) {
            const guild_data = JSON.parse(fs.readFileSync(guildDataFile, "utf-8"))
            if(guild_data.prefix){
                server_prefix = guild_data.prefix;
            }
        } 
        
        
        if (!message.content || !message.content.startsWith(default_prefix) || message.author.bot || !message.content.startsWith(server_prefix)){
            return;
        }
        let args = null
        console.log(`${message.author.username}: ${message.content}`)
        if(message.content.startsWith(server_prefix)){
            args = message.content.slice(server_prefix.length).trim().split(/ +/);
        } else{
            args = message.content.slice(1).trim().split(/ +/);
        }
        const commandName = args.shift().toLowerCase();

        const command = message.client.prefixCommand.get(commandName)
        if(!command) return;

        try{
            await command.execute(message,args);
        } catch(error){
            console.log(`error while executing ${commandName}`)
            console.log(error)
        }
    }
}```
zenith violet

define not working

and why not use slash commands?

I've seen you struggle a lot because you use message commands

winter vine

but i also want prefix

topaz bluff

Prefix commands are just objectively harder to work with and don't have access to some features (like ephemeral messages) that slash command do

Plus, you're not going to be able to get your bot verified for the "message content" permission if you start growing

winter vine
wary coral

it is objectively less functional and hard to build then slash commands

winter vine

but i have made few commands

wary coral

we are not saying you cant. But just that it is not advised or recommend. like trimming a lawn with nail clippers

any way what is your error for the above code block. you said it is not working could you elaborate

steel trail
heady zodiac

How can i make the bot reply to user when they are clicking to a view that timed out ( in case of bot restart ) to reply to user it timed out instead of interaction has failed

zenith violet

wdym view

a modal?

use the interactionCreate event to make it persist across restarts

heady zodiac
zenith violet

interactionCreate as i just said

upper kelp
zenith violet
upper kelp

thats what i do in a library that handles dynamic components rn
if the button interaction is about to expire (havent replied or deferred after 2 seconds) it calls deferUpdate

zenith violet

thats not their issue or question though

heady zodiac
upper kelp

did i misunderstand wait

heady zodiac
zenith violet wdym callback

The code called when user click on a discord button

If bot restart and user try to click on a previous restart button it won’t do anything beside discord saying interaction failed

zenith violet

It fires every time you clikc a button yes

upper kelp

i have these assumptions:

  • you have a message with a random customId button
  • you are listening for the click for that button
  • when your bot restarts, the listener for that specific button doesn't exist anymore
  • you want to reply to the button with nonexistent listener with "it timed out" or something?
    am i correct?
zenith violet
upper kelp

showing your code would help
-# i think

leaden shuttle

is it possible to make a message display a role ping but not actually ping that role?

sharp ginkgoBOT
leaden shuttle

ty

leaden shuttle
steel trail

Yes

leaden shuttle

what if i want only a specific user to be mentioned?

sharp ginkgoBOT
wary coral

you can pass an array of the user ids to de mentioned

allowedMentions: {
 users:[user.id]
}
leaden shuttle

ty

shell ravine

Hi! Someone know if it is possible to add components to a container in json format after creating it with ContainerBuilder class?

I am trying to make a function to build container easier so I did smth like that:

client.addContainer = ({ components, color = null, spoiler = false }) => {

    if (!components) throw new Error("Composant de conteneur manquant ou invalide");

    const container = new ContainerBuilder()
      .setAccentColor(color)
      .setSpoiler(spoiler);

    container.components = components;

    return container;
  };

I saw that ContainerBuilder has a toJSON() function, but it seems doing the opposite I want 😅

rose tangle

you can only add builders that way, not plain objects

wary coral

ContainerBuilder.components is also readonly

shell ravine

Thank you all 🥲

rose tangle

at that point I'd say it's easier to just use plain objects directly

const components = [...];
const container = { components, type: ComponentType.Container };
rose tangle
wary coral

really js just lets you do that. wild.

steel trail

readonly is a ts keyword. That simply doesn’t exist in js

wary coral

got it

shell ravine

Thanks! And do you know how convert hex color to RGBTuple to match the setAccentColor?

rose tangle

0xrrggbb, so #12345A becomes 0x12345A

steel trail
sharp ginkgoBOT
steel trail

You‘re probably looking for 👆

split thunder

With discord.js v14.19.3, can Discord bots now log when a soundboard sound is added, removed, or modified?

sharp ginkgoBOT
steel trail

Yes

split thunder

thanks

umbral prairie

Does someone know how I can add the Timestamp like in normal embeds but in components v2?

sharp ginkgoBOT

Message formatting (mentions, timestamps, emoji, etc.): learn more

devout dagger

any reason why djs broke emoji: "<\:aaa:123>" in 14.19.0? resulting with a data.components[1].components[1].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary

downgrading to 14.18.0 fixes it

rose tangle

show your code

devout dagger

not using components V2**

Emotes.love is just a emoji markdown string as well, like <\:aaa:123>

rose tangle

I'm not sure if raw data should've ever worked with emoji strings

devout dagger
rose tangle

what's your type of that whole object?

devout dagger

wdym?

of what object

rose tangle

ah, you're sending it directly

nvm

devout dagger

just interaction.reply({ ... });

rose tangle

sounds like it's due to this change, raw data isn't wrapped in an action row anymore

wrapping it would run the builders on the children, which would transform your emoji string to an actual emoji object

devout dagger

so is it intentional of it breaking?
if yes, it's pretty shit (and types are broken),
if no, oh welp

rose tangle

technically that sounds breaking, sounds like it was missed

could be fixed by iterating on the action rows and running the builders

shouldn't be a thing in v15 though, raw data should be passed fully imo, with no need for any transformations

devout dagger

how do you mean that? will it be like either entirely raw or entirely just builders?

rose tangle

forgot about the casing, it should indeed still run transformations

but that's currently definitely a bug in v14, regardless of how it should behave in v15

devout dagger

should I make a (proper) issue on the djs repo?

rose tangle

I've raised it internally so it shouldn't be needed

rigid crest

so was installing dpendacys on a new side project as i wanna dive deeper into a few things without messing with my 2 main projects which of these do i no longer need? so i have a clean slate

npm warn deprecated @discordjs/collection@0.4.0: no longer supported
npm warn deprecated @discordjs/builders@0.12.0: no longer supported
npm warn deprecated @discordjs/rest@0.3.0: no longer supported
npm warn deprecated discord-api-types@0.24.0: No longer supported. Install the latest release!
rose tangle

all of them are exported from djs

sharp ginkgoBOT

discord.js includes multiple sub-packages, installing these separately can mess with internal code:

npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
sage igloo

Hey guys, sorry to bother. I tried to test this #announcements message message with the provided example code and now i'm receiving an error. but looks like everything is fine to me in the code.

            ^

DiscordAPIError[50035]: Invalid Form Body
allowed_mentions[MODEL_TYPE_CONVERT]: Expected an object/dictionary.```
rose tangle

share your code

devout dagger
sage igloo
twilit crest

Error: Invalid Array length, I don't understand why I'm getting errors

const container = new ContainerBuilder();

container.addTextDisplayComponents(new TextDisplayBuilder().setContent(`## 🎨 Example`));
container.addSeparatorComponents(new SeparatorBuilder().setDivider(false).setSpacing(SeparatorSpacingSize.Small));

examples.forEach(s => {
    container.addTextDisplayComponents(
        new TextDisplayBuilder().setContent(`${s.name} (rare: ${s.rarity})`)
    )
    
    container.addMediaGalleryComponents(
        new MediaGalleryBuilder()
            .addItems(
                new MediaGalleryItemBuilder().setURL(s.icon)
            )
    )
    container.addSeparatorComponents(new SeparatorBuilder().setDivider(true).setSpacing(SeparatorSpacingSize.Small));
    container.addSectionComponents(
        new SectionBuilder()
            .addTextDisplayComponents(
                new TextDisplayBuilder()
                    .setContent(`-# Now ID: \`${name}#${tag}\``)
            )
            .setButtonAccessory(
                new ButtonBuilder()
                    .setCustomId(`reload-${interaction.user.id}`)
                    .setEmoji("🔎")
                    .setLabel("Refresh")
                    .setStyle(ButtonStyle.Primary)
            )
    );
});
undone bay

Hey guys, i'm trying to create an embed using paging, but i keep getting this error

embeds[0].description[BASE_TYPE_REQUIRED]: This field is required
    at handleErrors (c:\Users\sauln\Documents\Mathéo\Codropinou Folder\node_modules\@discordjs\rest\dist\index.js:748:13)
    at processTicksAndRejections (<node_internals>/internal/process/task_queues:105:5)```
rose tangle
rose tangle

you can only have 40 components at most

twilit crest

4 components

rose tangle

share the full error

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.

sage igloo
rose tangle

update to .3

sage igloo
twilit crest
sage igloo

i tried to use just a 1 TextDisplayBuilder() and triggered the same

undone bay
rose tangle
twilit crest
rose tangle
rose tangle
sage igloo

i'm using allowedMentions in discord.Client(). is that the problem? :O

rose tangle
rose tangle

does removing that code fix the issue?

to make sure it comes from there

sage igloo

lemme try that.

dude IT IS THE PROBLEM wth?

rose tangle
undone bay
rose tangle

yes, which is why I want to know what data is being sent

and to do that we'd need the full stacktrace

undone bay

And how do i see more than that little error it sent me ?
That's all i get in my debug console

rose tangle

maybe you aren't awaiting your command's function
^^

or you are awaiting it and stringifying the error

which often shorters the stacktrace

sage igloo
rose tangle

are you sure you're on .3?

sage igloo

i am

rose tangle

what does npm ls discord.js say entirely

sage igloo

just the version with filepath ¯_(ツ)_/¯

discord.js@14.19.3

i guess package has so many problems with allowedMentions right :D

undone bay

@rose tangle That's all i can get right now, maybe i'm doing something wrong but i cant figure what. Copilot on his hand cant even figure it also (he just tells me the same thing over and over but it never debugs it)

lavish escarp

how do I fix it?

rose tangle
sage igloo

ah, that's not the type of allowedMentions, you should be passing an object instead

it sounds like you meant

allowedMentions: {
  parse: [
    // ... your types
  ],
},
rose tangle
undone bay
rose tangle

you could split them in more messages

or a followUp if it's an interaction

but I'd say 40 components is a big amount of information to give a user at once, unless it's an info channel or an announcement

rose tangle
undone bay
rose tangle so it errors with application did not respond?

Well wait i think i might have annoyed you for nothing, i think i got a bit lost in all that code and i was typing my command with my prefix that is !, but i forgot i did a /command, the /command works but now i gotta figure why my !commandlist doesn't work anymore

rose tangle

yeah that's why the entire stacktrace is useful, it'd say which call exactly errored

"uncaught error" sounds like you're not awaiting that command function callback, or maybe you are but you are stringifying it when logging it

undone bay

I see, thank you very much tho !

I was struggling for so long lol for nothing at all in the end

rose tangle

no worries blobreach

rigid crest

why has this conflicted it was fine the last time i used it (could it be due to the bots message was in the thread when i deleted it and it fired a messageUpdate? (where the snips from))

  //Ignore bot messages
  if (oldMessage.author.bot) {
    return;
  }
TypeError: Cannot read properties of null (reading 'bot')
stable sun

Try using the new one instead

lavish escarp

Or maybe I don't understand how it counts

rigid crest

also setAcentColor cannot have hex value "#abc123"?

this is the only part i semi understood form the big ol'error 
lotta error stuff
at ContainerBuilder.setAccentColor 
lotta more error stuff
validator: 's.nullish()',
      given: '#ff8c00'
    },
    ValidationError: Expected a number primitive
rose tangle

action rows, containers and sections are components too

raven cedar

Hey, I'm getting the error: TypeError: channel.send is not a function

Is it because I'm not using async and partials?

// Require the necessary discord.js classes
const { Client, Events, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');

// Create a new client instance
const client = new Client({ intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildPresences,
] });

// When the client is ready, run this code (only once).
// The distinction between `client: Client<boolean>` and `readyClient: Client<true>` is important for TypeScript developers.
// It makes some properties non-nullable.
client.once(Events.ClientReady, readyClient => {
    console.log(`Ready! Logged in as ${readyClient.user.tag}`);
    test();
});

// Log in to Discord with your client's token
client.login(token);

function test() {
    const channel = client.channels.fetch('valid_id_here')
    .then(channel => console.log(channel.name))
    .catch(console.error);
    
    channel.send('test');
}
rose tangle

fetch returns a promise

and Promise#send() is not a thing indeed

you want to do that send inside the then()

or await the fetch, return the channel inside the then() and then you can use channel.send like that

or await the fetch, don't then() and console.log() like you're doing the .send()

or use the cache instead

client.channels.cache.get()

since channels are cached if you have the guilds intent, unless it's a thread

oblique seal

Hey, is it possible to center the buttons in ComponentsV2?

rose tangle

it isn't

raven cedar

okay thanks!

oblique seal
split thunder

sorry for asking this here, but is lvl 3 even existing?

rose tangle

¯_(ツ)_/¯

this is for djs help

split thunder

yeah, sure

sage igloo
leaden shuttle

how do i check for perms the bot's perms for the current channel?

sharp ginkgoBOT
leaden shuttle

ty

rose tangle

pass your own member

cloud mulch

is it possible to get the timestamp of when a reaction was added to a message if the bot where not running to receive the reaction event?

red coral

No as discord doesn’t track that

cloud mulch

thx

rigid crest

so im tweaking my audit logger file.. to run with the components ive gotten myself into a endless loop of
components[0][TAG_FIELD_MISSING]: Field "type" is required to determine the model type.
although i set type no?
code: https://pastebin.com/rjzSjwNc

hushed mirage
rose tangle
rose tangle
rigid crest

oh the loggers attempting to send both at once? ill remove the embed mention and see what it does

woven monolith

I'm using components v2, can i send a TextDisplayComponent and ButtonBuilders in the same message without putting them into a Container? I'm still learning my way around the docs 😓

rose tangle

yes, containers are optional

you need to put the button in an action row though

or as an accessory inside a section which also contains the text displays

woven monolith

hmm okay thank you! then I must be doing something wrong, I'll try to find what it is.

toxic moat
const client = new Client({
    intents: [
        "Guilds", 
        "GuildMessages", 
        "DirectMessages", 
        "GuildVoiceStates", 
        "GuildMembers", 
        "GuildModeration",
        "GuildMessageReactions"
    ]
});

Intents work with strings too, right?

bleak owl

did you try it?

toxic moat
bleak owl

it does though

doesn’t work how

toxic moat

Thanks for you answer

bleak owl

it’s recommended to use the enums, but strings are valid

queen vale
  new SlashCommandBuilder()
    .setName("link")
    .setDescription("Links accounts with your discord")
    .setDMPermission(false)
    .addSubcommandGroup((group) =>
      group
        .addSubcommand((command) =>
          command
            .setDescription("Set your github name")
            .setName("github")
            .addStringOption((string) =>
              string.setName("github_name").setRequired(true).setDescription("Your github username")
            )
        )
        .addSubcommand((command) =>
          command
            .setDescription("Set your minecraft username")
            .setName("minecraft_username")
            .addStringOption((string) =>
              string.setName("minecraft_username").setRequired(true).setDescription("Your minecraft username")
            )
        )
    ),

What am I doing wrong here? I get a validationError

queen vale
    at StringValidator.handle (E:\Projects\Shardborne\shardBoat\node_modules\@sapphire\shapeshift\dist\index.js:1715:70)
    at StringValidator.parse (E:\Projects\Shardborne\shardBoat\node_modules\@sapphire\shapeshift\dist\index.js:212:88)
    at validateDescription (E:\Projects\Shardborne\shardBoat\node_modules\@discordjs\builders\dist\index.js:1434:25)
    at validateRequiredParameters (E:\Projects\Shardborne\shardBoat\node_modules\@discordjs\builders\dist\index.js:1448:3)
    at MixedClass.toJSON (E:\Projects\Shardborne\shardBoat\node_modules\@discordjs\builders\dist\index.js:2171:5)
    at E:\Projects\Shardborne\shardBoat\node_modules\@discordjs\builders\dist\index.js:2355:52
    at Array.map (<anonymous>)
    at MixedClass.toJSON (E:\Projects\Shardborne\shardBoat\node_modules\@discordjs\builders\dist\index.js:2355:29)
    at E:\Projects\Shardborne\shardBoat\dist\commands\generateCommands.js:214:43
    at Array.map (<anonymous>) {
  validator: 's.string',
  given: undefined
}```
zenith violet

ah, your subcommand group is missing a name and description

queen vale

is that not what I write in the slashcommand builder?

zenith violet

no

thats the name of the parent command

your sub command group needs a name and description too

steel trail

Or don’t use a group if you only want subcommands

queen vale

ah - I thought subcommand group was just an easier way to add subcommands haha

thanks!

Remind me - are you able to mention subcommands?

bleak owl

yeah, just add the sub command name with a space. the id is the same

</name sub:id>

primal edge

what is a great way to update my bots status to show updated guild count, so I dont get rate limited?

zenith violet

use a setinterval at a reasonable interval

like once a minute

loud quartz

once a minute seems quite often for such counter

heady lintel

Is client.application updated as changes occur (for example to approximateUserInstallCount) or would i need to periodically fetch it again?

zenith violet

you would need to fetch it

heady lintel

If I call client.application.fetch() does it update the object and then return it or just return an updated version?

sharp ginkgoBOT
zenith violet

yes, check the docs

heady lintel

that answers that

loud quartz

all fetches (and events) do that

unless they take a cache option which you can set to false

heady lintel
leaden shuttle
const data = {
  files,
  flags: [MessageFlags.IsComponentsV2]
};

channel.send(data)
Type '`${bigint}`' is not assignable to type 'MessageFlags'.

it works fine when i insert the data directly into the params

steel trail

Huh? I mean ignoring the fact that your payload does not indeed have components that error still looks weird

steel trail
steel trail

You set the flag claiming to include components v2. But don’t actually send components (neither v1 nor v2)

leaden shuttle
leaden shuttle
steel trail

Don’t do that. Show the actual code when asking about an error

leaden shuttle

👍

steel trail

And also the full error if possible

leaden shuttle
steel trail

Need as const with your flags there, since not all MessageFlags can be used while sending

leaden shuttle

ah thanks

steel trail

And the fact that you return it from a function and use it elsewhere is indeed very relevant for that nvm, misread

The full error you received was indeed telling way more information than just the last line (which was unrelated to the cause)

queen vale

does GuildRoleUpdate happen when a player gets a role added?

zenith violet

no

GuildMemberUpdate fires for that

steel trail

Muted in VoiceChannel or timeout?

GuildMemberUpdate then. Do you have GuildMembers intent?

Then you won’t receive that event

cursive cobalt

hey, can a bot access those? accept or reject them

like the apply to join thing

leaden shuttle

is there a ContainerBuilder.from like EmbedBuilder.from?

bleak owl

not from i can see in the docs, but please look there for existing properties and methods

loud quartz

instead of a .from(), the constructor itself might accept an API structure

steel trail

It does

rancid shoal

container docs link pls ?

red coral

The docs have a search bar

sharp ginkgoBOT

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

orchid latch

I have a very weird problem, I create a collector on a message that I send as a interaction response

I stored it in a variable so I can use it to create a component collector

But after the message is edited the component collector do not receive any inputs, I checked I do not emit <collector>.emit('end') at any point, and I placed a console log at the start of the collector to see if it reads any input and I got nothing prior of editing the message. I'm clueless

I placed a stop point at the .on("collect") and retried with the debugger but no input either

red coral

Code?

orchid latch

its quite big

My collector is setup like this

I have a function that generates embed + components based on objects that I created before hand

red coral

I’m curious if you need to add withResponse: true to the .reply, idk if you do that and I’m not too sure if that’s still required

  • a source bin or something is useful for long code pastes
orchid latch

The two first components I use works (A button + a StringSelect) but when it edit the message, the buttons are no longer responsive.

Even if there were like yesterday and I changed nothing else. Idk why the collector suddenly stops collecting anything

red coral

What line does this start at?

orchid latch

at 555

orchid latch

To my original message ? (in let mainGUI)

red coral

Where you .reply line 551

You seem to use ts but as X everything everywhere

orchid latch

Now I get this error when I click one button:

TypeError: mainGUI.createMessageComponentCollector is not a function. (In 'mainGUI.createMessageComponentCollector({ time: 600000 })', 'mainGUI.createMessageComponentCollector' is undefined)
    at <anonymous> (/home/mtgprod/Documents/HouseBun/bot/commands/houses/house.ts:553:36)
    at processTicksAndRejections (native:7:39)
orchid latch
red coral

Because it’s an interaction call back response, you should then use .resource.message. This is all assuming you’re using the latest version

What type does mainGUI have?

orchid latch

I use v14.18.0 btw. My mainGUI is InteractionResponse<boolean>

red coral

Strange how ts isn’t screaming at you

After adding withResponse: true?

orchid latch

Yes

red coral

I’m a bit lost, ig someone else with more knowledge should assist tbh

clear garnet
orchid latch

It is the updated one

when I remove the as InteractionReplyOptions to my templateToEmbedMessage I get this big wall of TS errors:

clear garnet

If you're trying to tell me your paste bin has the updated code, it doesn't

tribal orbit

anyone knows, how to change owner of a app-owned guild?

sharp ginkgoBOT

method Guild#setOwner() discord.js@14.19.3
Sets a new owner of the guild.


// Edit the guild owner
guild.setOwner(guild.members.cache.first())
 .then(guild => guild.fetchOwner())
 .then(owner => console.log(`Updated the guild owner to ${owner.displayName}`))
 .catch(console.error);

orchid latch
unique shoal
orchid latch

Yeah I saw that, I adressed that issue by changing to the return type of my function to the right type xd

unique shoal

I mean, Im seeing it a lot throughout the code in general, not just this line. It can have flow-on effects if something is force-casted even slightly incorrectly somewhere else

red coral

I believe it’s because you make it the wrong type which makes ts think that the type is interaction response, which it isn’t

unique shoal

But yeah, function return types are better than forced as

red coral

And a collector only works with withResponse: true, and then you’d use what I said. So the problem is needing to fix the ts errors

red coral
orchid latch

(I no longer got it, I changed the return type to InteractionReplyOptions directly)

red coral

Changing types isn’t good. Ts is there to make sure you know what you’re doing, it’s like someone telling you you’re wrong so you just put cello tape around their mouth

unique shoal

This format is fine though

It would throw an error within this assignment if it wasn't compatible

red coral

Is ts not good enough to pick that up anyway?

unique shoal

This is the correct way to type an object

red coral

Ofc but ts should infer it’s an object containing those properties

unique shoal

Otherwise TS will "intelligently" decide that this function returns an object { embeds: never[], components: never[], files: never[] } or something like that since it has no idea what those empty arrays are

red coral

Ah, ok that’s understandable

unique shoal

Yeah but it has no fucking idea what those property types are except "array of nothing"

It might do any or unknown, I forget exactly, but it wont know that its at all discord.js compatible if you dont type it

red coral

That makes more sense yh cheers

orchid latch

I found out why that was acting so weird

At some point I use await interaction.deleteReply(chooseMenu); which deletes a ephemeral followUp reply the bot made. But for some reason deleting the reply breaks the collector

Tried this if (chooseMenu.deletable) await chooseMenu.delete(); but ends up returning a 404 error. So I guess I have to give up on deleting my ephermeral

spring elm

When trying to use Discord.js v14's new Message Components v2 (ContainerBuilder, SectionBuilder, TextDisplayBuilder, etc.), I get a runtime error when sending a message with a container that includes a section and action rows with buttons.

Error:

CombinedError: Received one or more errors
  ExpectedValidationError: Expected
    validator: 's.instance(V)',
    given: undefined,
    expected: [class ButtonBuilder extends ComponentBuilder]
  ExpectedValidationError: Expected
    validator: 's.instance(V)',
    given: undefined,
    expected: [class ThumbnailBuilder extends ComponentBuilder]

This happens when calling .reply() on a ChatInputCommandInteraction with a message object containing a v2 container.

main-menu.ts (relevant part):

import {
  ContainerBuilder,
  SectionBuilder,
  TextDisplayBuilder,
  ActionRowBuilder,
  ButtonBuilder,
  MessageFlags,
} from 'discord.js';
// ...other imports...

export const MainMenu: MessageBuilder = {
  async build(client, state, options) {
    // ...fetch guildSettings, etc...

    const container = new ContainerBuilder().setAccentColor(0x00BFFF);
    const titleComponent = new TextDisplayBuilder().setContent('Some title');
    const textSection = new SectionBuilder().addTextDisplayComponents(titleComponent);

    // Build buttons
    const createBtn = await new ConfigMainMenuCreateButton().build(client, undefined);
    const editBtn = await new ConfigMainMenuEditButton().build(client, undefined);

    // Add buttons to action row
    const buttonRow = new ActionRowBuilder<ButtonBuilder>();
    buttonRow.addComponents(createBtn, editBtn);

    // Add section and action row to container
    container.addSectionComponents(textSection);

    // I tried both of these:
    // container.addActionRowComponents(buttonRow); // (builder instance)
    // container.addActionRowComponents(buttonRow.toJSON()); // (raw object)

    // Return message
    return {
      flags: MessageFlags.IsComponentsV2,
      components: [container],
    };
  }
};

ButtonComponent base class:

export abstract class ButtonComponentHandler<TData = unknown> {
  // ...fields...
  async build(client: Client, data?: TData): Promise<ButtonBuilder> {
    const builder = new ButtonBuilder()
      .setStyle(this.style ?? ButtonStyle.Primary)
      .setLabel(this.label ?? '');
    // ...set emoji, url, etc...
    builder.setCustomId('some:custom:id');
    return builder;
  }
}

I've Tried

  • Logging shows that the buttons are valid ButtonBuilder instances.
  • Using both addActionRowComponents(buttonRow) and addActionRowComponents(buttonRow.toJSON()) for the container.
  • All components are present and not undefined at the time of building.
  • The error always points to the .toJSON() of SectionBuilder or ContainerBuilder, and the validator expects a ButtonBuilder but gets undefined.

Package Versions & Stack Trace

Package Versions:

  • discord.js: v14.14.1
  • @discordjs/builders: 1.8.2
  • @sapphire/shapeshift: 3.15.0
  • Node.js: v22.15.0

CombinedError: Received one or more errors
at _UnionValidator.handle (.../node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:1965:23)
at _UnionValidator.parse (.../node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:972:90)
at SectionBuilder.toJSON (.../node_modules/@discordjs/builders/dist/index.js:2169:37)
at ContainerBuilder.toJSON (.../node_modules/@discordjs/builders/dist/index.js:1870:35)
at MessagePayload.resolveBody (.../node_modules/discord.js/src/structures/MessagePayload.js:150:49)
at ChatInputCommandInteraction.reply (.../node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:192:56)
errors: [
ExpectedValidationError: Expected
validator: 's.instance(V)',
given: undefined,
expected: [class ButtonBuilder extends ComponentBuilder]
ExpectedValidationError: Expected
validator: 's.instance(V)',
given: undefined,
expected: [class ThumbnailBuilder extends ComponentBuilder]
]

stable sun

Prob not a good idea to name classes the same as what d.js uses

spring elm

I don't import classes from djs that are named the same as mine, so it shouldnt cause any issues

stable sun

Ik, it can just get confusing

spring elm

renamed it to ButtonComponentHandler in the snippet to make it less confusing ❤️

stable sun

I was just saying. I just have to keep in mind that ButtonComponent can be ur own class

Does the code error if you don’t add the button?

unique shoal

This error suggests that you have a section with no accessory

It expects either a button or thumbnail, but got undefined

spring elm

so sections have to have an accessory?

unique shoal

Yes

Thats why they exist as a layout component at all

spring elm

crySparkle

unique shoal

To put an accessory next to 1-3 texts

If you dont want an accessory, just use TextDisplay components directly

spring elm

thank you so much blobguns

on another note, is there a way to display sections of text side by side like fields in embeds?

unique shoal

no

spring elm

crySparkle

tiny condor

Hey can somebody link the thread on how to ping slash commands, I can't seem to find it Found it

regal summit

Hello everyone, I am running discord.js@14.15.3, but I saw the new component action row thing update, and it looked amazing, I've always wanted to see better more customisable embeds, I was wondering if I can just update without needing to change any code, or if there are things that will break, I might use some old code

loud quartz

that is how semver works, yes

if it would be breaking, it wouldn't be v14, but v15

same way code using v13 doesn't work with v14

fading girder

is there a way to display more than 25 options in a select menu. I am trying to display all the guilds the user is in part of and the user gets to select the appropriate server

unique shoal

no

untold skiff
unique shoal

Theres two errors there

Does your handler do any response? Seems like your catch

Your try/catch in this code doesnt log the full stack so its hard to say'

untold skiff
untold skiff

@unique shoal

solar furnace

Any ideas regarding what might be causing a command of mine to just run and not provide any response, not run any code and not send anything in the console?
I've checked the command code and it looks to be fine and the structure seems to be okay. No errors ra ethrown in the console and the bot doesn't go down.
This is my index.js code:

const fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, GatewayIntentBits } = require('discord.js');
global.mainPath = __dirname;

// Create a new client instance
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent] });

client.commands = new Collection();

const foldersPath = path.join(__dirname, 'commands');
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
  const commandsPath = path.join(foldersPath, folder);
  const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
  for (const file of commandFiles) {
    const filePath = path.join(commandsPath, file);
    const command = require(filePath);
    // Set a new item in the Collection with the key as the command name and the value as the exported module
    if ('data' in command && 'execute' in command) {
      client.commands.set(command.data.name, command);
    } else {
      console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
    }
  }
}


const eventsPath = path.join(__dirname, 'events');
const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js'));

for (const file of eventFiles) {
  const filePath = path.join(eventsPath, file);
  const event = require(filePath);
  if (event.once) {
    client.once(event.name, (...args) => event.execute(...args));
  } else {
    client.on(event.name, (...args) => event.execute(...args));
  }
}

// this is where I log in with the token
console.log('Ready!')

this is deploy-commands.js:

const { REST, Routes } = require('discord.js');
const clientId = '1063639978858528768'
const token = #############
const fs = require('node:fs');
const path = require('node:path');

const commands = [];
// Grab all the command folders from the commands directory you created earlier
const foldersPath = path.join(__dirname, 'commands');
const commandFolders = fs.readdirSync(foldersPath);
const msCommands = [];

for (const folder of commandFolders) {
    // Grab all the command files from the commands directory you created earlier
    const commandsPath = path.join(foldersPath, folder);
    const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
    // Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
    for (const file of commandFiles) {
        const filePath = path.join(commandsPath, file);
        console.log(filePath);
        const command = require(filePath);
        if ('data' in command && 'execute' in command) {
            if (!filePath.includes('utility')) commands.push(command.data.toJSON());
        } else {
            console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
        }
    }
}
const rest = new REST().setToken(token);
console.log('Token successfully set.');

(async () => {
    try {
        console.log(`Started refreshing ${commands.length} application (/) commands.`);

        // The put method is used to fully refresh all commands in the guild with the current set
        const data = await rest.put(
            Routes.applicationCommands(clientId),
            { body: commands },
        );

        const datatwo = await rest.put(Routes.applicationCommands(clientId), { body: commands });

        console.log(`Successfully reloaded ${data.length} application (/) commands.`);
    } catch (error) {
        // And of course, make sure you catch and log any errors!
        console.error(error);
    }
})();
vital raven

Show your interactionCreate and any command

solar furnace
untold skiff
hasty osprey

err

how do i run .ts stuff

unique shoal

You use tsc to compile it to JS and run that

hasty osprey

i just do index.tsc?

zenith violet

no, literally just tsc

then run the transpiled js

hasty osprey

should this be happening?

vital raven

Restart your terminal

hasty osprey
sacred torrent

I love it when I try to implement a new code project into my bot and it goes so to shit that I need to delete all the files

anyways right now im trying to make it so that my bot can sent discord embeds using the new components and I wanna make it easier the idea will be that it will read the a json file in a embed folder and then be able to sent it through a command called /sent embed

right now the issue is that I don't know how to best go about this

anyways shouldn't be asking this here

pure ridge

hey all .. just a short question.. is there a timeout for changing channel names? I know that there is a timeout for the channel description

unique shoal

Yes

pure ridge

is there an overview, where I can see every timeout setting

snow onyx

ratelimits are dynamic, they are not documented

we just know that changing channel names is limited to 2 times in 10 minutes

but I think thats about the only ratelimit we know

tropic locust

Where is the documentation for the Component V2?

zenith violet

There is none yet

tropic locust

Probably why I can't find it then

snow onyx
oblique seal
sharp ginkgoBOT

Ratelimits are dynamically assigned by the API based on current load and may change at any point.

  • The scale from okay to API-spam is sliding and depends heavily on the action you are taking
  • Rainbow roles, clock and counter channels, and DM'ing advertisements to all members are all examples of things that are not okay
snow onyx
pure ridge

that's an perfect information .. counter channels [...] are not okay

sage igloo

guys, quick question, "we can't add StringSelectMenuBuilder() to ContainerBuilder() in any way" right?

snow onyx

sure you can, slap it in an action row and add it to the container

sharp ginkgoBOT
sage igloo
const select = new StringSelectMenuBuilder()
        .setCustomId('whitelistApplyingFaction')
        .setPlaceholder('Choose your faction')
        .addOptions(
            new StringSelectMenuOptionBuilder()
                .setLabel('Hellspire Legion Marine Corp')
                .setDescription('Application Status: :green_circle: OPEN')
                .setValue('factionHLMC'),
            new StringSelectMenuOptionBuilder()
                .setLabel('Blackthorn Alliance')
                .setDescription('Application Status: :green_circle: OPEN')
                .setValue('factionBA')
        );

    container.addActionRowComponents(select);``` I tried but it triggers an error \:(
snow onyx

because you didnt put it in an action row

sharp ginkgoBOT
sage igloo

:O lemme see...

sage igloo

another quick question, can we add two addTextDisplayComponents() in a single SectionBuilder() ?

i mean something like embed.field.[inline] ?

snow onyx

you can add two text display components inside addTextDisplayComponents()

but not inline, no

sage igloo

alr. gotcha. thanks bud. ❤️

dim estuary

hey yall, how can i send embeds with components v2?

snow onyx

you cant send embeds when you send components v2

you can mimic some parts of an embed, but in the end components v2 simply is something else.

dim estuary

alright thank you

grave pond

can there be multiple sections in a container?

obsidian rain

Is it possible to get the input values of a command? I can get the command name using message.interaction.commandName but what about the inputs?

sharp ginkgoBOT

guide suggestion for @obsidian rain:
guide Slash Commands: Parsing options - Command options
read more

snow onyx

if you want to grab that data from the message, you can't

obsidian rain

Not for parsing current interaction. For older commands. For example, I will give my bot the message ID, and it will get me the interaction data. For now I'm parsing the contents itself and using regex to assume it's input, but that's not 100% accurate.

😭

Brute force it is then

dense jackal
frosty epoch

a bot can only change the per-server nickname of the user right?

not the global one im guessing

vast grotto

yeah lol

snow onyx

that would be quite weird if a bot can change my global name xD

sacred torrent

I'm trying to implement the seperators into my code and I asked chatgpt because it didn't work and I didn't understand why and it told me this please tell me this is wrong

snow onyx

of course its wrong

loud quartz

What a bunch of hallucinations

snow onyx
sacred torrent

damn

can you help me with my code?

@snow onyx ?
I just need help with the seperators ngl

sorry for the ping didn't know you were a mod

dense jackal

what you need help with, separators are like the most straightforward components (after text display)

sacred torrent

💀 yes I do...

I'm new to coding and like basically I love force learning it so I don't want any youtube and I just slowly figure out how everything works while I write it or figure out how to write it so my bff is chat gpts LMAO

here is my code

dense jackal

you still havent explained what you need help with

sacred torrent

seperators 💀

loud quartz

As you can see, chatgpt isn't the best idea

loud quartz
sacred torrent

when I run that code I get this error:

as you can see it refers to the seperators but they are expected to be type 1 and not type 17 or smth

dense jackal

because you didnt pass in the message flag

sacred torrent

whats a message flag 🥺
LMAO

loud quartz

Do you know how to send components v2?

sharp ginkgoBOT
sacred torrent

meh?

loud quartz

Feel free to open discord api docs on components

sacred torrent

oh I see about the flags

loud quartz

Instead of asking chatgpt for a hallucinated answer to the error

sharp ginkgoBOT
dense jackal

stop using AI, start using official documentation

sacred torrent

fineeeee

rigid crest

Using GPT for discord.js is like convincing trump he’s orange 🍊 it won’t end well

Also question I forgot to add to the end of that, why is components accent colour? Wouldnt it of been easier to export from embeds setcolour?

snow onyx

elaborate? I dont get your question

kekw

frosty epoch

so what can a bot do with the access of soundboard?

loud quartz

presumably what users can do with soundboard

sacred torrent
sharp ginkgoBOT
sacred torrent
frosty epoch so what can a bot do with the access of soundboard?

I have a idea of using the soundboard to have like voice lines or random sounds play it would help out during some events I do where we would be walking through a forrest in a game I could HOPEFULLY make it run certain sounds through its own soundboard

This is me just hopeing that it works like that because I've only really beem semi-reading the embed stuff

tribal warren
loud quartz

there is full documentation for cv2 in discord.js

given how d.js supports them

and docs are made out of source code

sacred torrent
loud quartz

there is no guide for them yet

sacred torrent

RIP

I did see someone do a shwocase on them ctrl ... smth

Under control

dense jackal
polar karma

Still better than AI

sacred torrent

can agree

Im very new to back end coding and my question is what is like the best language to do this stuff with Im assuming javascript is pretty good but one of my friends recommeneded Typescript

so up until recently I've been using typescript

loud quartz

such question isn't particularly d.js related, so you might be better off asking in #archive-offtopic

sacred torrent

ai thanks

sage igloo

Hey guys, quick question, Can i use StringSelectMenuBuilder() in a ModalBuilder() ?

loud quartz

no, modals can only have text inputs

sage igloo

oh, okay thanks

rose tangle

any amount as long as you don't send 40+ components in total

bitter musk

How would one go upon making dynamic options for string select in slash commands?

Like if there's a ticket open make it able to select from the string select option menu.

novel mauve

you would need to set the option to autocomplete, and handle that yourself, because options are not dynamic

bitter musk
sharp ginkgoBOT
frosty epoch
loud quartz

that is how soundboard works, yes

you can't just randomly play a sound to 50000 people in this server

waxen ore

I can't figure out how to get embed code, like another bot sent embed but I want to know how it was made (the values of fields like description, title etc)

sharp ginkgoBOT
waxen ore

didn't help much

dense jackal

wym

waxen ore

talk in DM?

dense jackal

theres not really any other way

waxen ore
dense jackal

no??

just talk in here lol, other people might have the same issue in the future

waxen ore

like, a bot sent a complex embed and I wanna know how it was created using which fields

dense jackal
waxen ore

let me try this, thanks in advance BTW

waxen ore

let me check.. just 2 mins

not that

I even have problem in explaining.. but i can't help myself

topaz bluff

Could you share a screenshot?

waxen ore

can u talk just 1min in DMs?

dense jackal

why, whats the point of DMs

steel trail

No. Don’t drag people into DMs. Ask your questions here so anyone that knows can answer

waxen ore
dense jackal

you know you can edit messages to bypass slowmode

like so

oh and i wanna say this

steel trail

Or even write more words in the first place

dense jackal

^

waxen ore

fr

doubt solved probably

dense jackal

so, whats the issue

waxen ore

thanks to everyone who wasted time on this lil fellow

FeelsBadMan

rustic heron

Can new containers mention @everyone ?

dense jackal

yes

all mentions will work, unless you specify it to not notify in the allowedMentions field

rustic heron

Ty

I was just asking cause i know embeds have some limitations regarding mentions/pings

dense jackal

yeah thats not the case anymore with containers, which is a huge W

topaz bluff
winter vine

how to get user avatar url

sharp ginkgoBOT
winter vine

ok thanks

latent ember

quick question, can you use autocomplete in the dropdown menu or whatever its called?

rose tangle

select menu, and no

winter vine

.setThumbnail(member.user.displayAvatarURL)

  Received one or more errors

  1 ValidationError > s.nullish()
  |   Expected undefined or null
  |
  |   Received:
  |   | [Function: displayAvatarURL]

  2 ValidationError > s.string()
  |   Expected a string primitive
  |
  |   Received:
  |   | [Function: displayAvatarURL]

    at _UnionValidator.handle (C:\Users\User\Desktop\projects\fuynex\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1965:23)
    at _UnionValidator.parse (C:\Users\User\Desktop\projects\fuynex\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
    at EmbedBuilder.setThumbnail (C:\Users\User\Desktop\projects\fuynex\node_modules\@discordjs\builders\dist\index.js:359:23)
    at Object.execute (C:\Users\User\Desktop\projects\fuynex\events\memberJoin.js:40:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

steel trail

It’s a function, you need to call it

displayAvatarURL**()**

winter vine

oh okay

CombinedPropertyError (1)
  Received one or more errors

  input[2]
  | CombinedPropertyError (1)
  |   Received one or more errors
  |
  |   input.value
  |   | ValidationError > s.string()
  |   |   Expected a string primitive
  |   |
  |   |   Received:
  |   |   | 160

    at _ArrayValidator.handle (C:\Users\User\Desktop\projects\fuynex\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1254:70)
    at _ArrayValidator.parse (C:\Users\User\Desktop\projects\fuynex\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
    at EmbedBuilder.spliceFields (C:\Users\User\Desktop\projects\fuynex\node_modules\@discordjs\builders\dist\index.js:271:31)
    at EmbedBuilder.setFields (C:\Users\User\Desktop\projects\fuynex\node_modules\@discordjs\builders\dist\index.js:287:10)
    at Object.execute (C:\Users\User\Desktop\projects\fuynex\events\memberJoin.js:41:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
rose tangle

160 is not a string

you most likely want to call .toString() on that number variable

winter vine

{name:"total members", value:member.guild.memberCount,inline:true}

rose tangle

memberCount is a number indeed

winter vine

how to use

dense jackal
rose tangle

how to use what?

rose tangle
winter vine

ok thanks

i used toString(member.guild.memberCount) then it gives [object Undefined]

rose tangle

call it on that number, not passing that number

not sure what you just called

winter vine

oh okay

sharp ginkgoBOT
obtuse laurel

Why does ModalInteraction.fields.getTextInputValue() always return string? What if the value wasn't provided? Would it give me an empty string?

rose tangle

yes