#djs-in-dev-version

1 messages · Page 10 of 1

atomic cobalt
#

how did u get access to do it?

velvet jasper
#

the notion is public to anyone?

atomic cobalt
#

oh

vague coyote
#

does it say it came out

#

thats a pr for modals, doesn't mean its released

wooden ruin
#

a github pull request review, it means the devs need people to check, discuss whether the update is good

vague coyote
#

then it wont work...

#

they aren't released

#

what

knotty plover
#

The GitHub is a monorepo of multiple packages
The discord.js package is just one of them

vague coyote
#

which files

knotty plover
#

For what

vague coyote
#

can you like... be a bit more specific

knotty plover
#

What are you trying to edit and why

#

We don't know what edits you're trying to make lol

#

You cant

#

Or I mean you can, but the API calls won't work

vague coyote
#

why do you want to edit that anyway Thonk

knotty plover
#

That's not how that works

#

You don't just edit your node_modules with random un-merged code

#

Wait until it's merged into our @dev release, then it'll be ready for use

copper shuttle
#

discord.js v12: So easy
discord.js v13: Huh??
discord.js v14: Thqnkqng

vague coyote
copper shuttle
#

In discord.js v12, anything is easy, including playing music, building a moderating bot

tame gazelle
#

v13 too

velvet jasper
#

What is your definition of easy?

copper shuttle
tame gazelle
#

the only thing that is annoying in v14 it’s enums but that’s life

copper shuttle
#

But in v13... <VoiceChannel>.create connection(...); then we need to handel disconnect event

#

in v12 discord.js will do it for u

velvet jasper
#

I mean I have to say the v12 to v13 upgrade was much more involved than v13 to v14

copper shuttle
#

I hope v15 won't be crazy

vague coyote
#

I hope it will

dawn phoenix
#

v13 - v14 on my end was mostly
a) embed builders are pain
b) finding out where various enums reside

neat aspen
#

Since you are already talking about the different versions:

How do you decide when to release new major versions?
Like from 12 to 13 was quite obvious with the introduction of Interactions together with breaking changes.

v14 seems to be more around the overall project structure.
So the release of that version is tied to when all of that is finished.
But are there additional things you wait for? Like the new permission system (I could imagine that also being a breaking change) or the Modals?

How do you decide when a new major version is "ready to ship"?

timber lynx
#

breaking changes.

dawn phoenix
#

we introduce features as soon as possible (and they are tested and documented on the DAPI docs)
most features can be released in minor versions 13.x
bug fixes are released in patch versions 13.x.y
changes to the libraries structure or other breaking changes are released in major versions

when we determine a version has been tested sufficiently (actually been run on a bot for a bit and observed) we release a version if we do not expect any other changes in the next short timespan (to avoid releasing 13.x+1 shortly after 13.x)
this consideration becomes more elaborate for major versions, because shipping 14 very shortly after 13 is of course annoying for developers that want the new stuff but don't want breaking changes, which is understandable

major versions often have a certain theme around them, once that is completed the version can be shipped after being tested

#

for v14, so far, it's "things we implemented weirdly before and are a pain to maintain" as well as the switch to a monorepository merging the various projects (also for easier maintainability).
we expect some features to come to discord in not too much time from, which will be incorporated into v14 and shipped with it (as they may or may not also include breaking changes we are considering holding off the release until we get more clarity about the release schedule for these)

neat aspen
#

Thanks! I was specifically wondering about the "avoid releasing 13.x+1 shortly after 13.x"
Because I think the new permissions / slash command option types / modals wouldn't necessarily be breaking changes in itself, so I was curious if v14 was tied to these features.

But your explanation makes perfect sense to "wait" as they are assumed to be released soonish anyways

velvet jasper
neat aspen
#

Oh I thought as much. Wasn't expecting them to be released still in v13 just to be "fixed" for v14 again

scarlet tangle
#

hi how do i fix this

const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
                                              ^
TypeError: Cannot read properties of undefined (reading 'FLAGS')```
vague coyote
scarlet tangle
#

but im using v14

urban belfry
#

@scarlet tangle i've already told you, the pins
it tells you what to change :\

vague coyote
#

yes it is

undone yew
#

Removed user.presence with Discord JS v14?

outer bane
#

that got already removed in v13, it's only on GuildMembers

undone yew
outer bane
#

presence was never on users. User#presence simply searched for a GuildMember associated with the User that had a presence

undone yew
#

So we can't show

scarlet tangle
#

you can

undone yew
scarlet tangle
#

<GuildMember>.presence

undone yew
scarlet tangle
#

wdym

undone yew
#

How exactly do I define GuildMember?

jaunty vault
undone yew
#

I did not understand

jaunty vault
narrow badge
#

wait what

#

v14 when

jaunty vault
vague coyote
undone yew
#

What is the code that finds bots in Discord?

vague coyote
#

what

undone yew
#

I want to pull the bots

vague coyote
#

I have no idea what you mean

uncut kelp
#

Can you please explain the problem or problems you are facing in a more in-depth explanation or a possible scenario?

undone yew
#

I want to get the number of bots I will print to the stats command (all servers)

#

I didn't say write, I said what was the receiving code?

dawn phoenix
#

that's not easily possible, you'd need to considerably bloat your memory and fetch members on all servers your bot is on , to then filter by member.user.bot

#

for member stats we usually recommend summing up Guild#memberCount over all guilds, which is the only approach that scales but comes with a few caveats, such as overlap and not being able to filter for non-bot/bot users

#

also consider that these are, at the end of the day, empty stats and just a weird flex

waxen bridge
#

Is passing object literals to the components array in InteractionReplyOptions still allowed?

I'm using TS and get the following error when compiling:

Type '{ type: ComponentType.Button; custom_id: string; style: ButtonStyle.Primary; }' is missing the following properties from type 'ButtonComponent': setStyle, setURL, setCustomId, setEmoji, and 4 more.

node version: 16.13.2
djs version: 14.0.0-dev.1644235768.b936103
typescript version: 4.5.5

velvet jasper
waxen bridge
#

ok, thank you

sudden bobcat
#

Can I reply to a ephemeral message, (fetched) by without emphermeral?

jaunty vault
sudden bobcat
#

You can..

#

fetchReply: true

gritty citrus
#

u cant

sudden bobcat
#

Oka

knotty plover
#

You can fetch them

#

But no, you cant reply to them

jaunty kettle
#

where is the documentation for discord.js v14 or is it on the guide?

vague coyote
jaunty kettle
jaunty kettle
#

thanks xd

fiery aurora
#

ahh thanks, didnt know this channel existed :p

young kindle
#

oh i just observed v14 relies on enums now?

dawn phoenix
#

if you already observed it i'm not sure what you expect as an answer here

young kindle
#

you have a point Exit

urban belfry
#

i believe only the updating to v14 part is being updated right now

dawn phoenix
#

make it a number

#

dude, it's literally in dev

#

can do that in the PR, i guess

potent hawk
#

lol

silent marlin
#

I have question.

In v14 we still need to use the discord-api-types/v9, @discordjs/rest, @discordjs/builders packages?

thin inlet
#

Why did y'all change MessageEmbed to Embed?

jaunty vault
inner shard
#

Quick question, does <Interaction>#isCommand return true if the <Interaction> is what we previously knew as a <ContextMenuInteraction> in v14?

tame gazelle
gloomy kayak
inner shard
#

Okay need to get used to a context menu interaction being considered a "command" :/

gloomy kayak
#

It is a command technically

inner shard
#

Yeah true that makes sense

narrow badge
#

i think it will work

tame gazelle
#

nope

#

Administrator

velvet jasper
#

Either use pascal cased string or enum

#

Please avoid numbers they’re bad practice

urban belfry
#

if you read the guide

You might be inclined to use raw numbers (most commonly referred to as magic numbers) instead of enum values. This is highly discouraged. Enums provide more readability and are more resistant to changes in the API. Magic numbers can obscure the meaning of your code in many ways, check out this blog post if you want more context on as to why they shouldn't be used.

tame gazelle
#

yes

jaunty vault
#

Permissions.FLAGS has it in docs I believe

tame gazelle
#

*in the v13 doc

velvet jasper
#

It’s the same names just in pascal case

dim moss
#

hi what is this channel for ?

urban belfry
urban belfry
#

Yes, breaking changes
Read the pins

dim moss
#

shit here we go again ;-;

knotty plover
#

Major versions will likely always include something that is breaking

inner shard
#

Are modal interactions only coming in v14?

#

Okay thank you

brazen knoll
#

litttt

idle galleon
#

I’m not sure if v13 is still getting updates since the migration to mono repo in v14

knotty plover
#

v13-dev when

grave spindle
#

v14? i havent even updated to v13 in prod

idle galleon
#

v14 is still in-dev

#

Guess you should just migrate directly to v14

tame gazelle
idle galleon
#

Discord be releasing features too soon

#

No, when it’s ready™

knotty plover
#

It'll arrive when we need to deliver a breaking change

dim moss
#

Attachment for slash command is out now can we use it in V13 or we need to update dks version to v14 ?

knotty plover
#

Neither

#

We do not support features released 5 minutes ago

#

Please allow adequate time for discord.js development to actually happen

dim moss
#

I know but i just want to know that it will add in v13 or not ?

knotty plover
#

Undecided

dim moss
#

ok tnx

velvet jasper
#

This is not probable

#

Especially for modals

final mason
#

Hi, I've just seen this, any news on when it will be available with discordJS ? xd

knotty plover
#

no

wary wharf
#

I feel like there should be a pin for this lol

sick bone
#

no u

wary wharf
#

Everyone's about to come asking when it's being released

final mason
#

oof xd

knotty plover
#

There is, in general lmao

wary wharf
#

Lol

knotty plover
wary wharf
#

I assume you guys didn't get early access or whatever

final mason
#

didn't knew it was that recent my bad

wary wharf
#

Iirc inputs were early access

dim moss
velvet jasper
dim moss
#

Right

knotty plover
#

We did

#

Early access is not sufficient to deliver before release, or 5 minutes after

violet brook
#

Select menus too

velvet jasper
velvet jasper
violet brook
#

My mistake

knotty plover
#

The docs dont really say, it lists "components"

#

Probably for future proofing

violet brook
#

I just saw discussion in the developer discord and read "no buttons". Assumed that meant other things would be included

dapper forum
#

Do we have a PR merged/WIP for modals?

urban belfry
dapper forum
#

do you have a link to the PR?

dull mulchBOT
dapper forum
#

ty!

fluid igloo
#

when i try and run my bot

velvet jasper
fluid igloo
#

alright thank you

fluid igloo
#

has anyone gotten the buttoncomponent working for modals

ashen tartan
hardy bone
#

anyone built something using modals?

#

👀

ashen tartan
#

read my message above

hardy bone
#

yea, i was talking about raw api ;-;

ashen tartan
#

maybe ask in another server

knotty plover
midnight plume
knotty plover
#

Too bad

#

Modals dont support buttons yet

midnight plume
#

but it's planned to support

#

Do you think i can use textInput outside modal ?

knotty plover
#

No

scarlet tangle
#

What are modals can anyone provide me a article?

scarlet tangle
#

Thanks

naive orchid
lament wave
#

are modals supported yet on the v14? will they ever be suppported on v13?

knotty plover
#

no, yes, or at least a maybe

knotty plover
#

Sure

#

By adding them yourself

#

Nothing to do with us

#

You can wait for us to release them

#

We're not going to support hacky workarounds

scarlet tangle
quasi kite
#

Where's the repo/branch for v14

knotty plover
stark valley
#

Just wait

valid sparrow
urban belfry
valid sparrow
#

Oops, I thought this was 13 at-dev 😅

eternal roost
#

What is the changes of djs v14 dev

urban belfry
quasi kite
urban belfry
# quasi kite For v13?

this channel isn't for v13 to begin with, but the old source is in the stable branch of the repo

quasi kite
#

Oh ok but why don't you guys create a Dev or v14 branch that will contain the updated code incase there is some emergency where you need to immediately resort to something

#

It will be more organised and easier to manage

vague coyote
woven grove
#

I don’t understand your question

strange knoll
#

are modals in dev version yet?

strange knoll
strange knoll
#
components: [{
        type: 1,
        components: [{
          type: 4,
          custom_id: 'actual_modal',
          style: 1,
          minLength: 1,
          maxLength: 400,
          placeholder: 'hello face',
          required: true,
          label: 'hello fave'
        }]
      }]```
getting 
`Invalid Form Body
data.components[0].components[0]: The specified component type is invalid in this context`
what's wrong?
plain roverBOT
#

Documentation suggestion for @strange knoll:
<:_:874573940956217415> ComponentTypeEnumResolvable
A string that can be resolved to a ComponentType enum value. Here are the available types: (more...)

tame gazelle
#

use enums

strange knoll
#

just as string?

urban belfry
velvet jasper
gloomy kayak
#

You can actually clone the PR and require the packages/discord.js folder

strange knoll
velvet jasper
#

Djs

vagrant mortar
#

to install with modals do i just do npm i discord.js@dev?

strange knoll
velvet jasper
#

?

urban belfry
vagrant mortar
strange knoll
velvet jasper
#

Can’t remember off the top of my head

strange knoll
velvet jasper
#

You’ll have to look at the pr diff

strange knoll
#

k

vagrant mortar
# vagrant mortar so i clone this?

dont see how to clone it? it only says gh pr checkout 7023 and when i run that it says ```
quadradical@pop-os:~/Code/QuadraticBot2.0 (copy)$ gh pr checkout 7023
GraphQL: Could not resolve to a PullRequest with the number of 7023. (repository.pullRequest)

#

Managed to clone but its just a new repo how do i upgrade just d.js?

dawn phoenix
#

i have absolutely no idea what you're even trying to achieve

vagrant mortar
dawn phoenix
#

and why don't you just do what the think you replied to said?

velvet jasper
#

Alright it’s not ready to test right now we’ll let you know when it is

vagrant mortar
#

Ok👍

dawn phoenix
#

since when?

forest elm
#

since monorepo

short saddle
#

:(

knotty plover
#

The modal PRs aren't ready to be used

#

Which is why not a single contributor has suggested you should use them and both PRs are marked as drafts afaik

hardy bone
#

ayo modals in dev?

vague coyote
hardy bone
#

v16.9 noice

upper stirrup
#

Cannot read properties of undefined (reading 'FLAGS')

upper stirrup
dawn phoenix
#

pins

upper stirrup
dawn phoenix
#

read the channel pins

upper stirrup
#

how to enable intents in 14.0.0-dev version

vague coyote
vague coyote
#

nooo, let them read angeryBOYE

tame gazelle
#

._.

hardy bone
#

did they merge the pr

idle galleon
#

Which PR?

hardy bone
#

the modals pr ;-;

dull mulchBOT
idle galleon
#

Nope

hardy bone
#

tell me the eta

vague coyote
#

there is none

hardy bone
#

o

idle galleon
hardy bone
#

thx

#

any third party lib that supports modals ;-;

scarlet tangle
dawn phoenix
#

doesn't work for v14 anymore, because of the monorepo setup

tame gazelle
#

when will it be possible to put array in .addFields() ?

dawn phoenix
#

why? just spread it

tame gazelle
#

didn't get

plain roverBOT
#

<:_:818272565419573308> Spread syntax (...)
Spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.

tame gazelle
#

like now we can put multiple objects in .addFields() but soon we have to put an array of objects right?
and my bot has some issue with a command and I was wondering when will it be possible to put an array of objects

vague coyote
#

but soon we have to put an array of objects right?
thats what my pr would achieve, but doesn't look like thats getting anywhere anytime soon

tame gazelle
#

I see

hardy bone
#

is this an error my side or..

urban belfry
#

reinstall and then reload the ts server

hardy bone
#

o

dawn phoenix
vague coyote
#

no, the pr would add the ability to use arrays

urban belfry
#

chewie's adding both

urban belfry
tame gazelle
#
ZodError: [
  {
    "code": "invalid_type", 
    "expected": "string",   
    "received": "undefined",
    "path": [
      0,
      "value"
    ],
    "message": "Required"
  }
]
    at new ZodError (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\ZodError.js:80:28)
    at handleResult (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\types.js:115:21)
    at ZodArray.ZodType.safeParse (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\types.js:191:16)
    at ZodArray.ZodType.parse (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\types.js:172:27)
    at ge.addFields (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\discord.js\node_modules\@discordjs\builders\dist\index.js:1:5075)
    at ge.addField (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\discord.js\node_modules\@discordjs\builders\dist\index.js:1:3803)
    at Object.execute (H:\IdrisGaming\Discord Bot\IdrisBotSC\commands\utility\emoji.js:52:6)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.execute (H:\IdrisGaming\Discord Bot\IdrisBotSC\events\interactionCreate.js:44:17)
    at async Client.<anonymous> (H:\IdrisGaming\Discord Bot\IdrisBotSC\Structure\Client.js:47:25) {
  issues: [
    {
      code: 'invalid_type',
      expected: 'string',
      received: 'undefined',
      path: [Array],
      message: 'Required'
    }
  ],
  format: [Function (anonymous)],
  addIssue: [Function (anonymous)],
  addIssues: [Function (anonymous)],
  flatten: [Function (anonymous)]
}
.addField({ name: 'Animé', inline: emoji.animated ? 'Non.' : 'Oui.', inline: true })
knotty dust
#
- inline: emoji.animated ? 'Non.' : 'Oui.'
+ value: emoji.animated ? 'Non.' : 'Oui.'
``` ?
tame gazelle
#

oh shiit

#

thanks ._.

earnest latch
#

Djs v14 released?

dawn phoenix
#

no

strange knoll
#

i'm using axios/raw api to send modals, once i sumbit it, can i reply to it using interactionCreate event?

urban belfry
strange knoll
#
await axios({
      method: 'POST',
      url: `https://discord.com/api/interactions/${int.id}/${int.token}/callback`,
      headers: {
        Authorization: `Bot ${client.token}`,
      },
      data: {
        type: 9,
        data: {
          title: 'My Cool Modal',
          custom_id: 'cool_modal',
          components: [
            {
              type: 1,
              components: [
                {
                  type: 4,
                  custom_id: 'my_modal',
                  label: 'my label',
                  style: 1,
                  min_length: 1,
                  max_length: 400,
                  placeholder: 'my placeholder',
                  required: true,
                }
              ],
            },
          ],
        },
      },
    })```
#

↑↑ (int is interaction)

keen bobcat
#

@strange knoll this is not support for hacky workarounds or raw API calls, please do not continue to discuss them here

keen bobcat
#

Again, this is not hacky workaround support

#

Please use the PR or wait for it to be merged for proper use

tame gazelle
#
TypeError: e.toJSON is not a function
    at /root/IdrisBotSC/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:6370
    at Array.map (<anonymous>)
    at E.toJSON (/root/IdrisBotSC/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:6361)
    at E.toJSON (/root/IdrisBotSC/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:6765)
    at /root/IdrisBotSC/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:3459
    at Array.map (<anonymous>)
    at w.toJSON (/root/IdrisBotSC/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:3450)
    at /root/IdrisBotSC/node_modules/discord.js/src/structures/MessagePayload.js:134:77
    at Array.map (<anonymous>)
    at MessagePayload.resolveBody (/root/IdrisBotSC/node_modules/discord.js/src/structures/MessagePayload.js:134:49)

anyone know where it could be from?

urban belfry
tame gazelle
urban belfry
#

what's row defined as?

tame gazelle
urban belfry
#

let me check addOptions

#

ahhyessir, @tame gazelle can you try constructing SelectMenuOptions instead of passing raw objects?

tame gazelle
#

didn't get

urban belfry
#
- {label: '', value: ''}
+ new SelectMenuOption({label: '', value: ''})
#

for all of them, yes, Thonkang
i kinda don't like this since it makes this so much more complicated
but yeah

tame gazelle
#

oh without builders?

urban belfry
#

what
no i'm telling you to pass multiple SelectMenuOptions in addOptions instead of the raw objects

urban belfry
#

yes, try it

tame gazelle
#

it works ._.

tame gazelle
urban belfry
#

yeah
i hate it
but you can put them in an array and just map it

#
[{label, value}, {label, value}, {label, value}].map(v => new SelectMenuOption(v))
tame gazelle
urban belfry
tame gazelle
#

no it doesn't

tame gazelle
#

it returns the error

tall verge
#

. - .

urban belfry
#

can you just remove the reply and first confirm if this is indeed the issue?

tame gazelle
#

remove the component from the reply?

urban belfry
tame gazelle
urban belfry
#

i have absolutely no idea
inb4 EmbedFieldOption

tame gazelle
urban belfry
#

the first clue i got was that it was calling toJSON internally, it's calling <SelectMenuOption>.toJSON() internally
it doesn't take just an object, it must be an instance

#

i mean.. this is the only way it works, right?

dawn phoenix
#

?

urban belfry
#

it's way too complicated just for something as small as select menu options

tall verge
#

but no longer accepts the array object? ._.

tame gazelle
urban belfry
tame gazelle
urban belfry
#

that's wrong

scarlet tangle
tame gazelle
urban belfry
#

you have to put in SelectMenuOption instances @tame gazelle
hope this clears it up

#

not an array, not just objects, class instances

#

the documentation is also wrong, it says it takes in an array
it's a rest parameter

#

i mean you can still do this

new SelectMenuComponent({options: ArrayOfRawOptions}).method
#

internally it does map it

    public constructor(data?: APISelectMenuComponent) {
        this.options = data?.options.map((option) => new SelectMenuOption(option)) ?? [];
```just like as i've said
but wait ts won't like that...
tame gazelle
#

solved, thanks a lot 🙏

hybrid zealot
#

Hey I wanted to ask that should I enter discord.com on this or something else like api.discord.com?

vague coyote
hybrid zealot
vague coyote
hybrid zealot
#

What is the api website

urban belfry
#

that's super vague, what change

tame gazelle
dawn phoenix
#

@hybrid zealot you don't make requests from discord's domain, that makes no sense.

urban belfry
velvet jasper
tame gazelle
#

both?

urban belfry
#

objects got it

unique sedge
#

Why is guild.channels.create() deprecated?

urban belfry
#

it's not, some types like store is deprecated

velvet jasper
unique sedge
jaunty vault
urban belfry
# velvet jasper Yes

can you confirm that we want to indeed use both arrays of x and a rest parameter of x on these methods?
because one day i'm hearing it's just rest parameters and then i hear something completely different

worn haven
#

should i use this or keep on stable (v13)?

keen bobcat
#

That's entirely up to you

velvet jasper
worn haven
dawn phoenix
#

@dev is not a stable release, no

worn haven
#

beacuse i saw that not everything done

worn haven
dawn phoenix
#

the stable release will be 14.0.0

urban belfry
worn haven
urban belfry
#

because it's currently still being worked on?

dawn phoenix
#

stable <> breaks when trying to run it
those are two different things
"not stable" means that the API can change at any point and that bugs are a common sight while features are being ironed out

#

can you use it? yes
is the api finalized? no
can it have bugs? yes
can things change from one day to the other? yes
do you want to refactor a large code base that multiple thousands of people depend on? presumably not

loud bobcat
#

i have a private channel , i send an invitation to a user to join me in this channel
but he can see nothing cause it's private
is there a way to know when the user hit the join button on the invitation or to know when he join the channel so i can give him permissions ?

dawn phoenix
#

invites lead to guilds and focus a channel, if private they see nothing
you don't get information on guildMemberAdd regarding the invite they used to join
the best approach is that you can try and keep the amount of uses each invite has and check which incremented roughly when that member joined

#

in the end you are working on a best-guess basis here

loud bobcat
#

i come up with an idea which is by the time i send the invit i give the targetuser permissions , but is there a way to know when target user join the channel , i google it and all i have found is voiceStateUpdate ?

dawn phoenix
#

a voice channel? then yes

loud bobcat
#

no it's a text channel

dawn phoenix
#

there is no "joining" in text channels

loud bobcat
#

really ? but like i tried it and it worked , mean i send an invi and by clicking join button it redirect u to the target channel ?!!!!
by the way am new to discord.js

dawn phoenix
#

as said, invites lead to a guild, as a whole and put the channel the invite leads to into focus for the user

#

the event that emits is thus guildMemberAdd and does not give you any information about the focused channel or invite used to join

loud bobcat
#

aaa got it

#

so basicaly guild.members and channel.members are the same thing?

dawn phoenix
#

no, channel#members filters guild#members by people that can view the channel (in the case of text based channels and categories)

worn haven
#

Hope discord will add support for these popups for mobile

#

Beacuse they still didnt added context menus

dawn phoenix
#

modals are already supported on ios, android is having some issues with the rollout, but will happen soon

vale shuttle
#

what will be the added methods to djs14 ?

vague coyote
worn haven
dawn phoenix
#

kek

loud bobcat
dawn phoenix
#

*cached members
but yes

velvet jasper
#

Heads up for anyone wanting to test modals, the v14 pr is testable now

velvet jasper
#

no thats not what I said, I said the PR for adding it is testable

#

exactly that; it's testable from that PR branch

raven wasp
#

lol

faint gale
#

There is docs for modals?

urban belfry
faint gale
#

Okay thanks

plain roverBOT
#

<:_:874569322742308864> Guild#invites
A manager of the invites of this guild

fiery junco
#

Why this is a issue with djs v14?

urban belfry
fiery junco
#

so this will work? { name: ":gem:" }

urban belfry
#

it should yeah name : "💎"

fiery junco
tame gazelle
#

now it's <Interaction>#isCommand() ?

#

d.js version 14.0.0-dev.1644537979.298b226

urban belfry
#

is command could be a context menu as well

tame gazelle
urban belfry
#

let me see, the docs say it does

#

yeah it exists

#

show me how you reached the conclusion

tame gazelle
#

IntelliSence doesn't agree ._.

urban belfry
#

okay fine, show me what interaction is even
hover over it

tame gazelle
urban belfry
#

i think you installed stable

#

npm i discord.js@dev

tame gazelle
#

output of npm ls discord.js

urban belfry
#

it most certainly exists, reload your ts server, reload vscode

tame gazelle
#

ah yeah now it's fine
thanks

worn haven
#

Btw, can modals have select menu input where there would be all text channels in server??

finite fog
#

No, as of now, only text inputs are supported.

worn haven
#

Sad

dawn phoenix
#

don't think that's ever going to be possible, to be fair
seeing that selects are restricted in terms of choices far stricter than the max amount of text channels possible

#

i suppose they could opt for a channel/role/mentionable etc. selection as they do with slash commands

wooden ruin
velvet jasper
#

Also autocompleted select menus are planned

scarlet tangle
#

can anyone send me the link of discord modal api docs?

plain roverBOT
scarlet tangle
#

Thank you

young kindle
#

Are there any existing guides for modals? Or they are yet to be released?

dawn phoenix
young kindle
#

alr thanks

tame gazelle
#

anyone know why it doesn't set the activity?

urban belfry
#

why do you need to change your activity any minute?

#

add a listener for rateLimit

#

i believe now it's client.rest.on

tame gazelle
#

someone told me to not do it less than 1 minute

outer bane
#

type needs to be of ActivityType afaik

tame gazelle
#

ahh yeah maybe that

#

but the activity is correctly without the setInterval()

tame gazelle
urban belfry
#

can't you just display the amount of cached users and guilds at once instead of switching over and over?

tame gazelle
#

better to switch

tame gazelle
urban belfry
#

nah, it is rateLimited though, i did mess that up but the events are now emitted on client.rest

urban belfry
#

ya

tame gazelle
#

it doesn't log anything

urban belfry
#

Is your function even being called?

tame gazelle
#

which one?

urban belfry
#

The setInterval

tame gazelle
urban belfry
#

Doesn't tell me if it gets called

tame gazelle
#

looks like not

#

I put a console.log in it and it doesn't log it

#

nevermind ._.
it log it 1 minute after the bot goes online ._.

forest elm
#

because thats how setInterval works?

tame gazelle
#

I thought it run directly when the bot goes online

gloomy kayak
#

Well, then you don't need the setInterval lol

tame gazelle
#

I do

forest elm
#
const setActivity = () => {
  // do stuff
  return setActivity;
};
setInterval(setActivity(), 60_000);
#

you could do something like this if you dont want to repeat code

radiant lintel
#

how do i get intents now

#

how do i use GatewayIntentBits

radiant lintel
#

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\Users\User\Documents\Discord Bots\ApplicationTest\node_modules\discord-api-types\package.json

tame gazelle
#

require('discord-api-types/v9')

#

you forgot /v9

radiant lintel
#

ah yes, thanks

#

its some strange changes

#

requiring more npm packages

#

how do i use modals

tame gazelle
lament wave
#

are upper cased strings like MANAGE_GUILD still valid in GuildMember.permissions#has in v14?

velvet jasper
lament wave
#

so only "ManageGuild"?

velvet jasper
#

Yeah

lament wave
#

ok thx

dawn phoenix
knotty plover
#

When the pull requests are finished and merged into dev you can

#

The Discord API is public and usable

#

It's not in anything yet

#

Probably

urban belfry
#

GuildMessageReactions
Additionally ofc Guilds and GuildMessages

#

If the message isn't cached you'd want to enable the Message partial

plain roverBOT
urban belfry
#

This explains partials but is outdated a bit since it's not for v14

#

Check the pins to see how to use partials now

ebon warren
#

if (!Object.hasOwn(given, key) || given[key] === undefined) {

TypeError: Object.hasOwn is not a function

node: 17.5.0

urban belfry
#

I would Not recommended that
Just wait for the pr to be merged

ebon warren
#

what happened to Discord.MessageEmbed

scarlet tangle
ebon warren
white nebula
#

also renamed to Embed instead of MessageEmbed
make sure to read the pins

urban belfry
ebon warren
#

what the heck its zod

#

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

urban belfry
ebon warren
# urban belfry A validation package Show your code
const Discord = require("discord.js");
const Command = require('../../Utils/Command');

module.exports = class extends Command {
  constructor(options) {
    super(options);
    this.name = "help";
    this.aliases = [];
    this.category = "Utility";
    this.description = "Shows the command pannel";
    this.usage = "commands"
  }
  async run(client, message, args) {
    let moderation = Array.from(client.comandos.filter((command) => command.category === "Moderation").keys()).join(' | ')
    let music = Array.from(client.comandos.filter((command) => command.category === "Music").keys()).join(' | ')
    let utility = Array.from(client.comandos.filter((command) => command.category === "Utility").keys()).join(' | ')
    const embed = new Discord.Embed()
      .setTitle(`Bot Commands`)
      .addField("**Comandos de Moderación:**", `${moderation}`)
      .addField("**Comandos de Música:**", `${music}`)
      .addField("**Comandos de Utilidad:**", `${utility}`)
      .setColor("#36393F");

    message.channel.send({ embeds: [embed] });
  }
};
ebon warren
#

Sorry, im stupid, I dont understand what #addField and #addFields both accept an object or array of APIEmbedField(s) respectively. (add link to dapi site) means

#

whats dapi site

ebon warren
urban belfry
#

Wdym? The docs on main are already up to date?

knotty plover
#

main is latest

#

stable is v13

somber garnet
#

Is the transition from v13 to v14 going to be as dramatic as it was v12 to v13? Or is it mostly just stuff we will barely notice but that will improve performance but causes hardly any changes to our code?

velvet jasper
#

Many people will need do some kind of adjustments for that

#

But in terms of v12 to v13 it’s much smaller

somber garnet
#

Thanks :)

hybrid zealot
#

Will discord.js v14 depreciate message event?

velvet jasper
hybrid zealot
velvet jasper
hybrid zealot
#

k

knotty plover
#

You'll still receive messages, just with reduced fields, content wont be included without that intent

loud bobcat
#

am logged in to discord with two different accounts opened in saparated windows
am trying to get all members but all i got is one member even tho i see the other account in 'onligne' section ,??????

tame gazelle
#

what’s an APIMessage?

knotty plover
#

Raw API message object, not the djs class

rain reef
#

What will v14 do that v13 can’t do?

knotty plover
#

Be supported

#

Get future updates

#

See pins for more info

rain reef
#

Ok thx

#

When will Permission Handler V2 be released?

knotty plover
#

We don't know

quasi kite
#

how do i make the new discord apps feature that happens when i right click a user

knotty plover
#

Those are context menu commands

quasi kite
#

how do i create them

#

its not there in the guide

knotty plover
#

same as slashies by set the type to USER

#

Not sure if youre using builders

steel lance
#

there's a util method that converts color string to number right?

plain roverBOT
#

<:_:874569335308431382> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.

noble kernel
#

what would i change componentType: "SELECT_MENU" to?

tame gazelle
#
H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\form-data\lib\form_data.js:227
  } else if (options.filename || value.name || value.path) {
                                       ^

TypeError: Cannot read properties of undefined (reading 'name')
    at FormData._getContentDisposition (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\form-data\lib\form_data.js:227:40)
    at FormData._multiPartHeader (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\form-data\lib\form_data.js:178:33)
    at FormData.append (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\form-data\lib\form_data.js:71:21)
    at V.resolveRequest (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:3461)
    at V.queueRequest (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:2608)
    at Y.request (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:5510)
    at Y.patch (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:5429)
    at InteractionWebhook.editMessage (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\src\structures\Webhook.js:319:38)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ChatInputCommandInteraction.editReply (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:140:21)
#

anyone know why I have this error?

noble kernel
#

Expected number, received string

embed.setColor("75b424")

vague coyote
#

use Util.resolveColor()

noble kernel
#

wat

plain roverBOT
#

<:_:874569335308431382> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.

noble kernel
#

embed.setColor(require("util").resolveColor("75b424"))?

vague coyote
#

try it

noble kernel
#

okay

rain copper
#

is there a way to make a modal?

vague coyote
rain copper
#

modal submit*

noble kernel
vague coyote
#

Util not util

noble kernel
#

oh

#

still

#

require(...).resolveColor is not a function

tame gazelle
tame gazelle
vague coyote
#

ah right, me dumb KEK

velvet jasper
noble kernel
#

ah fixed

#

now it's erroring my fields:

embed.addField(`[:first_place:] ${obj.member} - ${obj.role}`, `${obj.info}: ${bot.formatNumber(obj.logs)}`)```
tame gazelle
#

it takes an object like .addFields()

noble kernel
#

ok yeah im fucked

dawn phoenix
#

time to learn some regex

noble kernel
#

if anyone could help me out with regex i'd totally appreciate it.. idk if it's even possible with regex

tame gazelle
gloomy kayak
tame gazelle
#

I had

#

ahhhhh bruhh
I'm dumb
I thought it will solved it but it's the code that make the error

tame gazelle
#

it's the latest

#

I just have to wait that the issue get fixed or I can do something? ._.

gloomy kayak
#

Reinstall djs

noble kernel
#

how do i work .addField()?

#

.addField({ name: "", value: "" })?

tame gazelle
#

yes

tame gazelle
#

but it's ok I fixed it

spring lagoon
#

Hey I keep getting this intent error. Any clues how to fix this? RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: GUILDS.

spring lagoon
#

Its lowercase now?

#

Ty

forest elm
#

no, its pascal case

spring lagoon
#

oh

west fjord
#

not just that, you need to use the enums, you cant just put an array of strings any more

west fjord
#

ah, sorry

noble kernel
#

how do you send an embed?

vague coyote
#

that didn't change, <TextChannel>.send({ embeds: [embed1, embed2, embed3] })

noble kernel
#

hm

#

"Expected object, received array"

const initialMessage = await interaction.reply({ embeds: [embed], fetchReply: true, components: components(false) });

vague coyote
#

show the full error

noble kernel
vague coyote
#

did you use addFields() ?

#

addFields, addComponents, addOptions all take multiple objects and not an array anymore.

noble kernel
#
.addFields(
          category.commands.map(cmd => {
            return {
              name: `\`/${cmd.name}\``,
              value: cmd.description,
              inline: true
            };
          })
        );
vague coyote
#

yup, spread the returned array from .map()

plain roverBOT
#

<:_:818272565419573308> Spread syntax (...)
Spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.

noble kernel
#

thx

noble kernel
#

"GUILD_TEXT" is not int.

urban belfry
#

read the guide on how to pass intents now

noble kernel
#

i don't think it's an intent issue

forest elm
#

use the enums

noble kernel
#

where's the list of enums?

urban belfry
#

sorry not intents, i meant the channel types monbreyFacepalm

forest elm
#

probably in the guide

noble kernel
#

can't find them

forest elm
#

its ChannelType

tame gazelle
#

is it possible to know if we get rate limited or not?
like if some users are using my command for delete messages and the bot hit a rate limit
if a user execute the command again is it possible to check if we get rate limited or not?

forest elm
noble kernel
#

.setColor(require("discord.js").Util.resolveColor("RED"))

Unable to convert color to a number.

noble kernel
#

ohh

forest elm
#

just use Colors.Red

tame gazelle
#

like this event will only get fired when the bot will hit a rate limit

urban belfry
quasi kite
#

Guys I am not able to find GatewayIntentBits in the docs

dim moss
# urban belfry you can specify a reject on rate limit on your client options
global.client = new Client({
  intents: [
    'GUILDS',
    'GUILD_MEMBERS',
    'GUILD_PRESENCES',
    'GUILD_MESSAGES',
    'GUILD_BANS',
    'GUILD_EMOJIS_AND_STICKERS',
    'GUILD_VOICE_STATES',
    'DIRECT_MESSAGES'
  ],
  partials: ['CHANNEL'],
  rejectOnRateLimit: (rateLimitData) => { return rateLimitData.match(/\/guilds\/\d{17,}\/emojis/) }
});
noble kernel
#

has the required property changed at all in application command options?

urban belfry
#

ah now it'd be on options.rest

forest elm
#

dont attach stuff to the global object monbreyFacepalm
and use RegExp.test()

urban belfry
#

and you don't need to use curlys and return on the arrow function, just remove the curlys

forest elm
#

and those intents/partials arent valid in @dev

tame gazelle
urban belfry
#

i believe it is just an example
but either way now it'd be on new Client({ rest: {rejectOnRateLimit}

forest elm
quasi kite
forest elm
quasi kite
#

nice

#

1 module lesser :)))

quasi kite
noble kernel
#
Uncaught Promise Error Call Stack: DiscordAPIError[50035]: Invalid Form Body
41.options[0].type[BASE_TYPE_REQUIRED]: This field is required
forest elm
tame gazelle
dawn phoenix
forest elm
#

42

dawn phoenix
#

41, we starting at 0 here, this is js jurisdiction

noble kernel
quasi kite
dawn phoenix
noble kernel
#

is integer not an application command option type?

dawn phoenix
#

doubt it's that line then

tame gazelle
quasi kite
forest elm
quasi kite
#

I thought GatewayIntentBits was already a thing

forest elm
#

it is, just not in the docs

quasi kite
forest elm
#

it wont go into that, itll have a separate website

noble kernel
dawn phoenix
#

k

noble kernel
#

k?

forest elm
#

that specifically will reject on every ratelimit

urban belfry
#

basically you can specify the routes on which if you hit rate limit, it'll reject the promise with the data

tame gazelle
#

ahhhhhh I think I get it now

urban belfry
#

so instead of listening to the event you can just catch the rejected promise and do what you want

dawn phoenix
# noble kernel k?

well, i told you what the error means you said that it's not wrong
so "k" is all i can say, really

forest elm
#

listening to the event wont do anything in regards to the promise

tame gazelle
#

like
client.rest.on('rateLimited', (rateLimitData) => console.log(rateLimitData))
will display the route if I get rate limited?

noble kernel
dawn phoenix
#

i told you the issue
you say that's not it
so no, i guess i can't

urban belfry
#

look at the types. the documentation for it tells you what you get

tame gazelle
#

but my initial question was how can I check if I get rate limited or not? (while executing a command)

forest elm
#

you could also just forcefully hit a ratelimit (for educational purposes!!!) and see what gets logged, it's not particularly hard

urban belfry
#

i did do that, hold on let me see if i have the data

forest elm
dawn phoenix
#

what

tame gazelle
#

pretty annoying way but thanks for explication

dawn phoenix
#

do not (!) use the ratelimit event to try and handle ratelimits yourself

forest elm
#

thats the only way of achieving what you want ¯_(ツ)_/¯

tame gazelle
#

client.rest.on('rateLimited', (rateLimitData) => console.log(rateLimitData));
if now I'm trying to hit a rate limit it will log the route?

urban belfry
#

don't you know the route?

forest elm
#

no it wont log the route, it will reject the promise that hit the ratelimit (because a string is truthy)

tame gazelle
#

just for example ._.

urban belfry
#

i forgot what we were dealing with here

tame gazelle
#

if I'm trying to edit channel names, like 2 times every second
will I hit a rate limit?

urban belfry
#

why, probably yeah

urban belfry
#

you don't need to test, what do you wanna know?

tame gazelle
#

just wanna see the output ._.

dawn phoenix
urban belfry
#
{
  timeout: 3936,
  limit: 5,
  method: 'post',
  path: '/channels/ID/messages',
  route: '/channels/ID/messages',
  global: false
}```
dawn phoenix
#

rejectOnRateLimit determines which routes should reject if a limit is hit (rejects the returned promise instead of waiting for an answer)

dim moss
tame gazelle
#

no need

dim moss
#

ok ¯_(ツ)_/¯

quasi kite
#

@noble kernel

noble kernel
#

what do i check for if im getting those errors

forest elm
#

you have commands that dont have type properties on some of the options

noble kernel
#

ah lemme see

#

yeah that's really confusing because all my options have options

#

and it all worked before i transferred to dev

forest elm
#

discord disagrees

noble kernel
#

well how else can i isolate the issue

scarlet tangle
#

they have updated it recently

#

all 3 of my bots using / commands wont register them

noble kernel
#

what's changed tho

scarlet tangle
#

new option

noble kernel
#

what new option

scarlet tangle
#

idk how it broke this but apprenelty it does
(file upload)

dawn phoenix
#

cannot reproduce

small mica
hardy bone
#

u need to import ApplicationCommandOptionType from discord.js

small mica
#

oh-

hardy bone
#

and then remove the quotes from there

small mica
#

Thanks!

noble kernel
#
const { ActivityType } = require("discord.js");
bot.user.setActivity("your messages", { type: ActivityType.Watching });
#

is this correct?

vague coyote
#

Have you tried it

noble kernel
#

yes

#

no error but didn't change the status

vague coyote
#

is that all the code or is that properly in an event where bot is ready

noble kernel
#

it's in a ready event

small mica
#
const { Embed } = require('discord.js')
module.exports = {
    name : "av",
    description: "Displays avatar of a user",
    run : async(client, message, args) => {
    const target = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.member;
    const embed = new Embed()
        .setTitle(`**> AVATAR of ${target.user.tag}**`)
        .setImage(`${target.user.displayAvatarURL({dynamic : true, size: 1024})}`)
        .setColor('RANDOM')
        .setFooter(`Requested by ${message.author.tag}`,`${message.author.displayAvatarURL({dynamic : true})}`)
        .setTimestamp()

        await message.channel.send({ embeds: [embed] });
    }
}```
#

error

urban belfry
#

read the guide, now it takes in a number, you can also use Util.resolveColor

plain roverBOT
#

Documentation suggestion for @small mica:
<:_:874573924988518500> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.

small mica
#

Thanks!

slim jolt
#

PS C:\Users\adema\Desktop\bot-discord-js-v13-main> node .
Bot TESTES2 logado com sucesso em 1 servidores.
C:\Users\adema\Desktop\bot-discord-js-v13-main\src\structures\Client.js:23
this.guilds.cache.get('940700955538759730').commands.set(this.commands)
^

TypeError: Cannot read properties of undefined (reading 'commands')
at module.exports.registryCommands (C:\Users\adema\Desktop\bot-discord-js-v13-main\src\structures\Client.js:23:52)
at module.exports.run (C:\Users\adema\Desktop\bot-discord-js-v13-main\src\events\client\ready.js:12:21)
at module.exports.emit (node:events:520:28)
at WebSocketManager.triggerClientReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:17)
at WebSocketManager.checkShardsReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:367:10)
at WebSocketShard.<anonymous> (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:189:14)
at WebSocketShard.emit (node:events:520:28)
at WebSocketShard.checkReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:475:12)
at WebSocketShard.onPacket (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:16)
at WebSocketShard.onMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:520:28)
at Receiver.receiverOnMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\websocket.js:1137:20)
at Receiver.emit (node:events:520:28)
at Receiver.dataMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\receiver.js:528:14)
at Receiver.getData (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\receiver.js:446:17)
PS C:\Users\adema\Desktop\bot-discord-js-v13-main>

urban belfry
#

not just you still need to read the guide since your setFooter is wrong

small mica
#

Yeah Ik that I still dint change it

noble kernel
#

when setting permissions for slash commands, what's the type called for specifying role or user?

mystic heath
small mica
#

Wait I can't use hex colour too?

urban belfry
#

@noble kernel ApplicationCommandPermissionType.Role

small mica
mystic heath
# slim jolt this.client where?

I mean instead of this.guilds shouldn't it be this.client.guilds ? I am not sure how you have coded it , it's probably this or probably guild is not a valid guild because you are trying to access commands from undefined if you see the error

urban belfry
#

not really no, if that were the case it would just error before
@slim jolt show you're code you're probably accessing a guild before it gets cached

slim jolt
small mica
#

I can't use hex for .setColor()?

velvet jasper
small mica
urban belfry
#

the documentations for addFields is wrong, they take in multiple Field objects, not an array

#

so you can simply spread this ```js
.addFields(categories)

small mica
urban belfry
#

spread it, read what i said ...categories

plain roverBOT
#

<:_:818272565419573308> Spread syntax (...)
Spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.

small mica
#

Thanks that worked :)

urban belfry
#

you still need to fix your other fields

small mica
#
client.on("ready", () =>
   client.user.setPresence({ activities: [{ name: `Phantom code me!`, type: "WATCHING" }], status: 'online' }), 
  )

Also this is not shown on my bot's status!

urban belfry
#

type should be switched to ActivityType.Watching or something similar, now you need to use the enums

small mica
white nebula
# small mica Like this?

addField is now essentially just an alias for addFields
You have to pass in an object with a name and value instead of two parameters

small mica
#

👍

slim jolt
#

C:\Users\adema\Desktop\bot-discord-js-v13-main> node .
Bot TESTES2 logado com sucesso em 1 servidores.
C:\Users\adema\Desktop\bot-discord-js-v13-main\src\structures\Client.js:23
this.guilds.cache.get('838228145865490493').commands.set(this.commands)
^

TypeError: Cannot read properties of undefined (reading 'commands')
at module.exports.registryCommands (C:\Users\adema\Desktop\bot-discord-js-v13-main\src\structures\Client.js:23:52)
at module.exports.run (C:\Users\adema\Desktop\bot-discord-js-v13-main\src\events\client\ready.js:12:21)
at module.exports.emit (node:events:520:28)
at WebSocketManager.triggerClientReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:17)
at WebSocketManager.checkShardsReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:367:10)
at WebSocketShard.<anonymous> (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:189:14)
at WebSocketShard.emit (node:events:520:28)
at WebSocketShard.checkReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:475:12)
at WebSocketShard.onPacket (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:16)
at WebSocketShard.onMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:520:28)
at Receiver.receiverOnMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\websocket.js:1137:20)
at Receiver.emit (node:events:520:28)
at Receiver.dataMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\receiver.js:528:15)
at Receiver.getData (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\receiver.js:446:17)
PS C:\Users\adema\Desktop\bot-discord-js-v13-main>

#

It stays on and then falls

ocean shoal
#

does this support modals?

tame gazelle
slim jolt
#

where?

tame gazelle
#

in your code

velvet jasper
slim jolt
meager fox
#

are modals only for dev version?

knotty plover
#

lol

gentle coyote
#

in v14 will we gain access to the those guildMember banners that have a separate banner as their guild banner and user banner?

velvet jasper
gentle coyote
loud mulch
#

A member's banner isn't available in the API (It's still a feature request on the discord-api-docs repo)

velvet jasper
#

Hi

#

Don’t think so, why?

#

The message and interaction events are named “messageCreate” and “interactionCreate”

uncut kelp
#

No

#

It's 2022, why are you using reactions

velvet jasper
#

Have you tried select menus?

uncut kelp
#

A reaction belongs to a message & a message belongs to a guild, that is how you get the guild anyhow

#

The process has not changed since version 13, there should be no trouble

#

Then what

slow storm
#

yeah

#

your question isn't related to v14 please ask in #djs-help-v14 also reaction.message is Message so u can get guild and from guild u can get all the members

#

but nothing changed in v14 it's same as v13

velvet jasper
#

it didn't

small mica
#
const embed = new Embed()
         .setTitle(`${target.tag} BAKA...`)
        .setImage(await anime.baka())
        .setColor('#ff0000')
   message.channel.send({ embeds: [embed]})```
Why doesn't hex colour work?
#

What all changes were made to fields?

#
      .addField(
        "**General : **",
        `**❯ Client :** ${client.user.tag} (${client.user.id}),
        **❯ Commands :** ${client.commands.size},
        **❯ Servers :** ${client.guilds.cache.size}, 
        **❯ Users :** ${client.guilds.cache
          .reduce((a, b) => a + b.memberCount, 0)
          .toLocaleString()},
        **❯ Channels :** ${client.channels.cache.size.toLocaleString()},
        **❯ Creation Date :** ${utc(client.user.createdTimestamp).format(
          "Do MMMM YYYY HH:mm:ss"
        )}
        **❯ Node.js :** ${process.version}
        **❯ Discord.js :** v${djsversion}
        **>Up Since :**  <t:${upvalue}:T>
        \u200b`
      )
      
      .addField(
        "**❯ CPU :**",
        `**Cores : **${os.cpus().length}
        **Model :** ${core.model}
        ** Speed :** ${core.speed}MHz`
      )  ```

This doesn't work
#

I dint understand the thing about fields in docs

#

Ok thanks Rin!

#

was .setThumbnail() changed too?

#

uh nvm

#

What all colours are available in Util.resolveColor?
If i try GREEN it shows cannot convert colour to number

#

If i put blue it shows black

#
const embed = new Embed()
         .setTitle(`${target.tag} BAKA...`)
        .setImage(await anime.baka())
       .setColor(Util.resolveColor("GREEN"))
   message.channel.send({ embeds: [embed]})```
velvet jasper
small mica
#

Ok I'll try it out!

#
const colour = EnumResolvers.resolveColor()```
How do I use this?
#

Idk, I dint yet understand the enum stuff. Going thru docs for the 3rd time, but still dint get what an enum resolver is!

#

How do I use enum then for embed color?

#

Util.resolveColour doesn't seem to work properly! If I use GREEN, it shows cannot convert colour to a number

#

okay

#

Yup that works! Thanks Rin :)

#

I didn't understand Colors enum, so I will use the method you said!

timid talon
#
TypeError: LimitedCollection.filterByLifetime is not a function

How to fix this?

outer bane
#

iirc that's been moved to Sweepers

small mica
#

How am I supposed to send a button

urban belfry
urban belfry
#

that's not even the right syntax
use the builders method instead of passing the values like that, like setCustomId

small mica
#

okay!

#

I changed embed to embeds but still the issue is there

loud bobcat
#

is there a way to disable writing ability in text channel ?

knotty plover
#

remove send_messages permission from everyone role

small mica
# small mica

I added .setCustomId but still doesn't work. What am I doing wrong?

#
const { Message, Client, ButtonStyle, ActionRow, ButtonComponent, Embed } = require("discord.js");

module.exports = {
    name: "button",
    aliases: ['p'],
    /**
     *
     * @param {Client} client
     * @param {Message} message
     * @param {String[]} args
     */
    run: async (client, message, args) => {
        const row = new ActionRow()
        .addComponents
        (
            new ButtonComponent().setLabel("Hello!").setStyle(ButtonStyle.Primary).setCustomId('1234'),
            new ButtonComponent().setLabel("Hello!").setStyle(ButtonStyle.Danger).setCustomId('534534'),
            new ButtonComponent().setLabel("Hello!").setStyle(ButtonStyle.Success).setCustomId('1123'),
            new ButtonComponent().setLabel("Hello!").setStyle(ButtonStyle.Link).setURL("https://discord.com")
        )
        const embed = new Embed().setDescription("Hello! This is how you send buttons with \`v14!\`")
        message.channel.send({embeds: [embed], attachments: [row]})
    },
};
urban belfry
#

you meant to use components, not attachments

small mica
#

fk I am so dumb

urban belfry
#

spread them or pass multiple objects

small mica
small mica
urban belfry
#

talked about this before, instead of passing multiple raw objects pass new instances of SelectMenuOptions

#

now this may be fixed in the future to have the raw objects, however i don't see them dropping support for the class so you should be fine

small mica
#
const row = new ActionRow()
        .addComponents
        (
           new SelectMenuComponent().setCustomId('Test')
           .setPlaceholder('Choose an option')
           
        )```
How do I use `SelectMenuOption`?
urban belfry
#
new SelectMenuOption().setLabel('a').setValue('a')
```and so on for all of them
small mica
#

okay ill try it out

urban belfry
#

yes, for now yes

small mica
#

.setPlaceholder is not a thing?

urban belfry
#

update haha

#

both of you, idk if it's already fixed

small mica
#

How do I set placeholder?

urban belfry
#

alternatively you can do this [obj, obj].map((o) => new SelectMenuOption(o) ) basically construct a new class instance with the values

young kindle
urban belfry
#

placeholders on the options?

#

then it got fixed

young kindle
#

hm

small mica
#

For me it dint!

urban belfry
#

then update

#

you have to pass an emoji object containing a name id and animated property @scarlet tangle

small mica
urban belfry
#

and the setEmojis are still not confirmed to be an intended change

#

did you update? @small mica @scarlet tangle npm ls discord.js

small mica
young kindle
small mica
urban belfry
#

show me the output of the command i sent..

#

what

urban belfry
#

@small mica ls should you the version of djs you're using, i'm asking for that

small mica
knotty plover
#

You have clashing versions

urban belfry
#

none of you are using the latest

fervent fossil
#

npm uni discord-together & npm i discord.js@dev

urban belfry
#

npm uninstall discord.js npm i discord.js@dev

small mica
#
const { Message, Client, ButtonStyle, ActionRow, ButtonComponent, Embed, Util, SelectMenuComponent, SelectMenuOption, SelectMenuInteraction } = require("discord.js");

module.exports = {
    name: "dropdown",
    aliases: ['p'],
    /**
     *
     * @param {Client} client
     * @param {Message} message
     * @param {String[]} args
     */
    run: async (client, message, args) => {
        const row = new ActionRow()
        .addComponents
        (
           
           new SelectMenuOption().setLabel('a').setValue('a')
                      
        )
        const embed = new Embed().setDescription("Hello! This is how you send buttons with \`v14!\`").setColor(Util.resolveColor("Random"))
        message.channel.send({embeds: [embed], components: [row]})
    },
};

My code

urban belfry
#

i just checked the source and confirmed feelsSharkMan
you must pass a class instance

#

why are you passing a select menu option on a row?

#

you're supposed to pass the options to a select menu and the menu to the row

#

i knew i was you just confused me

small mica
urban belfry
#

and on addOptions, you pass multiple SelectMenuOptions
that's all

small mica
#

Sorry if I am being annoying but I still don't get this

urban belfry
#
addOptions(
             new SelectMenuOption().setLabel('a').setValue('a'),
           new SelectMenuOption().setLabel('a').setValue('a'),
           new SelectMenuOption().setLabel('a').setValue('a')

)```
small mica
#

Thank you sooo much @urban belfry! It finally worked

#

Yeah ik 😄

small mica
#

What is the list of ApplicationCommandOptionType?

#
type: ApplicationCommandOptionType.Member,```
Doesn't work
idle galleon
#

You should be using User

small mica
#

So member is no longer available?

idle galleon
#

Wdym? It never was

#

interaction.options.getMember works on User options

small mica
#

I am brain ded rn sorry for troubling you.

blazing mortar
#

what discordjs v14 add ?

cinder ice
#

would it be worth looking into the dev branch early on to make the necessary changes?

urban belfry
midnight plume
#

is it stable to use DJS.v14 or not

icy dew
#

no, it isn't stable

midnight plume
#

the modals were added in v13?

urban belfry
icy dew
midnight plume
#

oh not yet if i understand

urban belfry
#

exactly

noble kernel
#

have modals been merged with dev?

urban belfry
#

no

noble kernel
#

is there an ETA?

plain roverBOT
#

<:_:874569335308431382> User#displayAvatarURL()
A link to the user's avatar if they have one. Otherwise a link to their default avatar will be returned.

tame gazelle
#

if dynamic was set to true forceStatic would be false

sly narwhal
#

format is now extension

tame gazelle
#

is there something like this:
if (client.hasHitRateLimiteFor('BulkDeleteMessages') return console.log('I cannot bulk delete messages.')

outer bane
#

no, but you can use rejectOnRateLimit (or similar) to not queue the request and reject it instead

tame gazelle
#

nice thank you both

small mica
#
const {
  Client,
  Message,
  Embed,
  ActionRow,
  ButtonComponent,
  ButtonStyle,
  Util,
  ButtonInteraction,
} = require("discord.js");
const fetch = require("node-fetch");

module.exports = {
  name: "meme",
  description: "Get a random meme from reddit",
  usage: "",
  category: "fun",
  /**
   * @param {Client} client
   * @param {Message} message
   * @param {String[]} args
   */
  run: async (client, message, args, color) => {
    const row = new ActionRow().addComponents(
      new ButtonComponent()
        .setLabel("Reload")
        .setStyle(ButtonStyle.Primary)
        .setCustomId("MemeReload")
    );
    await fetch("http://meme-api.herokuapp.com/gimme/memes")
      .then((response) => response.json())
      .then(async (r) => {
        const embed = new Embed()
          .setImage(`${r.url}`)
          .setTitle(`${r.title}`)
          .setURL(`${r.postLink}`)
          .setColor(Util.resolveColor("DarkPurple"));
        const msg = await message.channel.send({ embeds: [embed], components: [row] });
        const filter = (interaction) => {
          if(interaction.user.id === message.author.id) return true;
        };
const collector = message.channel.createMessageComponentCollector({
    filter,
})
collector.on('end', (ButtonInteraction) => {
const id = ButtonInteraction.first().customId;
if(id === 'MemeReload') return msg.edit({embeds: [embed], components: [row]})
})

      });
  },
};
#

This is not editing the sent message

#

Even msg.update doesnt work

plucky pike
#

are the current typings wrong about setColor (they say only number) or is the preview guide wrong?

vague coyote
plucky pike
#

tyvm

outer bane
south python
#

How do i use the .setEmoji() function from ButtonComponent and the .addComponents() function from ActionRow in this dev version?

urban belfry
small mica
south python
#

.setEmoji('🔒') Isn't possible anymore?

urban belfry
#

no

#

at least for now

#

that needs to be {name: '🔒'}

south python
#

Ahh oke thanks

radiant lintel
#

TypeError: MessageActionRow is not a constructor
in dev version

south python
#

And the .addComponents isn't a array anymore as input

south python
#

Or am i seeing that wrong

urban belfry
#

read the guide, @radiant lintel it's ActionRow

urban belfry
south python
#

I see, thanks

outer bane
small mica
#

no?

outer bane
#

well, you specified max as 20 and only respond to the first collected interaction

small mica
#

I should put the number of clicks in 3 seconds?

radiant lintel
#

whats a ZodError

small mica
urban belfry
#

show your builders code and the error @radiant lintel

outer bane
urban belfry
#

@small mica use edit, not update

radiant lintel
#

it doesnt say where tho

south python
#

And has the param of the .setColor from the Embed class to be Util.resolveColor("Red") or is Colors.Red also acceptable?

urban belfry
#

i know it doesn't, just show the code you last edited

outer bane
#

the latter works

radiant lintel
#

i havent edited owt i am just updating to v14

urban belfry
#

when will they improve the errors smh :(
is this open sourced?

#

also show me the actual error first

outer bane
radiant lintel
#

i think its to do with button styles

urban belfry
#

yeah probably, change that, the guide explains this part

radiant lintel
#

lol need to go through all my buttons now
nice

urban belfry
#

you can search and replace you know

radiant lintel
#

but i need to add al the new requires to

urban belfry
#

as the guide says```js
const { EnumResolvers } = require('discord.js');
const enumValue = EnumResolvers.resolveButtonStyle('PRIMARY');

there
that you can do later on and it'll be relatively simpler
south python
#

Where can i find the option APIEmbedField examples and how they look like?

fading mason
#

try{
member.send({embeds: [ embed ]});
} catch(error) {
console.log(error);
}
}

radiant lintel
#

what do i replace Permissions.FLAGS.EMBED_LINKS with

fading mason
#

try{
member.send({embeds: [ embed ]});
} catch(error) {
console.log(error);
}
}

south python
#

Read your error

fading mason
urban belfry
fading mason
urban belfry
#

the guide mentions this 🙃

south python
#

What do you guys prefer? As example at a embed color Colors.Red or Util.resolveColor("Red")

radiant lintel
#

i replaced all my button styles with the .setStyle(Discord.EnumResolvers.resolveButtonStyle('PRIMARY')),
but im still getting the ZodError when running a slash command