#djs-in-dev-version

35223 messages · Page 36 of 36 (latest)

uncut kelp

Choose main in the version selector to see it on the website

tiny dock
twilit bobcat

it isn't finished so there isn't one yet

there's a pr that was keeping track of some of the changes in the guide repo

steel haven
tiny dock

Thanks for your replies, I'll look at the commits 🙏

patent zephyr

They have documentation for 15.0.0-dev.1754006526-8f5ac55d8 (the latest dev version).

?

twilit bobcat
patent zephyr
patent zephyr
twilit bobcat

sorry, I don't understand what you mean

patent zephyr

How do I know what has changed, what has been added, and what has been removed?

twilit bobcat

you don't yet, documentation documents the current state, not changes

there are other ways though, read the whole conversation I linked to you

lapis cove

will djs switch to BigInt for Snowflake IDs?

steel haven
lapis cove

Oh wait I forgot about json requests also require string :P

knotty plover

To add to the above, there's no benefit to them being BigInts really because they arent used for calculations. Number isn't a particularly useful format for Snowflakes

I dont know what "speed" you're referring to there

robust badge

Will we see major changes on discord.js or we will keep going with v14.x?
For now, everything seems fine so far, I would like to know if there’s going to be breaking changes

uncut kelp

There are major changes coming yes

robust badge
uncut kelp There are major changes coming yes
  • Is there an ETA?
  • I have checked docs but all I see are main and v14. I am not sure main means development as branch on website so yeah. Is there a website/wiki that we can follow up the changes?
dawn phoenix

the commit messages are the changelog

robust badge

Then release… alright, thanks.

uncut kelp

People rename their default branches to whatever, but that's not the case all the time if that's what you were asking

Select main in the website to see documentation is what you need to do yeah

dawn phoenix

the main github branch releases as discord.js@dev, yes, if that's what you mean

which can also get breaking changes very frequently, especially when it gets closer to a major release. so we recommend pinning your version to a commit and only updating after reviewing commits you will apply with that update
(granted most devs will not realy have a benefit from using dev in the first place)

unkempt vault

what styles djs docs? the docs website, not the guide. I'd appreciate a link to the repo for it :)

unkempt vault

thanku

and to generate the docs? is it the docgen package?

forest elm

no, that's a legacy thing that im not even sure why its still around

forest elm
uncut kelp
forest elm

and why is that still around

unkempt vault

i'll check out api-extractor thanku

steel haven
unkempt vault

ooooo

rain grail

i am using the dev branch and i cannot figure out why the SuppressNotifications flag appears to not work? am i doing something wrong? im gettin yelled at

or does it just show the channel red indicator + highlight without sending any desktop/mobile notification?

    i.reply({
      content: `<@${user.id}> linked to the role <@&${role.id}>`,
      flags: [MessageFlags.SuppressNotifications],
    });
shell lynx
rain grail

ok that's what i thought, so false alarm then, thanks

uncut kelp

If by "gettin yelled at" you mean "I am still mentioned", you wanted allowedMentions, not that flag

rain grail

oh... indeed, thanks 😅

uncut kelp

This is released now!

signal abyss

It isn't possible to test the select modals with discord.js is it?

dawn phoenix

select menus in modals are not yet publicly available

they're currently being tested by library and large bot developers before a public release in ab. 2 weeks

signal abyss

I know, I meant for testing
sorry if this is a stupid question 😅

I just thought maybe I can install the branch

dawn phoenix

no, it's API gated and only available in a test server owned by discord that's not open to the public

oh, you're in the test kek

signal abyss

Uh, I just asked advaith for the invite and he gave it to me

dawn phoenix
signal abyss

from my understanding it has to be built first?

like pnpm run build

dawn phoenix

alternatively you can use the raw payload as documented with Client#rest

signal abyss

I think it's not possible because discord.js crashes while processing the request?
Unless the is a way to tell it to ignore modal submit interactions

or is it like a whole different package?

uncut kelp

There's only a pull request for @discordjs/builders and discord-api-types right now

It's not really ready for testing unless you use them

There's nothing handled yet for discord.js (the package itself)

dawn phoenix

i'd recommend waiting for a public release
if you want to test it now to play around with it, you can use a separate @discordjs/rest REST instance to send raw payloads and see what it looks like

signal abyss

Alright, thank you, sorry for bothering you

dawn phoenix

your production bot won't be able to use it anywhere but that server anyways, so a small test app will likely fit that exploratory phase much better

signal abyss

👍🏻

knotty bison

just asking a curious question, can each section contain it's own thumbnail?

twilit bobcat

yes

and please keep this only for the dev djs version

knotty bison
twilit bobcat

I mentioned it since it's more of an api question

not djs specific

knotty bison

hmm, well... i'm trying to add the thumbnails, but it's not working, djs is ignoring it

twilit bobcat

show your code

knotty bison
const buildPromotionsContainer = (content: string, promotions: any[]): MessageCreateOptions => {
  const container = new ContainerBuilder();
  container.addTextDisplayComponents(text => text.setContent(content))

  for (const promo of promotions) {
    const sectionBuilder = new SectionBuilder()

    const description = `Disponível até <t:${DateTime.fromISO(promo.end, {
      zone: "America/Sao_Paulo"
    }).toSeconds()}:F>\n${promo.link}`;

    // Add game title
    sectionBuilder.addTextDisplayComponents(
      new TextDisplayBuilder().setContent(`# 🎮 **${promo.title}**`),
      new TextDisplayBuilder().setContent(description)
    );

    if (promo.img) {
      sectionBuilder.setThumbnailAccessory(
        new ThumbnailBuilder().setURL(promo.img)
      );
    }

    // Add link button
    sectionBuilder.setLinkButtonAccessory(
      new LinkButtonBuilder()
        .setLabel("🌐 Abrir no Navegador")
        .setURL(promo.link)
    );

    container.addSectionComponents(sectionBuilder)
  }

  console.log(JSON.stringify(container))
  return {
    components: [container],
    flags: 1 << 15
  };
};```
knotty plover

You cant have both a thumbnail and a button

you get one accessory, so the button is replacing it

knotty bison

ohh

I didn't know about that, thx!

twilit bobcat

also I'd strongly recommend against using any

that goes against the entire purpose of using ts

and you can use enums instead of raw numbers

plain roverBOT
ruby sparrow
karmic spire

Please update this lib (discord.js) soon to receive select strings inside the modal

icy dew
dull mulchBOT
knotty plover
karmic spire

will there be more types of selects? type of channels, roles, users

knotty plover

In phase 2

karmic spire

and when can we use it? because now the select inside the modal does not respond

frigid reef

just wait till it will get announced

karmic spire
twilit bobcat

there's no eta as always

also this channel is for the dev (main, v15) version

knotty plover

You survived for years without it, a few more days won't hurt

karmic spire

OkIt's something very cool and useful, thank you.

ruby sparrow

anyone have screenshots of what it'll all look like? am curious what to expect 🙂

frigid reef

@ruby sparrow ^

ruby sparrow

so sick. tysm!!

past oxide
twilit bobcat
limpid onyx
frigid reef
limpid onyx

I want to implement a system to check a user's primaryGuild updates. Which event should I use?

limpid onyx
quasi shell

Why I'm getting this error:

ValidationError: ✖ Invalid input: expected string, received undefined
  → at label
    at validate (D:\Projects\ZombieClient\node_modules\@discordjs\builders\src\util\validation.ts:54:9)
    at PrimaryButtonBuilder.toJSON```
```js
const flags = {
    PL: ':flag_pl:',
    GB: ':flag_gb:',
};

const row = new ActionRowBuilder();

Object.keys(flags).forEach((flag) => {
    const button = new PrimaryButtonBuilder()
        .setEmoji({ name: flags[flag] })
        .setCustomId(`verifyButton_${flag}`)
        // .setLabel('\u200B')
    row.addComponents(button);
});

is label required now for buttons with emojis?

frigid reef
quasi shell
fluid wolf
twilit bobcat

I think it's fine here since they're using builders v2

which isn't on v14 but on main

that does seem like a bug though

fluid wolf

My apologies, I didn't realize the button builder got renamed for V2

Would potentially use the Unicode for the emoji? Makes sense

twilit bobcat

oh yeah it should be the unicode emoji as well

but the validation shouldn't be failing

label isn't required if there's an emoji

and viceversa

quasi shell
quasi shell
steel haven
twilit bobcat
twilit bobcat
shell lynx

is there already a PR for updating the modals guide page according to d.js PR #11034, otherwise I am willing to start working on that soon 😄

fluid wolf
fluid wolf

Why does ModalSubmitInteraction have deferReply() and deferUpdate(), if they cant be used on the interaction?

vague coyote

You can use them?

What you can't do is defer and then show a modal

fluid wolf

Ah, Thank you. I misread the warning message

jovial galleon
limpid onyx I want to implement a system to check a user's primaryGuild updates. Which event...

You can’t send interactive components like buttons directly with a raw webhook since webhooks don’t support interactions; you’ll need to send through a bot client using interaction.reply or channel.send to make them clickable. For tracking a user’s primaryGuild updates, the closest event is guildMemberUpdate, which fires when roles, nicknames, or metadata change. As for select menus, they still can’t be placed inside modals, only in action rows for messages. Add me and I’ll share a working code example showing the right structure for buttons and event handling.

keen abyss

Webhooks do support buttons etc but the webhookmust be owned by the bot

violet brook

Also:

  • UserUpdate works fine for tags, like the answer they got two weeks ago said.
  • Select menus can be placed inside modals in dev.
    (Account feels like some sort of scam though)
buoyant current

how it's possible?

the button inside the embed?

shell lynx
plain roverBOT

guide Popular Topics: Display Components
read more

shell lynx

it is not an embed, its a container

buoyant current

oke thnx

eager dock

Is there somewhere I can find the v15 documentation, even if it's incomplete? Just to understand what will be changing so much.

I installed it to test, and I saw that even the slash command builder no longer exists, I wanted to know more to prepare for the changes.

fluid wolf
eager dock
fluid wolf
eager dock
twilit bobcat

it isn't

fluid wolf
steel haven

Oh wait, you mean v14 dev, that doesn't exist no

cinder wraith

does that no longer require setting overrides?

pastel patrol

I'm having issues with typescript and using Guild#features what's declared as GuildFeatures API Type
I'm wanting to check if STAGE_CHANNEL_VIEWERS_50 is in that array. The issue is it's not declared in that type? At the top of the enum it links to the discord API docs where they have some features declared but not all that I have seen can be returned from the API. Is their a reason why we don't support (the missing features that aren't displayed in the discord API docs) them and is their any reason why it couldn't be pred to the package?

uncut kelp
pastel patrol
cinder wraith

Just cast

Or use expect-error

wanton torrent

eta select menu on modal?

dawn phoenix

we don't give etas

lilac igloo

Hello guy's where is Discord.js V15?

fluid wolf
idle galleon
lilac igloo

Discord.js open source ?

knotty plover

yes

inner shard

Need a little help here, I'm trying to create my first contribution to discord.js, in particular the discord.js/builders package. I'm following the contribution guide which states I can use pnpm turbo run build --filter=@discordjs/builders -- --watch, however I keep getting:

ERROR  unexpected argument '--watch' found
  tip: to pass '--watch' as a value, use '-- --watch'
uncut kelp

Just go into the package itself and run pnpm build --watch

inner shard

I've just noticed that when using builders, the following:

new SlashCommandBuilder() //
  .addSubcommandGroup(
    new SlashCommandSubcommandGroupBuilder()
  ...

will only work if SlashCommandSubcommandGroupBuilder is imported from @discordjs/builders, not from discord.js, otherwise shapeshift throws a validation error. This happens to other builder types too

I think it's because assertReturnOfBuilder fails to recognize it as a valid instance of the class it's expecting it to be because it's imported from a different module, as s.instance is using instanceof to check? I'm not sure at all though

Just think it might be a useful addition to #1115775988857581668 or somewhere else that is more appropriate

uncut kelp

Can you make a code sample

cold marsh

how can i avoid massive memory bloat from all the caching djs does? i already do this:

    makeCache: DiscordJS.Options.cacheWithLimits({
        ApplicationCommandManager: 0,
        GuildBanManager: 0,
        GuildInviteManager: 0,
        GuildMemberManager: 0,
        GuildStickerManager: 0,
        MessageManager: 0,              
        PresenceManager: 0,
        ReactionManager: 0,
        ReactionUserManager: 0,
        StageInstanceManager: 0,
        ThreadManager: 0,
        ThreadMemberManager: 0,
        UserManager: 0,
        VoiceStateManager: 0,
    }),

    sweepers: {
        messages: { interval: 0, lifetime: 0 },
        users: { interval: 0, filter: () => () => false },
        guildMembers: { interval: 0, filter: () => () => false },
    },

cinder wraith

by not using intents you aren't interested in, or not calling it bloat.

also, this has nothing to do with dev version

alternatively, use /core instead of discord.js if you have no interest in built-in caches

idle galleon

You don’t need sweepers for caches that don’t keep anything

I guess interval: 0 causes the sweeper to be invalid and not registered

wanton crown

https://discord.js.org/docs/packages/discord.js/main/APIAuditLogChange:TypeAlias

how come there is no video quality mode key for the AuditLogEntryCreate event?

This comparison appears to be unintentional because the types '"id" | "type" | "flags" | "archived" | "locked" | "channel_id" | "color" | "status" | "description" | "application_id" | "guild_id" | "permissions" | "available" | "volume" | ... 63 more ... | "widget_enabled"' and '"video_quality_mode"' have no overlap.

cinder wraith

Where did you get that property from

wanton crown
cinder wraith

where did you get that key from that we don't have

wanton crown

well, you just listen to the audit log entry create event and then edit a voice channels video quality and then it will send the entry that can be seen on the fist screenshot

It’s what the discord API sent

it’s in the audit log so it’s definitely a thing
discord.js just doesn’t have a key for it nyaThink

dawn phoenix
rigid haven

yeah...the discord docs essentially just say "any prop on the target prop is a possible key" but djs has a manually defined union that never gets updated

steel haven

Not djs specifically but discord-api-types. PRs are always welcome there to add this property

rigid haven

could the union be changed to a keyof Target? i forget exactly how it's set up

steel haven

No, as that would be wrong. Especially considering camelCase vs. snake_case in properties. But also not all properties of the djs structure are valid properties of the API. That's what API types are for

fluid wolf
uncut kelp

That's just the same thing

Also that's a lot of edits haha

fluid wolf

I type the best ist

fluid wolf
steel haven

And that page basically states "we haven't really documented how this works yet, stay tuned" and did so for years now

uncut kelp

Membership gating was how it was referred to whilst it was rolling out iirc

fluid wolf

the text was updated in api types
APIBaseGuildMember#pending uses the text "Whether the user has not yet passed the guild's Membership Screening requirements"

uncut kelp

Maybe it could change then since I don't see any "gate" in the documentation... @boreal knot^

fluid wolf

I just noticed yesterday and wanted to being it up

boreal knot

we use w/e is in the docs, with minor adjustements

sooo, feel free to PR it

XD

fluid wolf
rigid haven
steel haven
wanton crown
idle galleon

D.js v14.24.0 already requires -types v0.38.31

Guess I should still check main

Main requires -types ^0.38.30, so you could just update it right now without any issues

uncut kelp
weary steppe

Do we know approximately when discord.js v15 will be released?

haughty sorrel
twilit bobcat

any specific reason you want v15?