#djs-in-dev-version

1 messages ¡ Page 8 of 1

knotty plover
#

We will update when the feature is complete, stable, tested, and ready

#

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
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?

barren portal
#

Dev builds don't seem to get published as of yesterday. Somewhere in the workflow it seems to fail.

steel haven
#

Issue found, will be fixed later today

barren portal
#

Aight cool, thanks.

fast ember
#

so can u give poetfolio.

steel haven
frigid reef
#

In v15 i understand you wont be able to set emojis in setEmoji() etc as just the emoji id but have to pass an emoji object?

steel haven
steel haven
#

Yes. Any builder

#

There are no builders at all in mainlib discord.js dev version

frigid reef
#

yh so in v15 youll have to set emojis in stuff like buttonbuilder as an emoji object? just a string wont work anymore?

steel haven
#

Again. There will be no ButtonBuilder in v15. There will be one in /builders v2 and yes, that one only takes an object as parameter

#

Well, there's no ButtonBuilder in v2 either. There's PrimaryButtonBuilder etc.

frigid reef
steel haven
#

Yes. Because you won't even have to have builders installed at all. They are a completely separate additional package in main

#

discord.js doesn't depend on them anymore

dawn phoenix
#

djs Drop your Q's we will find some A's

⚠️ You are using a development build. Things might break at any new commit.
please provide the full version (output of npm ls discord.js | yarn list discord.js | yarn why discord.js (yarn v3+) | pnpm list discord.js) you have installed when asking for support!

Please open threads for questions you anticipate might take some more time or back and forth to resolve

npm remove discord.js
npm install discord.js@dev

yarn remove discord.js
yarn add discord.js@dev

pnpm remove discord.js
pnpm install discord.js@dev

bun remove discord.js
bun add discord.js@dev

• Requires version 22.12 or later of Node.js node_js
• Documentation: https://discord.js.org/docs/packages/discord.js/main

What can you expect from the development version?

deny Use without crashes
deny Free of bugs
deny Consistent API (Things may change drastically from one commit to the next)
deny Refactor a large code base that a lot of people depend on to use this build

fast tulip
#

why i can type here

#

@dawn phoenix

#

dats dope

#

did u forget to lock the channel or what

dawn phoenix
#

what?

fast tulip
#

is that normal to type here?

dawn phoenix
#

this is a support channel for people trying out v14 by installing the at-dev build

quiet aurora
#

no this is a discussion channel for discord.js@dev

fast tulip
#

oh ahem

jolly pike
#

cool

fast tulip
#

sorry abt that bois

rigid haven
#

ohh ok i was confused too

dark wharf
#

Anyway, back to the channel topic

torn osprey
#

I know that I shouldn't ask it, and I know that I might not receive an answer to this question, but: is there a general ETA? Like before discord makes reading messages privileged intents?
I have been procrastinating updating my bot from v12 to v13, but if this comes before that discord intent update, I might be able to update straight to v14.

And again, sorry for this question. And I understand that there might not even be a date for a push to main (yet)

swift orchid
#

What alternatives are there to .deleted? Is there anything stopping me from unknowingly storing a reference to a now-deleted channel? I suppose we're just expected to .catch() all our function calls, is that correct?

outer bane
knotty plover
sturdy kiln
#

Is the "Ask to join" button for RPC a v14 feature? Because I can't find any way to integrate it right now.

torn osprey
knotty plover
sturdy kiln
knotty plover
#

Im not sure what button you're referring to anyway

sturdy kiln
plain roverBOT
#

<:_:874569322742308864> Activity#buttons
The labels of the buttons of this rich presence

knotty plover
#

You can read the buttons on a presence with discord.js

#

But otherwise, bots cannot create/set/interact with them

sturdy kiln
knotty plover
#

Are you sure? Because the game is definitely an Activity

sturdy kiln
#

Yeah, pretty sure

knotty plover
#

And its not a "presence" in the way bots use them, its RPC and its coming from the game on your local machine

sturdy kiln
#

But if I subscribe the client to that event, it never get fired, both on user A client nor user B

knotty plover
#

That is RPC

#

Bots cant join activities

#

You're looking at entirely user-land features here

#

These are not features of discord.js, because a bot
A) cannot set activities that can be joined
B) cannot join activities

sturdy kiln
#

Yeah I know, I'm talking about RPC, I was writing here asking if somebody knows if that is already a feature or it's planned to be added

knotty plover
#

Then this is the wrong channel, because this is for discussion of the discord.js dev release

#

RPC is not part discord.js

sturdy kiln
#

Sorry, I thought the new version 14 brought updates for the rpc as well

tame gazelle
#

all changes aren’t in the guide 'cuz v14 is still in dev right?

long narwhal
umbral slate
#

Should we make threads for ongoing issues to draw more attention to them?

#

I've already opened an issue on GitHub but it got no attention and it's pretty important

velvet jasper
umbral slate
brave mulch
#

Noice yya

knotty plover
umbral slate
knotty plover
#

Yeah idk, I did the initial component design but theres been so much change, especially with typings, since then that I dont want to touch it lol

umbral slate
#

The only issue with that bug is the fact that some types are made out of unions, so Omit doesn’t work on them

proper cape
#

So

Embed.addFields([/* Some api fields */]);

is throwing

ZodError: [
  {
    "code": "invalid_type",
    "expected": "object",
    "received": "array",
    "path": [
      0
    ],
    "message": "Expected object, received array"
  }
]

which i assume is a bug?

velvet jasper
proper cape
#

Heres the actual embed

new Embed()
    .setColor(grass)
    .setTitle('Welcome to #help')
    .addFields([
      { name:'Please keep conversations related to questions and answers.', value: 'Take other off topic conversations to their appropriate channels.' },
      { name:'You will be pinged when someone asks for help in #HelpDesk', value:'To avoid the ping, remove the help role using the button there.' },
    ])
#

i assume the parser doesnt hate trailing commas but idk

velvet jasper
#

like this:

.addFields(
      {
        name: 'Please keep conversations related to questions and answers.',
        value:
          'Take other off topic conversations to their appropriate channels.',
      },
      {
        name: 'You will be pinged when someone asks for help in #HelpDesk',
        value:
          'To avoid the ping, remove the help role using the button there.',
      }
    );
proper cape
#

oh... would be nice if the docs reflected that

#

current docs are relatively misleading in that case

uncut kelp
#

It's probably spread and doesn't show that

proper cape
#

probably, the link to src not working currently makes checking that annoying as well

uncut kelp
proper cape
#

Builders module, main branch, Embed

#

i assume main is on @digital dust @ dev

#

woops sorry about that ping

uncut kelp
#

Yeah it accepts a spread and seems the documentation don't wanna put that in

proper cape
#

in the function its spread, is it spread in the jsdoc?

#

because the documentation reads from jsdoc

uncut kelp
#

Ah uh this is TypeScript, we use typedoc

deep jetty
#

its typescript theres no types in the jsdoc

proper cape
#

oh wait right

#

welp i guess its just a matter of whenever the documentation website gets updated

distant prawn
#

Should I update my bot to v14 now? Or wait until the stable version is released.

vocal sapphire
#

You can update, just expect some breaking changes sometimes

lethal trail
#

What is changed is v14?

scarlet tangle
#

Hey checking out the guide and I saw this

In addition, #isCommand, now indicates whether the command is an application command or not. This differs from the previous implementation where #isCommand indicated if the interaction was a chat input command or not.

velvet jasper
#

yes

#

you can have chat input commands, user commands, or message commands

scarlet tangle
#

So isCommand now triggers for all 3 cases?

velvet jasper
#

it's true for all 3 of those cases yeah

scarlet tangle
#

wait what's a chat input command vs message command

velvet jasper
#

user and message commands are the context menu commands

#

chat input commands are slash commands

scarlet tangle
#

ahhh, ok

#

Out of curiosity do you know any use cases where someone would use the more broad one over the specific ones?

twilit bobcat
#

they're all technically commands

#

context menu interactions extend the base command interaction class

scarlet tangle
#

oh i guess in djs they are

#

One such use case could be to handle the application commands (chat input + context menus) together in one handler

velvet jasper
twilit bobcat
#

they're registered the same way you register any application command

#

just with a USER / MESSAGE type instead of CHAT_INPUT and other stuff like lack of options

scarlet tangle
icy dew
#

So i use numbers for types in slash commands, are they subject to change?

(e.g. i use type: 1 for chat input, and for options i use type: 3 for STRING)

Is it better to use exported values or are they the same?

knotty plover
#

Numbers are fine

icy dew
#

alright, thanks

umbral slate
icy dew
#

i prefer numbers, probably since I've used them a lot now

woven grove
#

your question is "are they subject to change"

#

every value is

#

hence the enums

icy dew
#

ah alright then

summer elbow
#

Is there a What’s new page of sorts for the dev branch?

#

Or is it just the refactoring for the name changes and enums?

deep jetty
#

theres the commit history if you want a full list but theres a WIP migration guide page ^

summer elbow
split fulcrum
#

What is new in v14?

#

Or what will be new?

vague coyote
split fulcrum
#

Okm

obtuse crater
#

Is it intentional that <User>.flags.toArray() always returns None, even when user has flags?

obtuse crater
#

Yes

velvet jasper
obtuse crater
#

Sure

lost ledge
#

Will modals be implemented in v13 or v14?

velvet jasper
lost ledge
#

oh alright

cinder scaffold
#

Why djs v14?

vague coyote
#

Why not?

cinder scaffold
#

I think no need of it

#

V13 was enough

woven grove
#

lol

vague coyote
#

lmao

velvet jasper
silk topaz
#

damn

scarlet tangle
#

hey discord..js v14 not support @dry tulipjs/builder

vague coyote
#

thats a separate package siris is more intelligent than me KEKW

velvet jasper
scarlet tangle
#
+ const { ApplicationCommandType, ApplicationCommandOptionType } = require('discord.js');

const command = {
  name: 'ping',
- type: 'CHAT_INPUT',
+ type: ApplicationCommandType.ChatInput,
  options: [
    name: 'option',
    description: 'A sample option',
-   type: 'STRING',
+   type: ApplicationCommandOptionType.String
  ],
};```
#

we need to change if (!interaction.isCommand()) return;?

vague coyote
#

<Interaction>.isCommand() checks if the interaction is a CommandInteraction

#

so, thats up to you

scarlet tangle
vague coyote
#

CHAT_INPUT -> CommandInteraction -> isCommand()

scarlet tangle
vague coyote
#

I have no idea what you want xD

#

<Interaction>.isCommand() checks if the interaction is a CommandInteraction
so, thats up to you

slim wharf
woven grove
#

the enums are "raw"

#

because they are -types enums

velvet jasper
#

Also let’s assume discord changes the type of chat input to “2”, if you’re using an enum you wouldn’t be affected by this change

icy dew
scarlet tangle
icy dew
timid talon
#

How to install discordjs dev version using yarn

scarlet tangle
#

or the channel topic, whichever feels closer

timid talon
scarlet tangle
#

You don't need anything special for yarn

timid talon
#

oh ok

scarlet tangle
#

just add the @dev tag

vague coyote
median jetty
#

guild get response undefined

urban belfry
vague coyote
#

yes, thats intended behaviour.

#

Not sure what you expect.

#

The client isn't ready, thus has no data.

hollow spoke
#

v14 preperation? 😳

vague coyote
#

yes?

#

minor versions wont do it in long term

timid talon
#

Why isn't Embed#setColor("BLURPLE") not working

uncut kelp
#

It doesn't parse strings iirc

timid talon
#

oh

uncut kelp
#

For now you can import resolveColor() from Util and do <Embed>.setColour(<Util>.resolveColor("BLURPLE")) or something

timid talon
#

It gives me this error

ZodError: [
{
"code": "invalid_type",
"expected": "number",
"received": "string",
"path": [],
"message": "Expected number, received string"
}
]
uncut kelp
#

Yea it's currently a known issue. I think something is gonna be done to remedy it, but not sure just yet

timid talon
#

Thanks

median jetty
#

I can made video on youtube on djs v14

uncut kelp
#

You what

median jetty
#

I can make a video on v14

uncut kelp
#

Okay

#

o,o

tall verge
#

Hello, does anyone know where the list of permissions?

uncut kelp
#

What is a permit

uncut kelp
#

Go there and ask

tall verge
#

I mean all permissions names of v14

#

._.

uncut kelp
#

I mean nothing has changed

uncut kelp
#

You're welcome!

tardy frost
dawn phoenix
#

you'd think correctly

undone yew
#
        "GUILD_MEMBERS",
        "GUILD_BANS",
        "GUILD_EMOJIS_AND_STICKERS",
        "GUILD_INTEGRATIONS",
        "GUILD_WEBHOOKS",
        "GUILD_INVITES",
        "GUILD_VOICE_STATES",
        "GUILD_PRESENCES",
        "GUILD_MESSAGES",
        "GUILD_MESSAGE_REACTIONS",
        "GUILD_MESSAGE_TYPING",
        "DIRECT_MESSAGES",
        "DIRECT_MESSAGE_REACTIONS",
        "DIRECT_MESSAGE_TYPING"

what is the name of these intents in v14?

icy dew
#

Same, but PascalCase instead of SCREAMING_SNAKE_CASE iirc

undone yew
uncut kelp
urban belfry
#

the names are the same, just the style's have changed

uncut kelp
#

You import from discord-api-types

icy dew
#

GUILD_MEMBERS become GuildMembers

#

and so on

median jetty
#

When will version 14 of djs

urban belfry
tame gazelle
#

is it still possible to use them as string (like intents in v13) ?

undone yew
#

@uncut kelp how to import?

urban belfry
#

literally the guide i've sent

uncut kelp
#

You were told above

icy dew
median jetty
#

Version 14 may be buggy

urban belfry
velvet jasper
undone yew
#

how do i import it?

uncut kelp
#

It's literally above

#

In many screenshots

#

Many people talking

undone yew
#

I using

icy dew
velvet jasper
#

Which docs?

icy dew
#

because i checked the main branch and the IntentsResolveable accept strings

uncut kelp
#

I guess they're not updated

velvet jasper
#

Oh yeah gotta fix that

icy dew
#

oh you found it

velvet jasper
velvet jasper
#

Lol

tame gazelle
#

it works like this

#

no error

velvet jasper
#

Hmmmm

urban belfry
#

i checked strings, it worked, then i updated, now it doesn't work

icy dew
#

I'm confused now

tame gazelle
#

it's the latest dev right?

icy dew
#

lemme check npm

vague coyote
#

14.0.0-dev.1643544396.388f535

#

seems about right

icy dew
#

14.0.0-dev.1643544396.388f535

tame gazelle
icy dew
#

I'm slow

#

lol

icy dew
tame gazelle
#

I didn't get error like BITFIELD_INVALID so yes ig

icy dew
#

hmm alright

vague coyote
#

I highly doubt thats working

velvet jasper
tame gazelle
#

gonna try

#

interactionCreate only needs Guilds intent right?

#

so I can test a / command?

icy dew
#

idk

#

iirc yes

tame gazelle
#

I'll add guildCreate event

icy dew
#

or that

#

hea

tame gazelle
#

for make sure

urban belfry
#

just add GuildMessages (with Guilds of course) and a messageCreate listener

icy dew
#

you can try using GuildMessages

tame gazelle
#

it works

#

get an error inside the guildCreate event but it works ._.

icy dew
#

what error?

tame gazelle
#

Discord.MessageEmbed isn't a constructor

icy dew
#

ah

dawn phoenix
#

Embed

icy dew
#

So intentional or bug

#

for intents using array of strings

velvet jasper
tame gazelle
#

regardless

velvet jasper
#

Ok that’s a bug then

tame gazelle
#

I didn't update all the code yet

velvet jasper
tame gazelle
#

I meant that I have the error in my code

#

it's not a d.js issue

velvet jasper
#

Ok

tame gazelle
#

I didn't get correctly your question ._.

#

we cannot pass string for .setColor() ?

icy dew
#

nope

#

use the resolver

velvet jasper
icy dew
#

I'm assuming this is the same for JSON embeds as well?

velvet jasper
#

Iirc that would work there

tame gazelle
icy dew
#

hmm ill try and see s

slow storm
plain roverBOT
#

Documentation suggestion for @tame gazelle:
<:_:874569335308431382> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.

icy dew
#

ignore mine, use ^

#

oh it wasn't in the guide, i saw it somewhere else mb

tame gazelle
#

and VSC is saying that <GuildChannel>#isText() is still a method

icy dew
#

it is

tame gazelle
#

ah yeah

finite fog
plain roverBOT
tame gazelle
icy dew
#

TextBased includes GuildNews , Text and so on

vague coyote
#

isTextBased() is the old isText() and is isText() is now only a guild text channel

icy dew
#

also I'm assuming this is a discord bug right? (links not resolving) or is it docs

vague coyote
#

works for me

icy dew
#

I'm on mobile

#

so Discord ig

woven grove
#

*android

vague coyote
#

can confirm, doesn't work on android OMEGALIDL

tame gazelle
vague coyote
#

what will not get removed

urban belfry
#

using strings for intents

tame gazelle
#

and partials

woven grove
#

yeah you cant use strings

#

use the enums

icy dew
#

alright

tame gazelle
#

in the latest dev I can so it means that you will remove this?

icy dew
#

probably, since it isn't intended

woven grove
#

most likely

scarlet tangle
#

is this right js const client = new Client({intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildMessageReactions]});

scarlet tangle
#

so this changejs const { MessageEmbed } = require("discord.js"); now js const { Embed } = require("discord.js");

tame gazelle
#

yup

scarlet tangle
tame gazelle
#

check the guide in the pin

scarlet tangle
#
const but = new MessageButton().setCustomId("ne").setLabel("1").setStyle("SECONDARY");``` is this change?
velvet jasper
#

nope

scarlet tangle
velvet jasper
#

no, please check the guide

scarlet tangle
velvet jasper
#

you need enums instead of strings

scarlet tangle
#
Did you mean discordjs.guide?
The site you just tried to visit looks fake. Attackers sometimes mimic sites by making small, hard-to-see changes to the URL.```
scarlet tangle
velvet jasper
finite fog
scarlet tangle
#

not say for spoonfeed

#

you not change my code

#

just give ma small example

#

that not call as spoonfeed

scarlet tangle
#

what is this js const { EnumResolvers } = require('discord.js'); const enumValue = EnumResolvers.resolveButtonStyle('PRIMARY');

vague coyote
#

its explained there...

scarlet tangle
#

idk where it work for

vague coyote
#

just a question, why do you use the dev version and not v13

scarlet tangle
#

so js const but2 = new MessageButton(); now js const but2 = new ButtonComponent();

vague coyote
#

thats... what the guide says, yes

scarlet tangle
vague coyote
#

Obviously, yes

scarlet tangle
vague coyote
#

You should prioritize learning JS instead of using an in-dev version of djs.

scarlet tangle
icy dew
#

we don't know

#

it will be released when it will be released

vague coyote
#

its a very early in-dev version

scarlet tangle
#

client.on change now?

vague coyote
#

Please, stop.

scarlet tangle
icy dew
vague coyote
#

The guide tells you all major changes.

icy dew
#

so int it is

dark light
#

client.on didn't change

scarlet tangle
vague coyote
tame gazelle
#

no strings allowed for button style too?

velvet jasper
#

yup

#

ButtonStyle.X

icy dew
#

or use the magic numbers but i think it isn't recommended

scarlet tangle
tame gazelle
#

ask here ._.

velvet jasper
#

also @tame gazelle strings for intents actually does work, it's a side-effect of us using the bitfield class

icy dew
scarlet tangle
icy dew
#

oop sorry for ping

velvet jasper
#

we'd have to change how BitField works

tame gazelle
vague coyote
scarlet tangle
icy dew
#

maybe in the guide, add the changes about .setColor() or color as well? I mean it's the same as button styles, so maybe a tip or something?

velvet jasper
#

i don't think a decision has been made about wheter we'll allow color strings or not

#

it just so happens the /builders version don't support color

icy dew
#

using JSON

distant canopy
#

.setColor()?

velvet jasper
icy dew
#

embeds[0].color[NUMBER_TYPE_COERCE]: Value "GREEN" is not int.

#

but using 0x00FF00 works

velvet jasper
#

yeah I think we're missing a step in serializing the json

icy dew
#

hmm alright

velvet jasper
#

this is what the old code is doing, so I think this needs to be added into the new code

icy dew
#

ah

scarlet tangle
#

is this right way js const embed1 = new Embed()

distant canopy
#

Looks about right

tame gazelle
#

looks like I've finished that are in the guide
thanks for help

#

something.hexColor still returns a string

#

do I have to do Util.resolveColor(someting.hexColor) ?

finite fog
#

Yeah, or you use .color

tame gazelle
#

.color would be better, thanks

jaunty vault
#

is there a reason that Embed is not in docs?

icy dew
velvet jasper
icy dew
#

oh

tame gazelle
#

does 0xDD000 still works for .setColor() ?

jaunty vault
#

Embed is part of builders now??

tame gazelle
#

you can import it from discord.js

icy dew
velvet jasper
jaunty vault
tame gazelle
#

dunno

icy dew
#

i use json so idk

velvet jasper
icy dew
#
msg.reply({ 
  embeds: [someEmbed], 
  components: [{
    type: 1, components: [
      { style: 1, label: "TestLabel", customId: "testing", type: 2 }
    ]}
  ]
})

this gives me an error components[0].components[0].custom_id[BUTTON_COMPONENT_CUSTOM_ID_REQUIRED]: A custom id is required

velvet jasper
icy dew
#

yea that works

#

so will snake_case be the new way to send stuff using JSON?

velvet jasper
icy dew
velvet jasper
#

if you can that would be greatly appreciated

icy dew
#

alright

tame gazelle
#

the class ContextMenuInteraction has been renamed?

jaunty vault
tame gazelle
#

thanks

icy dew
#

@velvet jasper hmm if i look at the builder docs, all of them use snake case. Could it be because of that?

velvet jasper
#

possibly

icy dew
#

alright

icy dew
#

I made an issue just in case

dull mulchBOT
median jetty
#

list of all intent

vague coyote
#

okay nvm, docs suck

median jetty
#

No the intents is changed

vague coyote
#

I see

#

@velvet jasper what happened with the intents OMEGALIDL

vague coyote
#

ah we had that talk already in internals, nvm then

median jetty
velvet jasper
vague coyote
#

they are not linked anymore btw

#

they are missing?

plain roverBOT
#

<:_:874569310025179188> Partial
A Partial object is a representation of any existing object. This object contains between 0 and all of the original objects parameters. This is true regardless of whether the parameters are optional in the base object.

vague coyote
#

thats stable

quick elm
#

hawyeah

icy dew
median jetty
#

The new permission is this

velvet jasper
vague coyote
#

siris do you know where partials went

median jetty
#

Correct?

velvet jasper
median jetty
velvet jasper
#

yes

tame gazelle
median jetty
# velvet jasper yes
    Perms: [
        "CREATE_INSTANT_INVITE",
        "KICK_MEMBERS",
        "BAN_MEMBERS",
        "ADMINISTRATOR",
        "MANAGE_CHANNELS",
        "MANAGE_GUILD",
        "ADD_REACTIONS",
        "VIEW_AUDIT_LOG",
        "PRIORITY_SPEAKER",
        "STREAM",
        "VIEW_CHANNEL",
        "SEND_MESSAGES",
        "SEND_TTS_MESSAGES",
        "MANAGE_MESSAGES",
        "EMBED_LINKS",
        "ATTACH_FILES",
        "READ_MESSAGE_HISTORY",
        "MENTION_EVERYONE",
        "USE_EXTERNAL_EMOJIS",
        "VIEW_GUILD_INSIGHTS",
        "CONNECT",
        "SPEAK",
        "MUTE_MEMBERS",
        "DEAFEN_MEMBERS",
        "MOVE_MEMBERS",
        "USE_VAD",
        "CHANGE_NICKNAME",
        "MANAGE_NICKNAMES",
        "MANAGE_ROLES",
        "MANAGE_WEBHOOKS",
        "MANAGE_EMOJIS_AND_STICKERS",
        "USE_APPLICATION_COMMANDS",
        "REQUEST_TO_SPEAK",
        "MANAGE_THREADS",
        "USE_PUBLIC_THREADS",
        "USE_PRIVATE_THREADS",
        "USE_EXTERNAL_STICKERS"
    ]
}```
#

I use this

#

for permission validation

#

is required js PermissionFlagsBits

velvet jasper
#

if it's a bitfield strings are allowed

median jetty
#

@velvet jasper

tame gazelle
velvet jasper
#

yes

tame gazelle
tame gazelle
#

I'm confused

vague coyote
#

you could have tested it

#

took me 3 minutes to test that

slim wharf
tame gazelle
river harbor
#

ah shit... here we go again...

tame gazelle
#

but Crawl said that it will be removed so ._.

river harbor
#

time to rewrite my bot...

vague coyote
#

do you have any benefit in using v14, lurker?

tame gazelle
#

me?

river harbor
vague coyote
#

this isn't a release

#

its an in-dev version

river harbor
#

no, but when it comes out i'll need to rewrite

vague coyote
#

that will still take some time

slim wharf
# vague coyote already is

I can't understand, whats the reason.

I literally had to change 1000 of lines for v13 to UPPER_CASE permissions.
Now it is being removed, seriously?

With this kind of breaking changes, it is pointless to keep your bot up-to-date with the upstream

vague coyote
#

then dont do it, we use discord-api-types now

#

and we already used upper case permissions in v12

woven grove
#

Feel free to fork

jolly pike
#

write the bot in typescript, makes upgrading much easier

slim wharf
tame gazelle
#

in v14 you will be able too

slim wharf
tame gazelle
#

it does

vague coyote
slim wharf
#
  • The v12 - v13 migration guide suggested it.
vague coyote
#

yes, thats the recommended way of using it, doesn't mean its the only way

jaunty vault
#

are builders getting better errors?

slim wharf
#

So now, I have to do PermissionFlagBits.Administrator?

vague coyote
#

Thats the recommended way, yes

vague coyote
urban belfry
#

looks like it hasn't been implemented yet

slim wharf
vague coyote
#

I cant tell you why they switched to how it is now

slim wharf
vague coyote
#

SNAKE_UPPERCASE :P

velvet jasper
#

we're following the microsoft style guide for this

novel notch
#

Does anyone know if there is already a discord.js v14 guide?

balmy ember
#

Yes, it is linked in the pinned messages

novel notch
#

Thanks

dawn phoenix
plush monolith
# velvet jasper we're following the microsoft style guide for this

Hey, I understand your point, but on the other hand. Discord.js major version comes out every year or so, and you make so many major changes that I think are sometimes unnecessary. Wouldn't you like to take a slightly different tactic? I'm sure you wouldn't want to keep rewriting it either. For example, there was RichEmbed, then MessageEmbed, and now there will be Embed. Ok, that's enough just replacnut but there are also changes that require manual rewriting.

vague coyote
velvet jasper
novel notch
#

Someone knows how to put the buttons I get the error TypeError: MessageButton is not a constructor

novel notch
#

Thanks

flint bough
#

v14 already??

vague coyote
#

its still in development

#

isn't like thats what the first pin says

knotty plover
#

And the category name

#

And the channel name implies it

vague coyote
#

and the fact that the guide is a deploy preview KEKW

dawn phoenix
woven grove
#

Spoiler: because we can

novel notch
#

How can I search in the guide that the search engine does not load anything

vague coyote
#

Weird, agreed, doesn't work.

dawn phoenix
#

The deploy preview has probably been built before some breaking internal changes, so the search keys are still outdated

novel notch
#

Then someone can pass me the section of embed and buttons please xd

novel notch
#

Thanks

shadow plume
#

ow my a lot of changes yay

novel notch
#

I left to send an embed but without color xd

stray ferry
#

what is this?

scarlet tangle
gusty pier
#

guide seems to have conflicting info - it mentions both EnumResolvers#resolveButtonStyle and EnumResolvers#buttonStyle

icy dew
knotty plover
#

🧂

icy dew
# sly narwhal so dumb btw

look at the pins if you want to see why it happened. Obviously no one wants to rewrite thousands of code, but they have to change it for consistency so that it's easier to spot bugs and actually not make the code hard to maintain

sly narwhal
#

will read

undone yew
#

how to fix?

tame gazelle
#

check the guide

#

in the pin

undone yew
tame gazelle
icy dew
#

I'm assuming channel.type will also return a number right?

#

so we would have to do if (<Channel>.type === 2) right?

#

or use the enum resolver

pliant salmon
#

Use enum resolver probably

#

channel.type should return what the api returns to you, so or it returns a string or djs itself implemented the enum resolver inside the type function

icy dew
#

so if (<Channel>.type === <EnumResolvers>.resolveChannelType("DM"))

#

or would it be Dm

pliant salmon
#

W8 lemme check, bcz i think you can just do "DM"

icy dew
#

I think it would Dm since they are changing from SCREAMING_SNAKE_CASE to PascalCase

#

So GUILD_TEXT becomes GuildText

pliant salmon
#

Idk, i just woke up saw the "news" abt djs v14 and im going to start converting stuff now

#

But im pretty sure channel.type will still return a string

icy dew
icy dew
undone yew
#

my code;

const { MessageEmbed } = require('discord.js');

         const embed = new MessageEmbed()
          .setTitle("Something went wrong...")
          .setDescription(`Sorry, you have **blacklisted** the bot by its \`Founder\` or \`Developer\`. You cannot use the bot's commands. `)
          .setTimestamp()

          return interaction.reply({ embeds: [embed], ephemeral: true})
undone yew
#

uh, thx

pliant salmon
icy dew
pliant salmon
icy dew
#

ah

#

knew it

tame gazelle
#

numbers so?

icy dew
#

so either magic numbers or enum resolvers

icy dew
# tame gazelle numbers so?

iirc you can use numbers, but if discord changes it, you will have to implement the changes yourself. If you use EnumResolvers, then you won't have to change anything

pliant salmon
#

@icy dew just import ChannelType from djs and do like so

icy dew
#

Oh yes that

pliant salmon
#

this should fix your problem without enum resolvers

tame gazelle
#

EnumResolvers would be better but does discord.js calls the resolver internally?

icy dew
#

but shouldn't it be ChannelType.Dm? or ChannelType.DM? DM is an acronym right?

pliant salmon
#

i mean, if you use vscode intellisense should do it for you

undone yew
tame gazelle
icy dew
#
- const button = new MessageButton();
+ const button = new ButtonComponent();

- const selectMenu = new MessageSelectMenu();
+ const selectMenu = new SelectMenuComponent();

- const actionRow = new MessageActionRow();
+ const actionRow = new ActionRow();
undone yew
#

thx

pliant salmon
icy dew
#

I have it, but it's gonna take years to load so forgive me if you hear me saying this, but I am using good ol' Notepad

pliant salmon
#

xd

#

are the activity type changes listed on the changelog? 🤔

icy dew
#

idts

#

i mean only this thing changed:

- new ActivityFlags()
+ new ActivityFlagsBitField()
pliant salmon
#

yeah i mean the activity type

icy dew
#

yea it isn't listed then

pliant salmon
#

they also changed that to enum but i didnt see it properly mentioned

icy dew
#

lmao

#

we could just use Channel.isDM()

#

instead of channel.type === "something"

pliant salmon
#

if isDM returns a boolean then there is no need to call it

#

but the code for it would literally be the same

icy dew
#

ye i mean if only we found this earlier

#

all methods btw

pliant salmon
#

the only reference i could possibly find about the changes in the activities is here (screenshot) but i think this should be listed anyways

icy dew
#

Most stuff isn't documented yet, and is subject to change, so we'll just have to wait ig

#

or notify one of the contributors or smth

pliant salmon
#

i mean, im fine bcz of vscode i just think that it should be documented for anyone who starts

icy dew
#

pretty sure it's in their to-do list

#

yup

undone yew
#

how to fix?

pliant salmon
#

also, that doesnt look like a djs error

#

but maybe try to look at this

undone yew
#

There was no such thing before the discordjs error v14.

#

.setColor(ctx.config.color.default)

icy dew
icy dew
undone yew
#

how to fix?

hazy vine
icy dew
undone yew
#

Do I need to send numbers?

pliant salmon
#

yes

undone yew
icy dew
pliant salmon
#

also, there is other thing missing on the documentation for v14, just leaving the note here that dynamic got removed

undone yew
icy dew
#

so ```js
const { Embed, Util } = require("discord.js")

const embed = new Embed().setColor(Util.resolveColor("GREEN"))

undone yew
#

thx

pliant salmon
#

just .setColor("#00FF00")

icy dew
pliant salmon
#

or if you prefer setColor(0x00FF00)

icy dew
#

according to docs

icy dew
pliant salmon
icy dew
#

int !== string

pliant salmon
#

0x00FF00 === "#00FF00"

icy dew
#

nope

pliant salmon
#

both represent hex values

icy dew
#

but the type is different

tame gazelle
#

the second one doesn’t work

#

only 0xyddhdjz

pliant salmon
icy dew
pliant salmon
#

bcz using #00FF00 used to work

pliant salmon
icy dew
#

it's not listen in change logs

pliant salmon
#

that explains it but also doesnt make sense

icy dew
pliant salmon
#

it used to be

#

lemme see smtg

icy dew
#

at first i was confused, until someone said to use util.resolveColor in this channel

#

if you want RANDOM, then use util.resolveColor

pliant salmon
#

na

#

i think im fine,
biggest part of the embeds i use just grab the color from the user

icy dew
#

ah, then you should be fine

pliant salmon
#

yeah

#
  • i have my own fromHex function if needed
#

but i will take a look at djs one just for curiosity

undone yew
pliant salmon
#

use the enum values

undone yew
#

how?

pliant salmon
#

where you are creating the buttons

icy dew
#

use EnumResolvers for button styles

pliant salmon
#

create them with the new enums instead of "PRIMARY" and stuff like that

icy dew
#

^

undone yew
pliant salmon
#

thats one of the main changes

icy dew
#

either import ButtonStyles and do ButtonStyles.Primary

undone yew
#

database of buttons

icy dew
#

or import EnumResolvers and use EnumResolvers.resolveButtonStyle("Primary")

pliant salmon
icy dew
#

hmm, the guide shows caps

tame gazelle
icy dew
#

Because it's ButtonStyle.Primary

#

so i thought it should be the same with resolveButtonStyle()

#

I think something isn't intended

pliant salmon
#

the old way was also caps

icy dew
#

why isn't Primary in caps?

#

oh one uses discord-api-types and one is from djs itself

undone yew
icy dew
tame gazelle
#

<Message>#type is a number now?

undone yew
icy dew
#

ButtonStyle.Primary or EnumResolvers.resolveButtonStyle("PRIMARY")

icy dew
#

mb

tame gazelle
#

how can I display <ChannelType>#type as string?

pliant salmon
tame gazelle
undone yew
icy dew
tame gazelle
pliant salmon
icy dew
pliant salmon
#

even tho idk why they did that bcz if you compile enum from ts you can use both number and string

#

so it doesnt make sense to me the route they went

tame gazelle
icy dew
#

not all ppl use ts

pliant salmon
icy dew
icy dew
#

if we do resolveChannelType(2), will it return a string?

pliant salmon
undone yew
#

new error

#

@icy dew do you know?

icy dew
pliant salmon
#

like...

icy dew
#

so both return numbers

pliant salmon
#

yes

undone yew
pliant salmon
#

thats why they could keep string, and if its string you index it to the enum

icy dew
#

your emoji has to be a raw object

#

i.e client.emojis.cache.get(config.emoji.button.delete)

undone yew
#

config

icy dew
#

and so on

undone yew
icy dew
undone yew
#

okay

tame gazelle
pliant salmon
tame gazelle
#

the error said that it's line 79

rain bramble
# tame gazelle

Shouldn't it be { name: "name", value: "value", inline: true }?

tame gazelle
#

isn't that for .addFields() ?

pliant salmon
icy dew
tame gazelle
#

._.

undone yew
pliant salmon
icy dew
undone yew
#

using customId:

icy dew
#

it's custom_id: now

pliant salmon
#

addField: { name: string, value: string, inline: boolean | undefined }
addFields: [{ name: string, value: string, inline: boolean | undefined }]

#

so instead of spamming addField you can just create a bunch in 1 function

tame gazelle
#

yeah but I add fields in a if statement ._.

pliant salmon
#

its valid to just do addField a bunch of times

tame gazelle
#

I do that

pliant salmon
#

but its redundant

#

thats why addFields exists

urban belfry
# undone yew AA

that's not how it works
it should be type: 1, components: [....]
what you have is the completely wrong format
again, show your code

pliant salmon
#

ofc if you use if statments to define them there isnt much to do

undone yew
#

It works, but the buttons do not work

#

if(button.customId == 'delete') {}

icy dew
pliant salmon
undone yew
#

v15: Embed => MessageRichEmbed .D

pliant salmon
#

welp i havent messed with buttons for a while

icy dew
#

welp time to refactor my code

#

i think all camelCase properties for classes in builders will be changed to snake_case

pliant salmon
#

at least the only thing i had to change in my client was the DM type and interaction isCommand

icy dew
#

yea

pliant salmon
#

commands will be the problem

icy dew
#

i mean vsc has find and replace

#

shouldn't be that hard

pliant salmon
#

it isnt

icy dew
#

you just press enter all along the way

pliant salmon
#

but some of my bots i do not maintain anymore so i gotta ask the current coder to learn how to do that bcz he uses webstorm

#

the only thing im rly wondering is if people rly use the collection functions

undone yew
icy dew
pliant salmon
undone yew
#
            system.on('collect', async (button) => {
        
              if(button.custom_id == 'delete') {
        
                interaction.deleteReply();
        
                await button.deferUpdate();
        
              } else if(button.custom_id == 'previous') {...}
#

where error?

icy dew
#

hmm, that returns a ButtonInteraction

pliant salmon
#

maybe wrap it in a try...catch to see the error?

tame gazelle
icy dew
undone yew
#

Interaction failed error occurs when pressing the button

tame gazelle
#

it takes an object too

pliant salmon
#

then reply to the button bcz i dont see where interaction is defined

pliant salmon
tame gazelle
#

.addFields() doesn't take an array

pliant salmon
#

it does

tepid narwhal
#

"await interaction.deleteReply()" normaly ?

icy dew
#

what?

tame gazelle
#

wrong reply

icy dew
pliant salmon
#

fields is not field

tame gazelle
#

I know

tepid narwhal
tame gazelle
undone yew
icy dew
tame gazelle
pliant salmon
#

they added ...

icy dew
pliant salmon
#

undocumented changes

pliant salmon
# icy dew bruh

not documented, you can see on my screenshot they added ...

icy dew
#

yea, i guessed it

pliant salmon
#

now you can just do it without the []

undone yew
pliant salmon
#

which is pain

pliant salmon
pliant salmon
tame gazelle
#

for?

#

ah Formatters?

pliant salmon
#

yes

tame gazelle
#

I've never used it

pliant salmon
#

idk

#

i think they have something but im not sure

#

they do

scarlet tangle
#

discord.js v14 !?

vague coyote
dawn phoenix
#

unsure what you expect as an answer to that query

scarlet tangle
#

and what happened to v13 guide

vague coyote
#

all you need to know so far is pinned

scarlet tangle
#

I remember there is a another site explaining think better

dawn phoenix
scarlet tangle
dawn phoenix
#

also linked here

scarlet tangle
#

ok

pliant salmon
#

i think this should be addressed asap

#

3 lines with that error on djs types

undone yew
dawn phoenix
#

then it doesn't even reach that point of your code

undone yew
#

what could be the problem?

dawn phoenix
#

hard to say, try to find out where your code stops execution/differs execution wise from what you expect

pliant salmon
#

Souji, should i open a issue about the types?

dawn phoenix
#

i have no idea what's going on there, but i did update a bot yesterday with the recent at-dev release and did not encounter any errors

undone yew
dawn phoenix
#

and how are we supposed to find it then?

pliant salmon
undone yew
#

Definition:
button.customId

Button:
custom_id

#

Interaction failded