#djs-in-dev-version

35223 messages · Page 5 of 36

outer bane

yes, you have to use the dev version of builders

cerulean bay

Is there a way to do so?

fallow steppe

I'm using it and still get the type errors

npm i @discordjs/builders@dev?

outer bane

yes

fallow steppe

I just installed everything with npm i discord.js@dev @discordjs/builders@dev @discordjs/rest@dev discord-api-types

cerulean bay

Same output for me

fallow steppe

@cerulean bay might work to install api types 0.27.0

outer bane

oh I had skipLibCheck set to true, getting similar errors now

fallow steppe

npm i discord-api-types@0.27.0

Seems to work

cerulean bay

True

But this is not the latest?

outer bane

but it is the one d.js is using currently, even though there shouldn't be any breaking changes in a patch

cerulean bay

Alright. Ill use this one for now i guess.

Thanks for tagging me @fallow steppe

fallow steppe

No problem. Issue's been bugging me lately as well. Just checked what version of api types @dev was using and installed that

south python

Is it a popular issue that the SelectMenuComponent doesn't work correctly?

tame gazelle

which error?

south python
knotty plover

Did you pass nothing to addComponents or something

tame gazelle

this happened when we called SelectMenuComponent

but it has been fixed

make sure your djs dev version is up-to-date

tough egret

How works on v14 Embeds? I'm trying to send an embed and returns:

ZodError: [
  {
    "code": "invalid_union",
    "unionErrors": [
      {
        "issues": [
          {
            "code": "invalid_type",
            "expected": "number",
            "received": "string",
            "path": [],
            "message": "Expected number, received string"
          }
        ],
        "name": "ZodError"
      },
      {
        "issues": [
          {
            "code": "invalid_type",
            "expected": "array",
            "received": "string",
            "path": [],
            "message": "Expected array, received string"
          }
        ],
        "name": "ZodError"
      }
    ],
    "path": [],
    "message": "Invalid input"
  }
]

Code:

const em = new Embed()
.setTitle("This is a test")
.setColor("RANDOM")
.addField("This are a text of test")

msg.channel.send({ content: 'Test', embeds: [em]})
urban belfry

Colors should now be numbers
Fields should be objects
Read the guide

tough egret

Can u provide link? I'm seeing on pings but maybe i'm wrong xD

tough egret

ty :3

tough egret

I'm looking into website for messageDelete and i can't see anything at respect, are to be added or something?

knotty plover

Not sure what you mean

messageDelete hasnt changed

tough egret

action_type[NUMBER_TYPE_COERCE]: Value "MESSAGE_DELETE" is not int.

I'm using: message.delete({timeout: 1})

knotty plover

I dont understand the point of a 1ms timeout

But that error is coming from something that is fetching audit logs I think

This is one of the areas that will have changed to enums

tough egret

Then, for delete a message, i must delete message.delete(1)?

Or how

knotty plover

message.delete(), timeout isnt required

tough egret

Oh, ty 😄

knotty plover

The error is not from message.delete though, its from fetchAuditLogs

onyx cove

is there a color converter, I’ve always used hex codes

Or is that only for the default Colors?

Wait nvm

knotty plover

You can use hex literals, 0xFF0000

outer bane

make sure you use the dev version of builders

because of an update of d.js at dev

which now imports and uses that function from builders dev

what's the ouput from npm ls @discordjs/builders

latent lion

help, this error is occurring

knotty plover

what is that second screenshot of?

addOptions takes rest params, not an array

You'll need to spread it I think

junior nest

uhh just do npm i discordjs/discord.js#pull/<id>/head, should work

syntax might be a little off

npm i discordjs/discord.js#pull/8392748391/head

just refers to the most recent version

latent lion
knotty plover

Spread

latent lion
tame gazelle
latent lion
tame gazelle

yes

latent lion

ok

urban belfry

wdym not happening anytime soon?
also no we don't recommend third party libs, due to the pure shitty quality of most of them

we just don't work with etas
that's all
not having an eta doesn't mean it's coming soon nor does it mean it will definitely take a lot of time
could drop any day 🙃

dark moon

Ah, right.

gloomy kayak

I think the v13 and v14 PRs will be merged almost together as they're quite ready however

south python
gloomy kayak

Can you show your code and your version

south python

I just updated my version, but did the ButtonStyle input change?

At first i could do ButtonStyle.Succes

But it gives a error whenever i try it now

copper jetty

You misspelled Success

south python

But it still doesn't work with ButtonStyle.Danger etc

small mica

show code

south python

My code is:

const cancelButton = new ButtonComponent()
        .setCustomId('permCancel')
        .setLabel('Cancel')
        .setStyle(ButtonStyle.Danger)
        .setEmoji({ name: '❌' });```
And the error is:
```Argument of type 'ButtonStyle.Danger' is not assignable to parameter of type 'ButtonStyle'.```
copper linden

is there a documentation page for v14?

tame gazelle

pins

cold root

makeThread

gloomy kayak

Try to set the discord-api-types version in the package.json to "*" and then reinstall with npm i

south python

It didn't change anything

obtuse knoll

where can i get djs at dev docs

pls send fast

urban belfry

pins

obtuse knoll

which channel

urban belfry

this one?

obtuse knoll

ohh ghanks

thanks

small mica
shell rivet

hi

brazen cedar

Hello, when i made a modal for my voiceMaster rename, it modal pops up and i can input text. But when i hit submit, it says Something went wrong. Try again. It seems that my event for the modalSubmit seems as if it is not working as i put a console.log("here") but it never console logs anything.

brazen cedar

i found a solution, thank you though

dire rover

Are Modals Out yet ?

in the discord.js@dev version ?

vague coyote

its not merged

dire rover

Any ETA ?

vague coyote

ETA reallyFckingCuteCatEww we dont to that here

dire rover

Nvm, I Hope it gets merged soon.

Can you provide me the PR link that would be merged.

vague coyote

checkpins

dull mulchBOT
dire rover

const rest = new REST({ version: '<Version>' }).setToken('token');
Should I use v9 or v10 of Rest API ? 🤔

urban belfry
dire rover
urban belfry

exactly 👍

dire rover

rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), { body: commands });
How can I change this to set the Application Commands Globally

urban belfry

these don't sound like v14 specific questions Thonkang

fallen plume

embed'

regal mason

I got this when sending an embed

urban belfry
regal mason

Yeah I know

And that's dumb as fuck

dire rover
oak raft

binary or smth i forgot

regal mason
regal mason
oak raft

well then make a function for it

vague coyote

you can use Util.resolveColor() from djs, that takes in a string like "GREEN" and returns the number.
but hex like showed above should work too

the error is not coming from that setColor()

oak raft

const { Util } = require('discord.js')?

vague coyote

yes

oak raft

is there docs for this

i wanna see

plain roverBOT

Documentation suggestion for @oak raft:
_ Util
Contains various general-purpose utility methods.

oak raft

thanx

regal mason

For the field it requires a "APIEmbedField"

vague coyote

correct, it does

regal mason

I found by myself, but thanks

urban belfry

also instead of instanceof CommandInteraction or ContextMenuCommandINteraction..

can't you just use <Interaction>.isCommand()?

regal mason

Yeah I could

But I handle Context Menu Commands as well so I can't really do that
At least I can do <Interaction>.isCommand() || <Interaction>.isContextMenuCommand()

But that doesn't change much

urban belfry

no no, A CommandInteraction would mean it's a slashie of a context menu interaction
at least for now

vague coyote

isCommand() checks if its an application command
isContextMenuCommand() checks if its an application command and a context menu command

isContextMenuCommand() calls isCommand() internally

urban belfry

okay

that was confusing
the point is that context menu interactions and slashie interactions both extend command interaction
so isCommand checks both

urban belfry
regal mason

Oh okaayyy thanks

jade shadow
dire rover
    ^

RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: undefined.
    at Function.resolve (C:\Hydro\node_modules\discord.js\src\util\BitField.js:152:11)
    at C:\Hydro\node_modules\discord.js\src\util\BitField.js:147:54
    at Array.map (<anonymous>)
    at Function.resolve (C:\Hydro\node_modules\discord.js\src\util\BitField.js:147:40)
    at Client._validateOptions (C:\Hydro\node_modules\discord.js\src\client\Client.js:485:41)
    at new Client (C:\Hydro\node_modules\discord.js\src\client\Client.js:77:10)
    at Object.<anonymous> (C:\Hydro\index.js:3:16)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  [Symbol(code)]: 'BITFIELD_INVALID'
}

Code :

const client = new Client({
    partials: ["CHANNEL"],
    intents: [GatewayIntentBits.GUILDS, GatewayIntentBits.GUILD_MEMBERS, GatewayIntentBits.GUILD_MESSAGES],
    allowedMentions: {
        parse: [],
        repliedUser: true,
      },
});```

Is something wrong ?

dire rover

DiscordAPIError[10002]: Unknown Application

Let me see. Though I am pretty sure
it's correct

Nope. That didn't work

Wait I guess it's fixed

I was passing Client ID and Guild Id as a number though passing them as string seems to work

midnight plume

I can make a gist of modals if you want ?

Using discord.js

dire rover

I see.

midnight plume

(not with the pull request)

weak ridge

How do we use setColor on embeds in V14?

midnight plume
weak ridge

Number ?

midnight plume

yes

Hexadecimal

weak ridge

Ok, thanks

dire rover

What's the minimum NodeJS version required to use the dev version ?

Or is there any specific version that it focusses on

dire rover

16.1 !?

Pins say 16.9

Though I have 17.5

      throw er; // Unhandled 'error' event```
But I get this error
little jolt

Is that the full stacktrace?

weak ridge

How can we make Modals?

urban belfry

by waiting for them to release

weak ridge

Because I saw people do it, and they told me it would be in V14

urban belfry

yes and v14 isn't released yet, still in development

weak ridge

Oh, okay

dire rover
C:\Hydro>node .
Gamecord#9555 is up and ready to go!
node:events:504
      throw er; // Unhandled 'error' event
      ^

ZodError: [
  {
    "code": "invalid_type",
    "expected": "object",
    "received": "string",
    "path": [],
    "message": "Expected object, received string"
  }
]
    at new ZodError (C:\Hydro\node_modules\zod\lib\ZodError.js:80:28)
    at handleResult (C:\Hydro\node_modules\zod\lib\types.js:115:21)
    at ZodObject.ZodType.safeParse (C:\Hydro\node_modules\zod\lib\types.js:191:16)
    at ZodObject.ZodType.parse (C:\Hydro\node_modules\zod\lib\types.js:172:27)
    at ButtonComponent.setEmoji (C:\Hydro\node_modules\@discordjs\builders\dist\index.js:3:4858)
    at Object.run (C:\Hydro\commands\help\help.js:18:10)
    at Client.<anonymous> (C:\Hydro\events\messageCreate.js:19:19)
    at Client.emit (node:events:526:28)
    at MessageCreateAction.handle (C:\Hydro\node_modules\discord.js\src\client\actions\MessageCreate.js:23:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Hydro\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
Emitted 'error' event on Client instance at:
    at emitUnhandledRejectionOrErr (node:events:383:10)
    at processTicksAndRejections (node:internal/process/task_queues:85:21) {
  issues: [
    {
      code: 'invalid_type',
      expected: 'object',
      received: 'string',
      path: [],
      message: 'Expected object, received string'
    }
  ],
  format: [Function (anonymous)],
  addIssue: [Function (anonymous)],
  addIssues: [Function (anonymous)],
  flatten: [Function (anonymous)]
}

Node.js v17.5.0```

My Bot Initially Boots Up though when I run a prefix based command, It crashes
urban belfry

i guess you could use the util method to resolve the emoji here as well

dire rover

Oh.

dire rover
plain roverBOT
dire rover

I guess I don't have access to it

Nvm I had to turn on show Privates setting

was the addField Method Changed in embeds ?

urban belfry

wait it's private?
okay then just go with passing an object in that case @dire rover

dire rover

I got access after it.

urban belfry

no no i would still recommend just passing as an object

dire rover
dire rover
urban belfry

yes it did, it takes an embed object, the guide covers this i think

copper jetty
dire rover

Hmm.

urban belfry

that's kinda wrong haha
addFields don't take arrays anymore, they take rest parameters

the guides are still a WIP

dire rover

.addField("Name", `${object.displayName}`)

The node:events error refers to fields I use in the commands

copper jetty
urban belfry

docs wrong

dire rover

hmm.

urban belfry

i am aware they're wrong
they've been wrong for a while
besides, i made the change myself 🤠

export class Embed extends UnsafeEmbed {
    public override addFields(...fields: APIEmbedField[]): this {
```this is a known issue that a lot of our docs are displaying rest parameters as a single parameter that takes an array
but if you read the source, you'll see that's not the case
dawn phoenix

BOYEbomb if you have an array (for example because it's returned from another util function) spread it with ...

dire rover
urban belfry

addFields(field1, field2, field3) multiple parameters

each field is {name: ..., value, inline}

dire rover

hmm

plain roverBOT

_ Rest parameters
The rest parameter syntax allows a function to accept an indefinite number of arguments as an array, providing a way to represent variadic functions in JavaScript.

brisk glen

could you guys do something about zod errors?

[
  {
    "code": "too_small",
    "minimum": 1,
    "type": "array",
    "inclusive": true,
    "message": "Should have at least 1 items",
    "path": []
  }
]
    err: {
      "type": "t",
      "message": "[\n  {\n    \"code\": \"too_small\",\n    \"minimum\": 1,\n    \"type\": \"array\",\n    \"inclusive\": true,\n    \"message\": \"Should have at least 1 items\",\n    \"path\": []\n  }\n]",
      "stack":
          ZodError: [
            {
              "code": "too_small",
              "minimum": 1,
              "type": "array",
              "inclusive": true,
              "message": "Should have at least 1 items",
              "path": []
            }
          ]
              at new t (file:///D:/Dev%20Works/Chip/main/node_modules/zod/lib/index.mjs:1:4541)
              at handleResult (file:///D:/Dev%20Works/Chip/main/node_modules/zod/lib/index.mjs:1:12814)
              at r.e.safeParse (file:///D:/Dev%20Works/Chip/main/node_modules/zod/lib/index.mjs:1:14523)
              at r.e.parse (file:///D:/Dev%20Works/Chip/main/node_modules/zod/lib/index.mjs:1:14128)
              at validateRequiredSelectMenuParameters (file:///D:/Dev%20Works/Chip/main/node_modules/@discordjs/builders/dist/index.mjs:3:2127)
              at q.toJSON (file:///D:/Dev%20Works/Chip/main/node_modules/@discordjs/builders/dist/index.mjs:3:6934)
              at file:///D:/Dev%20Works/Chip/main/node_modules/@discordjs/builders/dist/index.mjs:3:3580
              at Array.map (<anonymous>)
              at T.toJSON (file:///D:/Dev%20Works/Chip/main/node_modules/@discordjs/builders/dist/index.mjs:3:3571)
              at D:\Dev Works\Chip\main\node_modules\discord.js\src\structures\MessagePayload.js:135:30
      "issues": [
        {
          "code": "too_small",
          "minimum": 1,
          "type": "array",
          "inclusive": true,
          "message": "Should have at least 1 items",
          "path": []
        }
      ],
      "name": "ZodError"
    }

Its a cool addition, but I can't find where it even throws on my stack trace

urban belfry
brisk glen

it has multiple options

it actually sends

but when I changed the selection selection.setDisabled(true).setPlaceholder('You already picked a choice');

it throws that on followUp()

urban belfry

could you show more of your code? including the followUp

brisk glen

I don't think I can send it here, but one quick question.
Do the SelectMenuComponent() can only be used one time? since after I send it on an intraction, my options somehow becomes an empty array

plain roverBOT

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

urban belfry

i have no idea what you mean with it becoming an empty array, might be an issue with scopes

brisk glen

if the options are indeed an empty array

it should not send at line 63

but it do send at line 63, and I only change the selection at line 71

and it doesn't contain any code that would empty options

yet the error it threw Invalid Form Body components[0].components[0].options[BASE_TYPE_REQUIRED]: This field is required

actually never mind I realized that I have something that empties it unintentionally

fallow iris

I get this error when trying to trigger a modal. Anyone know why? 😅 nvm <3

fallow iris

Wrong project folder xd

fallow iris

I struggle with MANAGE_CHANNEL
ManageChannel is not correct

its ManageChannels JaleSus

scarlet tangle

why my bot doesnt read dms

urban belfry
scarlet tangle

Aw i just ctrl+f and found this my bad

outer bane

dev forces you to either use enums, numbers or the EnumResolver yourself, it won't accept strings anymore

fallow iris

DiscordAPIError[50035]: Invalid Form Body
type[NUMBER_TYPE_COERCE]: Value "GUILD_VOICE" is not int.

What should I use instead of GUILD_VOICE?

cerulean bay

Is there a difference between the 2 channelTypes options?

outer bane
forest elm
cerulean bay

Ok thanks!

fallow iris
cerulean bay

Was just wondering if one is going to be deprecated

cerulean bay
outer bane

you can import it from d.js, it gets reexported

fallow iris

😅

cerulean bay

Show code?

fallow iris

Breaking change for channel creation?

fallow iris
const channel = await member.guild.channels
    .create(name, {
        type: 'GuildVoice',
        userLimit: limit,
        permissionOverwrites: permissions,
        parent: creatordb.categoryid,
    })
velvet jasper
cerulean bay

^^

velvet jasper

strings are only allowed for bitfields

fallow iris

I wanna cry

but yeah its working. Thanks

tame gazelle
velvet jasper

BitFields are like permissions and flags

scarlet tangle

Why member.permissions undefined

tame gazelle

member isn’t a GuildMember

scarlet tangle

Its

tame gazelle

log it

forest elm

member.permissions is a manager, no chance its undefined

scarlet tangle
uncut kelp

Didn't know it was a manager

That's just the guild object

Oh wait

What

forest elm

i lied, its not a manager

uncut kelp

It's a getter so it won't appear in there btw

forest elm

it wont be undefined anyway

cerulean bay

Show code?

uncut kelp

This is dev, not stable btw

scarlet tangle
tame gazelle
scarlet tangle

lol

velvet jasper
tame gazelle
scarlet tangle

i beated my bad england

uncut kelp

What

scarlet tangle

Permissons

Permissions

uncut kelp

Yes, you made a typo

Just couldn't understand that sentence lol

forest elm

@tame gazelle just search for bitfield on the docs and open the search page, youll see all the classes that contain bitfields

cerulean bay

Would it be possible to add options to interaction.getChannel('name', true) to specify the type of channel that will be returned?

velvet jasper
cerulean bay

Alright, thanks.

forest elm

i mean, it could have a type option for you to pass the channel type, but you could just check that yourself ig

velvet jasper

that just means the library will cast the result to T better to be explicit about it on your end

forest elm

i meant an actual parameter, and the lib could validate the channel type at runtime

outer bane

the enum is called AuditLogEvent

and the resolver is EnumResolvers.resolveAuditLogEvent

though it seems the enum is not reexported from d.js

coarse yoke

is this a djs 14 thing???

ember wolf

thats a new discord thing

coarse yoke

how the-

ember wolf

yep

coarse yoke

what? how do you get that

ember wolf

try joining a new server

coarse yoke

any server?

ember wolf

yep

coarse yoke

do they have to enable that?

knotty plover

no

ember wolf

could be about the age of your account to and if you have sms verification, it happens to me a lot.... Nope it comes default

coarse yoke

How would I be able to make users do that every time?

ember wolf

please....

coarse yoke

bro I'm legit dumbfounded

urban belfry
knotty plover

This is just a Discord client feature

Captchas detect browser behaviour and show things like this when they believe your activity isn't convincingly human like

Or just show it anyway on new accounts

Has nothing to do with bots

dawn phoenix

it's being tested on some servers (afaik some officials have it on, that were targeted by scams very heavily)
to answer the initial question: no, it's not something bots (or even server staff) can do at the moment

rapid umbra
dawn phoenix

will see what discord does with it

rapid umbra

I always wondered how many developers were behind discord lol

ember wolf
rapid umbra

So little ? I don't think so 😮

ember wolf

🤣

rapid umbra

I was thinking of hundreds of developers lol

copper jetty

thousands

rapid umbra

after that it's different the developers for the discord api, and the developers who work for discord in general I think well

rapid umbra
knotty plover

You greatly underestimate how enterprise development works

Hundreds or thousands of developers would be a nightmare to coordinate

copper jetty

millions

knotty plover

Realistically theres probably a number of small teams dedicated to different parts

Teams under 10

autumn forum

that's probably right. probably a team just for android mobile

knotty plover

Small teams for everything

latent lion

Found out selectmenu#collector was not working because componentType, why?

dawn phoenix

as any of the types, not a string anymore

latent lion

What's it called

Discord.SelectMenuType?

velvet jasper

ComponentType.SelectMenu

latent lion

Alright, thanks

small mica

ping me while replying

plain roverBOT

<MessageEmbed>.setFooter() and <MessageEmbed>.setAuthor() now each take an object:

- embed.setAuthor('This is an example text', 'https://exampleicon.com', 'https://websiteofauthor.com')
+ embed.setAuthor({ name: 'This is an example text', url: 'https://websiteofauthor.com', iconURL: 'https://exampleicon.com' })

- embed.setFooter('This is an example text', 'https://exampleicon.com')
+ embed.setFooter({ text: 'This is an example text', iconURL: 'https://exampleicon.com' })
tame gazelle
crude valley

Is the

<Webhook>.deleteMessage()

method removed in this version? If yes what to use now instead of that method?

uncut kelp

It is not removed

crude valley
uncut kelp

Cannot reproduce

Webhook code hasn't been touched for a month or two. I believe you are doing something incorrectly

knotty plover

you cant just.... declare a variable as a webhookclient

and it actually is one

Thats undefined

Im so confused

crude valley

Is re-installing the dev version going to work?

knotty plover

That shouldnt work lol

crude valley

I get some options on v13, but none on v14

The webhook.delete function is also gone

urban belfry
slow storm
dire rover

How do you set Emoji to a button in v14, as People are saying it takes an object now

urban belfry

exactly how people are saying it yes
an object that has a name, id or animated property

slow storm
dire rover
slow storm
crude valley
slow storm
crude valley

It should work ig. When hovering over the starboardWebhook in the 2nd file what type its showing also r u getting any other auto complete?

dire rover
slow storm U can use Util.parseEmoji
  issues: [
    {
      code: 'invalid_type',
      expected: 'string',
      received: 'null',
      path: [ 'id' ],
      message: 'Expected string, received null'
    }
  ],```
```js
.setEmoji(Util.parseEmoji(`923978918048985128`))```
What is wrong ? 🤔
slow storm
crude valley
uncut kelp

When you actually run your code, does it work?

crude valley

Im using typescript it doesnt let me run my code

uncut kelp
crude valley

wait wait um

@uncut kelp wait yeah it runs the code

It runs the code but this error needs to be fixed

uncut kelp

If you compile again, can you screenshot it

slow storm

As it's working fine when compiling

crude valley
crude valley
uncut kelp

Then the issue is with your IDE and not discord.js

crude valley

The same thing after restart

uncut kelp

Shrugs if you're using vsc, restart the TS server. If that doesn't do it, not sure what will, but everything seems to be fine on our end

crude valley

ok

I tested everything

still the same

I'm gonna ask another person and see if they have the same problem

dire rover

Response: Internal Server Error

Not sure why'd this come

dawn phoenix

that is very little information to even start guessing

vague coyote

I can guess tho:
Discord was dying, thats why smug

dire rover

Hey, Were collectors changed ?

My buttons no longer seems to work

vague coyote
dire rover

can you provide me the docs link for the same ?

vague coyote

Sorry, but the docs don't link to the api types yet, so no idea where to find it

weak ridge

Hi! Does anyone have the list of permissions in V14?

dire rover
embeds[0].timestamp[DATE_TIME_TYPE_PARSE]: Could not parse 1645618896465. Should be ISO8601.```

I used to use Date.now() in Timestamps earlier though I guess it's changed aswell, Any fix ?
plain roverBOT

Determining your discord.js version:
npm list discord.js
• Make sure you use the right documentation for your installed verison (selector on the left)

dull mulchBOT
dawn phoenix

well, i mean, the obvious fix is to use iso instead

dire rover

Hmm, So Date.now was removed ?

dawn phoenix

? that's core js, what do you mean

dire rover
copper jetty
dawn phoenix

what even is that
unsafe embed, embed, raw embed data

outer bane

if you use objects you have to provide iso-strings, builders still accept the timestamp and convert it internally

dawn phoenix

an Embed instance imported from djs?

regal mason

How can this fits with the new djs builders

lament wave
scarlet tangle
/.../node_modules/discord.js/src/structures/Guild.js:729
      const id = this.client.user.resolveId(options.user);
                                  ^
TypeError: this.client.user.resolveId is not a function
    at Guild.fetchAuditLogs ((...)node_modules/discord.js/src/structures/Guild.js:729:35)
    at default_1.run ((...)/listeners/guildBanRemove.ts:10:49)
    at ([ClientName]).<anonymous> (...)
    at ([CLientName]).emit (...)
    at ([ClientName]).emit (...)
    at GuildBanRemove.handle (...)
    at Object.module.exports [as GUILD_BAN_REMOVE] (...)
    at WebSocketManager.handlePacket (...)
    at WebSocketShard.onPacket (...)
    at WebSocketShard.onMessage (...)

Did .resolveId() ever exist? Perhaps it shouldn't be ClientUser but some manager? (just guessing based on searching the .resolveId() method)

This error is being thrown when fetching audit logs with the following options:

{
  type: number,
  limit: number,
  user: User
}
urban belfry

is this modified or is it just the internal code?

scarlet tangle

internal, i didn't modify it

discord.js@14.0.0-dev.1644537979.298b226, not latest bc typescript screams errors, let me see if its the same in the latest version tho

urban belfry

time to see who to git blame
making a pr

scarlet tangle

internal, still in djs AT dev

urban belfry

?

is this on stable too?

scarlet tangle

not sure, let me check tho

outer bane

shouldn't be, seems like an oversight from the rest pr

scarlet tangle

ah

dull mulchBOT
forest elm

not a feature

urban belfry

defo bug

forest elm

"feat(guild)"

urban belfry

i did it on phone, let me fix that

river harbor

Will v14 have support for Interaction POSTs?

gloomy kayak

Wdym?

scarlet tangle
urban belfry

probably going to be another package if discordjs makes anything

gloomy kayak

There's already /rest

You can easily use client.rest actually

Though there shouldn't be any reason to

scarlet tangle

interaction posts

is discord sending you a post request everytime there is an interaction

instead of connecting to the gateway

gloomy kayak

Ohh I see what you mean

Receiving interactions via "webhook" instead of websocket

scarlet tangle

i have a bot like that

it doesnt have a status

gloomy kayak

This isn't actually supported and I think it's very difficult to apply to a library like discord.js

scarlet tangle

its actually not that hard to do that

gloomy kayak

Well, whole djs is based on a websocket gateway

scarlet tangle

yeah

but there is a tutorial for javascript on discord developer docs

gloomy kayak

I don't think it's so easy to adapt and I think if it will ever be added will probably be part of a new package

urban belfry

yeah builders api-types are split up real neatly
i think a different library that utilizes these is very much plausible
however this is not dropping on v14

scarlet tangle

and its mostly not good for bots unless they just send messages

urban belfry

of course, there are just some sacrifices you need to make for interaction only bots
like the cache you're used to djs is just not there

but i think we should continue on #archive-offtopic since it's again, not dropping on v14 and isn't related

tame gazelle
(node:5596) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
    at emitExperimentalWarning (node:internal/util:224:11)
    at new Blob (node:internal/blob:137:5)
    at Response.blob (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\undici\lib\fetch\body.js:292:12)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Response.text (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\undici\lib\fetch\body.js:301:18)
    at async Response.json (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\undici\lib\fetch\body.js:306:23)
    at async Function.fetchRecommendedShards (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\src\util\Util.js:279:24)     
    at async ShardingManager.spawn (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\src\sharding\ShardingManager.js:186:16)

this is a warning that comes from discord.js right? not my code?

urban belfry

yes it's internal

radiant lintel

do you think modals are almost done

urban belfry

We have no etas no clue

weak ridge

Hi! Someone know why i have this error?

DiscordAPIError[50035]: Invalid Form Body
0.permissions[0].type[NUMBER_TYPE_COERCE]: Value "ROLE" is not int.
    at C.runRequest (C:\Users\felal\Desktop\PRODEFIX\Discord\Bot-Slash-3.0\node_modules\@discordjs\rest\dist\index.js:7:581)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C.queueRequest (C:\Users\felal\Desktop\PRODEFIX\Discord\Bot-Slash-3.0\node_modules\@discordjs\rest\dist\index.js:5:3049)
    at async ApplicationCommandPermissionsManager.set (C:\Users\felal\Desktop\PRODEFIX\Discord\Bot-Slash-3.0\node_modules\discord.js\src\managers\ApplicationCommandPermissionsManager.js:173:18)
    at async C:\Users\felal\Desktop\PRODEFIX\Discord\Bot-Slash-3.0\Structures\Handlers\Commands.js:52:17
knotty plover

v14 replaces strings with enums/numbers

weak ridge

And do you know how I can fix this error?

knotty plover

I think it'll be ApplicationCommandPermissionType.Role

weak ridge

I don't use "ROLE" in my command

knotty plover

You clearly do

Value "ROLE" is not int.
On line 52 of Commands.js

weak ridge

Commands.js is my handler

knotty plover

Well thats where the error came from

weak ridge

I will send my command "0"

module.exports = {
    name: 'blacklist',
    description: "Pour interdire/autoriser des utilisateurs d'utiliser le bot",
    permission: "ADMINISTRATOR",
    options: [
        {
            name: "ajouter", description: "Pour ajouter un utilisateur à la blacklist", type: opType.Subcommand,
            options: [{ name: "utilisateur", description: "L'utilisateur", type: opType.User }]
        },
        {
            name: "retirer", description: "Pour retirer un utilisateur de la blacklist", type: opType.Subcommand,
            options: [{ name: "utilisateur", description: "L'utilisateur", type: opType.User }]
        },
        { name: "liste", description: "Pour voir la liste des utilisateurs blacklist", type: opType.Subcommand },
    ],
    execute(interaction, client) // My command
}
knotty plover

then its not from that one

weak ridge

I will send my handler

knotty plover

Dude just go look for wherever you set a role type permission with the world ROLE

And stop sending unrelated code

gloomy kayak

Just search for "ROLE" in your project actually lol

knotty plover

You're arguing with your own error message

Dont waste my time

willow oxide
hardy wind

Hey guys, is it still possible to get png format avatar URLs using member.user.avatarURL()?
Thanks

urban belfry
plain roverBOT

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

hardy wind
urban belfry

Oh wait now it's extension
Not format

hardy wind
vague coyote

<@&839912195994812420>

halcyon parcel

@knotty plover

i am using this cmd to leave fake guilds but not comming

knotty plover

And you have pinged me for this why?

halcyon parcel

by ds,js version is v13

halcyon parcel
knotty plover

Please read the server rules

halcyon parcel
midnight ivy

Can anyone provide a guide to discord.js v14?

silk topaz
dire rover
DiscordAPIError[50001]: Missing Access
    at C.runRequest (C:\Hydro\node_modules\@discordjs\rest\dist\index.js:7:581)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C.queueRequest (C:\Hydro\node_modules\@discordjs\rest\dist\index.js:5:3049) {
  rawError: { message: 'Missing Access', code: 50001 },
  code: 50001,
  status: 403,
  method: 'put',
  url: 'https://discord.com/api/v9/applications/936115246190444554/guilds/847063372343410689/commands',
  requestBody: {
    files: undefined,
    json: [
      {
        name: 'ping',
        description: 'returns websocket ping',
        type: 1,
        run: [AsyncFunction: run]
      }
    ]
  }
}```

Why'd this come ?

proud glacier
scarlet tangle
scarlet tangle

Error says the opposite

tough egret

kick your bot and invite it again with all scopes (bot and application.commands)

scarlet tangle

Make sure the guildId is correct

scarlet tangle
dire rover

But it should not create any problem because I am not registering slash commands globally

I tried inviting it to a server where I didn't register slash commands and this comes.

scarlet tangle

Registering commands to a single guild requires the guild to have application.commands scope for the bot

You didn't invite with application.commands scope then

dire rover

Let me confirm.

scarlet tangle

The error already did dogeHaHa

Just reinvite the bot with the correct scopes

dire rover

Was not about reinviting, One of my admins kicked the bot from the guild I was registering the slash commands to.

scarlet tangle

How i'm supposed to declare guilds?

dire rover

So it didn't have access to the guild

scarlet tangle

It should be part of GatewayIntentBits

urban belfry

what even is the error?

scarlet tangle

Looks like it is my ide

Colors is an integer value now right?

I never used colors before, i used hex as an string

finite fog

You can use hex literals then, e.g. 0xFFFFFF

scarlet tangle

You mean like this?

finite fog

Yep

scarlet tangle

Thanks

shadow socket

.setColor("#FF0000") dosent work?

finite fog

No, it must be a number or rgb array now.

shadow socket

okay ty

scarlet tangle
scarlet tangle

as i have understood in the actual docs this is fine?

.addField({text: ["Mention a valid member", "You must mention by a ping a member inside this server"]})```

And also where do i see the footeroptions?

forest elm
forest elm
scarlet tangle

but

.setFooter({text: `${moment(date.now).format("DD/MM/YYYY hh:mm:ss")}`})```
forest elm

npm ls discord.js or yarn why discord.js

scarlet tangle
forest elm

cannot replicate your issue

scarlet tangle

Maybe ide being dum

webstorm dosen't like new versions of discord.js

forest elm

i wouldn't blame the ide if you're using javascript (instead of typescript)

urban belfry

nah it's some webstorm type checking stuff, try restarting the server if that's an option

scarlet tangle

server? i'm coding this locally

What do you mean by restarting the server

forest elm

restart the ts server

urban belfry

just restart the ide

scarlet tangle

Didn't work at all

anyways if it works it works

gotta stick to that

or maybe start using vscode?

urban belfry

wait how'd you define Embed? are you getting it from builders or djs?

scarlet tangle

const { Embed } = require("discord.js");

urban belfry

can't replicate on webstorm either

scarlet tangle

oof

maybe because this?

I someday deleted a discord.js thing that was created here and intelisense started responding

vagrant mortar

Hey! Is there a guide for modals?

urban belfry

not yet
it didn't even get merged on djs yet

vagrant mortar

👍Ok 👍

weak ridge

Hi! Have collectors changed in V14?

uncut kelp

Why

weak ridge

Because they don't work now

uncut kelp

Okay

Perhaps it would be better to ask a question where people can help you

vagrant mortar

Hey im using monbrey/discord.js#modals, how do i create modals?

urban belfry

they're not really merged yet, so nothing we can help you on
if the pr has instructions follow them, or look at the api docs if that's any help
i'd suggest just waiting

weak ridge
uncut kelp Perhaps it would be better to ask a question where people can help you

Here is my code if you want:

const row = new Discord.ActionRow().addComponents(
    new Discord.ButtonComponent().setCustomId('1').setLabel('1').setStyle(3),
    new Discord.ButtonComponent().setCustomId('2').setLabel('2').setStyle(4)
);

const msg = await interaction.reply({ embeds: [new Discord.Embed().setDescription("Click")], components: [row], fetchReply: true });
const collector = msg.createMessageComponentCollector({ max: 1, componentType: "BUTTON" });

collector.on("collect", async (b) => {
    if (b.customId == "1") {
        console.log("1")
    } else {
        console.log("2")
    };
});

collector.on("end", (a, b) => console.log(a, b));

And it returns nothing

urban belfry

read the guide pinned on this channel

weak ridge
vagrant mortar

i will just use a select menu

plain roverBOT

Documentation suggestion from @icy dew:
_ GuildMember#roles
A manager for the roles belonging to this member

wheat island

Ts rewrite caching looks more promising for me, I will not lie raw djs disabled threads, emojis and stickers just for a music bot used 85gb of ram lol of 230k servers and it's insanely high

scarlet tangle
velvet jasper
scarlet tangle

i like these

velvet jasper

But they’re not readable

Most people don’t know what 2 means when they see it code

scarlet tangle

iremember

scarlet tangle

k

scarlet tangle
scarlet tangle
velvet jasper

Oh wrong one

icy dew

just asking, we can't use json objects & magic numbers for modals until it's supported right?

velvet jasper
icy dew
velvet jasper
icy dew

alright, thanks

latent lion

await i.resetTimer() not a function... help

jaunty vault
latent lion
sudden bobcat

When will modals come out?

knotty plover

When theyre ready

violet pine

Will the bots still in development require the update prior to the Official Launch™️ of the bot or is that something that can wait until the bot is finished?

scarlet tangle

what do you mean? you don't have to update immediately once v14 launches, we'll still be supporting v13 for a bit (atleast i hope so)

violet pine

Okay, cool, I figured that kind of update was one that could wait a little while but didn't hurt to be sure.

dawn phoenix

the only thing that can't really wait is <v13 switches, because those are going to be decommissioned soon'ish

violet pine

Gotcha. Well, good thing I have the latest v13 release, so I should be fine until further notice then. (It's already painful enough to try and get my bot to respond, but that's a can of worms I'm delving into now to get to the bottom of it)

scarlet tangle

can someone help me? i can't install modals pull request

E:\Projects\Discord\Yune Mod>yarn add discordjs/discord.js#7023/head
yarn add v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error E:\Projects\Discord\Yune Mod\node_modules\@discordjs\discord.js: Command failed.
Exit code: 1
Command: is-ci || husky install
Arguments:
Directory: E:\Projects\Discord\Yune Mod\node_modules\@discordjs\discord.js
Output:
'is-ci' not recognized as an internal command
or external, an operable program or a batch file.
'husky' not recognized as an internal command
or external, an operable program or a batch file.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
urban belfry
lethal trail

does djs v14 uses api v10?

tame gazelle

it will iirc (or actually does)

scarlet tangle

My embed is not sending, there isn't also any error ```js
const Help = new Embed()
.setColor(config.Embedcolor)
.setTitle('Help')
.addField({name: ${config.prefix}Help, value: "Will show this message"})
.setDescription('There are various help pages for every bot function')
.addField({name: ${config.prefix}Help moderation, value: "Display help about moderation commands."})
.addField({name: ${config.prefix}Help misc, value: "Displays help about misc commands."})
.setFooter({text: ${moment(date.now).format("DD/MM/YYYY")}})

message.channel.send({embed :[Helpmoderation]})

lethal trail

if it dosent use v10 then it dosent make sense to update to v14

lethal trail

due date is april before that we need to shift to v10

tame gazelle
scarlet tangle
tame gazelle
scarlet tangle

What do you mean?

lethal trail
scarlet tangle

I can send the whole module code

lethal trail
tame gazelle
scarlet tangle
const Help = new Embeds()```
lethal trail

damn they changed it too

tame gazelle

channel.send({ embeds: [embed] })

scarlet tangle

Still not sending like that

tame gazelle

show your code now

lethal trail

whats the error in the console?

scarlet tangle

it ignores the existance of it

lethal trail

.

scarlet tangle
const { Embed } = require("discord.js");
module.exports = {
    name: 'Help',
    execute(message, args, config, moment, date, helpvar){
        //command start lmao
        const Help = new Embed()
            .setColor(config.Embedcolor)
            .setTitle('Help')
            .addField({name: `${config.prefix}Help`, value: "Will show this message"})
            .setDescription('There are various help pages for every bot function')
            .addField({name: `${config.prefix}Help moderation`, value: "Display help about moderation commands."})
            .addField({name: `${config.prefix}Help misc`, value: "Displays help about misc commands."})
            .setFooter({text: `${moment(date.now).format("DD/MM/YYYY")}`})

        const Helpmoderation = new Embed()
            .setColor(config.Embedcolor)
            .setTitle('Moderation commands')
            .setDescription(`This are the moderation commands, Use ${config.prefix}Help "Command" to know more`)
            .addField({name: `${config.prefix}Ban "Ping" "Reason"`, value: "Bans the pinged user and stores the reason.."})
            .addField({name: `${config.prefix}Unban "User ID" "Reason`, value: "Unbans The user with the ID set and stores the reason."})
            .addField({name: `${config.prefix}Mute "Ping" "Time" "Reason"`, value: "Mutes the pinged user for the defined time and it will also store the reason"})
            .addField({name: `${config.prefix}Kick "Ping" "Reason"`, value: "Kicks the pinged user and stores the reason"})
            .addField({name: `${config.prefix}Cases "User ID or Ping"`, value: "Shows all the cases from an user and the stored reasons for them"})
            .setFooter({text: `${moment(date.now).format("DD/MM/YYYY")}`})

        const Helpmisc = new Embed()
            .setColor(config.Embedcolor)
            .setTitle('Misc commands')
            .setDescription(`This are the misc commands, Use ${config.prefix}Help "Command" to know more`)
            .addField({name: `${config.prefix}Level "Ping"`, value: "It will show the level for the mentioned user, It will show yours if there wasn't any user pinged."})
            .addField({name: `${config.prefix}Leaderboard`, value: "It will show the levels leaderboard for this server"})
            .setFooter({text: `${moment(date.now).format("DD/MM/YYYY")}`})

            if(helpvar === 1){
                message.channel.send({embeds: [Helpmoderation]})
                message.channel.send(":warning: the timers and the mute command isn't available right now :warning:");
            }else if(helpvar === 2){
                message.channel.send({embeds: [Helpmisc]});
            }else if(helpvar === 0){
                message.channel.send({embeds: [Help]})
            }else if(helpvar >= 4){
                message.channel.send({embeds: [err3]});
                console.log("Command Help || " + moment(date.now).format("DD/MM/YYYY hh:mm:ss") + ` || Error 3\n `)
                return;
            }

            console.log("Command Help || " + moment(date.now).format("DD/MM/YYYY hh:mm:ss") + ` || variabletype ${helpvar}\n `)

    }
}```

I feel it isn't problem of any embed now.

Is messageCreate invalid or something?

tame gazelle

nope

still works

scarlet tangle

It is ignoring the whole listener, i should change something from it? v13 > v14

bot.on('messageCreate', message => {}

There isn't literally any documentation about this.

velvet jasper

That should work as expected

scarlet tangle

It ignores the thing as it didn't exist

maybe something related to the intents?

night latch

help ples

            const components = (state) => [
                new ActionRow().addComponents(
                    new SelectMenuComponent()
                        .setCustomId("help-menu")
                        .setDisabled(state)
                        .setPlaceholder("Choose a category here")
                        .addOptions(
                            categories.map((cmd) => {
                                return {
                                    label: cmd.directory.toUpperCase(),
                  description: `Commands from ${cmd.directory}`,
                                    emoji: dirEmojis[cmd.directory] || null,
                                    value: cmd.directory.toLowerCase(),
                                };
                            })
                        )
                ),
            ];
node:events:498
      throw er; // Unhandled 'error' event
      ^

DiscordAPIError[50035]: Invalid Form Body
components[0].components[0].options[0].label[BASE_TYPE_REQUIRED]: This field is required
components[0].components[0].options[0].value[BASE_TYPE_REQUIRED]: This field is required
    at C.runRequest (C:\Users\\OneDrive\Desktop\New-folder\v14\djs-base-handler\node_modules\@discordjs\rest\dist\index.js:7:581)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C.queueRequest (C:\Users\\OneDrive\Desktop\New-folder\v14\djs-base-handler\node_modules\@discordjs\rest\dist\index.js:5:3049)
    at async TextChannel.send (C:\Users\\OneDrive\Desktop\New-folder\v14\djs-base-handler\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:175:15)
    at async Object.run (C:\Users\\OneDrive\Desktop\New-folder\v14\djs-base-handler\Commands\bot\help.js:71:27)
    at async client.<anonymous> (C:\\Steph\OneDrive\Desktop\New-folder\v14\djs-base-handler\events\messageCreate.js:51:3)
Emitted 'error' event on client instance at:
    at emitUnhandledRejectionOrErr (node:events:381:10)
    at processTicksAndRejections (node:internal/process/task_queues:85:21) {
  rawError: {
    code: 50035,
    errors: {
      components: { '0': { components: { '0': [Object] } } }
    },
    message: 'Invalid Form Body'
  },
  code: 50035,
  status: 400,
  method: 'post',
  url: 'https://discord.com/api/v9/channels/856203163652194325/messages',
  requestBody: {
    files: [],
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: [
        {
          title: 'Need Help',
          description: '\`\`\`fix\nChoose a category in the select menu.\`\`\`',
          color: 9807270
        }
      ],
      components: [ { type: 1, components: [ [Object] ] } ],
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: undefined,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined
    }
  }
}
scarlet tangle

As i have understood in the docs it says this for intents

const myIntents = new Intents(32509);
const bot = new Client({ intents: myIntents });

How do intents work exactly? in v14

molten briar
const bot = new Client({intents:[]})```
Intents Is Array (Intent List)
scarlet tangle

Thanks a lot

blazing quartz

Will Node.JS v16.9 be required on release of v14?

urban belfry
blazing quartz

Ah minimum 😅 that works haha

Was making sure it wasn't version specific

As I run some stuff requiring 16.13+

urban belfry

yeah you should be fine, for now
unless of course in the future they release some cool new feature and the maintainers want to include that

blazing quartz

I'm just hoping modals gets pushed into v14

urban belfry

they will drop on v13 as well

blazing quartz

Oh sweet, thank ya much 😅

dire rover

is fetchWebhook function changed/removed ?

dawn phoenix

please be a bit more verbose

if you get errors, provide errors and code, explain what doesn't work, etc.

vague coyote

already answered

KEK

dawn phoenix

w.. am i blind?

ah, crossposting, nice

vague coyote

both smug

urban belfry

yeah we don't really know
but if you're asking if we're waiting for some api docs or feature to release, i think not? i'd reckon it'd be mentioned in the pr then

tall verge
night latch help ples ```js const components = (state) => [ new ...

import the SelectMenuOption class next:

const components = (state) => [
            new ActionRow().addComponents(
                new SelectMenuComponent()
                    .setCustomId("help-menu")
                    .setDisabled(state)
                    .setPlaceholder("Choose a category here")
                    .addOptions(
                        ...categories.map((cmd) => new SelectMenuOption({ 
                                label: cmd.directory.toUpperCase(),
              description: `Commands from ${cmd.directory}`,
                                emoji: dirEmojis[cmd.directory] || null,
                                value: cmd.directory.toLowerCase(),
                            })
                        })
                    )
            ),
        ];
urban belfry

wrong
addOptions doesn't take in an array, it takes a rest parameter

tall verge

true, now it should go

urban belfry

yeah there's no need to spoonfeed, just explain the change
@night latch the docs are currently wrong

on your addOptions, you don't pass an array really, you pass a multiple parameters
so you can simply spread it

plain roverBOT

_ 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.

night latch

ohhhh

limpid stratus

Shouldn’t .isRepliaple also check whether it’s replied to

slate kelp

hey discord.js@\dev doesn't have Partials in export

||oof it pinged someone||

tame gazelle

it does

slate kelp

Turns out there was some error with vsc not reading types correctly. It needed a reload

regal mason

idk what's wrong with components

urban belfry
regal mason

What does it take ?

urban belfry

pass them as separate parameters
also i don't recommend using nested listeners
they're adding new listeners every time you're running the code!

regal mason

What do you recommend to use instead ?

uncut kelp

Or spread

regal mason

Spread ?

urban belfry

why do you have it nested?

if you need to pass on data, use a collector but i'd much rather use a normal listener on the level as the other listeners see
since most people don't use them right and since there are custom ids you can mostly just convert that to a normal listener

plain roverBOT

_ 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.

urban belfry

but you don't need spread, just use separate arguments

regal mason

mmmh

Something changed there too

urban belfry

ButtonStyle.Secondary
read the guide!~

forest elm

emoji: { name: '<insert emote here>' }

urban belfry

also i'd much rather use the builder methods than passing these at once in the constructor

scarlet tangle

I forgot that using discord.js@dev is going to be so different from using the stable version

vague coyote

who would have thonked

scarlet tangle

Im gonna code the bot twice I guess

One in stable and one in dev

regal mason

What's wrong with the customId

forest elm

pretty sure you have to use snakecase when passing things directly in the constructor

regal mason

??

tame gazelle

custom_id ig

regal mason

Oh

velvet jasper

Are you using builders from djs?

forest elm

if not that then they're doing something wrong

regal mason

ButtonComponent is at the right place ?

velvet jasper

Oh yeah that’s ur issue import the components from djs not builders

forest elm

why does builders not accept camelcase on the constructor, it uses camelcase on the getters

velvet jasper

Idiomatic js classes always have camel case props. In builders the json data is always meant to be api data

forest elm

its just that 2 identically named classes accepting 2 different things on their constructor is rather confusing (it doesn't matter to me as i dont use them, just saying that it might be confusing for users that do use them)

velvet jasper

I disagree mainly because you have to go out of your way to download /builders in the first place. Most people are just going to import from djs

forest elm

you dont have to install it? discord.js uses builders so it will be installed regardless

vscode even suggests builders before discord.js

regal mason

What does that means ?

DiscordAPIError[40060]: Interaction has already been acknowledged.
forest elm

you're replying/deferring the interaction more than once

velvet jasper
forest elm
regal mason
copper jetty
regal mason

Ah

sturdy sphinx
copper jetty
sturdy sphinx

but i want my embeds updated everytime a button is pressed ?

tame gazelle

edit the reply

copper jetty
velvet jasper
forest elm

of course typescript wont allow it

the uninformed user will not be using typescript

sturdy sphinx
tame gazelle
forest elm
forest elm
velvet jasper

It's meant to be extended in this manner for different use cases

forest elm

👍

regal mason
velvet jasper

The documentation is being fixed soon

regal mason

What ??

Rest Array ?

urban belfry

multiple parameters, a rest parameter

plain roverBOT

_ Rest parameters
The rest parameter syntax allows a function to accept an indefinite number of arguments as an array, providing a way to represent variadic functions in JavaScript.

regal mason

Ah yes

This feature

I have the same problem here

I added ...

But there's the same problem

urban belfry

instead you must (for now) use the select menu options class

i am unaware if this got fixed, looks like not
but then again try to update and see
i haven't kept up with dev xD

brave mulch

Is slash command option attachment supported in v14 ?

regal mason

With your solution, there's only one element

urban belfry

did you try updating and trying though?

outer bane

support for objects in options was merged over a weak ago

regal mason

weak week

urban belfry

then update and try as i've told you already 🙃

regal mason

I think I have to update djs

regal mason
velvet jasper

It is, you need to update djs

regal mason

Already updated

velvet jasper

What did you do to update it

regal mason

npm i discord.js@digital dust

lol

Am I done something wrong ?

forest elm

as a side note: the regular SelectMenuComponent#addOptions() isn't being validated on runtime Thonk

@regal mason can you run node with the --enable-source-maps flag so we can get proper stack traces? e.g. node --enable-source-maps index.js

regal mason

Found a fix

forest elm

but that shouldn't be required anymore

urban belfry

if it's fixed, just update djs

regal mason

I got this idea before Bwen told me to

urban belfry

okay that's irrelevant but did you actually update and try?

regal mason

Yeah already tried

urban belfry

now that's an issue then
could it be some npm cache stuff?
try uninstalling, cleaning cache, and then reinstalling

regal mason

How to clean cache ?

urban belfry

i forgor what it was exactly, but you can google it, it should be a simple command

regal mason
npm cache clean --force

Found with duckduckgo 😎

Same error @urban belfry

forest elm

cannot replicate your issue

regal mason
forest elm

this works on latest @dev

regal mason

I love your color scheme btw

regal mason
TypeError: t.toJSON is not a function
    at null.<anonymous> (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\@discordjs\builders\src\components\selectMenu\UnsafeSelectMenu.ts:122:39)
    at Array.map (<anonymous>)
    at $.toJSON (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\@discordjs\builders\src\components\selectMenu\UnsafeSelectMenu.ts:122:26)
    at $.toJSON (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\@discordjs\builders\src\components\selectMenu\SelectMenu.ts:37:16)
    at null.<anonymous> (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\@discordjs\builders\src\components\ActionRow.ts:46:61)
    at Array.map (<anonymous>)
    at ActionRow.toJSON (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\@discordjs\builders\src\components\ActionRow.ts:46:32)
    at C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\discord.js\src\structures\MessagePayload.js:135:30
    at Array.map (<anonymous>)
    at MessagePayload.resolveBody (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\discord.js\src\structures\MessagePayload.js:134:49)
regal mason
urban belfry

do you have builders installed?

regal mason

Yes

urban belfry

if so try updating that too

forest elm

i couldnt replicate your issue with 0.13.0-dev.1645142857.f7257f0
the color scheme is one dark pro

regal mason

Okay

scarlet tangle

which sharding is good for discord music bots ?
iam using discord hybrid sharding but its bad

regal mason

I updated discordjs/builders

and that works

urban belfry

discordjs/builders@dev

forest elm

that's the latest builders @dev

regal mason
forest elm
scarlet tangle

bcs no one is online

forest elm
velvet jasper
forest elm

validating anything at all, the safe version doesn't override the unsafe method

velvet jasper

well originally my idea was that SelectMenuOption would be validated and passed in, but I see the issue now

forest elm

setOptions() isnt being validated either

heady girder

is there a guide to use modals?

vague coyote

Since modals are not even merged yet, no, there is not

The only thing available is the pr description.

steady apex

since when was it a good idea to change all the things again?
Can someone comfirm the new embed thing and what not like we went from RichEmbed or what ever and then it was MessageEmbed. are we really switching that again? and if so why new Embed?

knotty plover

RichEmbed was like 2, 2 and a half years ago

steady apex
outer bane <https://github.com/discordjs/discord.js/discussions/7380>

I get why, but why not keep it simple. since now it will be (complicated) to rewrite all the thing (AGAIN) it would be better to make it able to be as it is but make the things work with the source. (This probebly diden't make sense) but it's annoying to keep needing to rewrite left and right. But i will do it, beacuse it's fun to code.

steady apex
knotty plover

I mean all I can really say is that we do always have a reason for it

steady apex

since they things keep changing left and right. and i use buttons and embeds alot

urban belfry

Think smart
If you do use them a lot
You can search and replace

steady apex
knotty plover

Yeah we (I) made a mistake when introducing them by calling them MessageButton etc. I thought it made sense at the time, because it was consistent with MessageEmbed

urban belfry

How?
It's a matter of 10 seconds

knotty plover

But now we're refactoring them all to a new, still consistent approach

velvet jasper

Also I’d like to point out that v13 is going to be supported for the foreseeable future. When v14 comes out nothing is forcing you to upgrade

urban belfry

Oh yeah isn't MessageAttachment turning into attachment?

knotty plover

Yeah we're also doing a 13.7 release

gray hornet

Ayo if I move over to main branch (yes I understand the risks) will I be able to use text input components?

velvet jasper

Not yet

gray hornet

Damn, so no version of djs supports text input at all?

velvet jasper

No because none of the PR’s have been merged yet

gray hornet

Kk, thank you

livid mauve

does the dev version support the new interaction models?

silk topaz
wide patio

👀

eager glen

got a error can anyone help?

i was using vsc but a work i uploaded the files to replit installed all the depencies , packages , but when i running it getting this error

hardy bone

did modals release :/

outer bane
green halo

are modals available in the dev version of djs?

outer bane

look one message above

green halo

oh okay sry

obtuse summit

with v14 - is it possible to create a LINK style button?
I can't seem to find .setStyle() - I am interested in the url link and icon features

urban belfry
obtuse summit

ah, gotcha

and support for custom icons is still not available for discord's api, yeah?

urban belfry

custom icons? like custom emojis on buttons?

yeah you can

obtuse summit

so its from a dedicated method, I was trying to inject it's id tag as the string

urban belfry

if you want to add emojis, you' d use setEmoji()

if it's a custom emoji {id: 'emojiId'}

i'd rather you use the object than use the resolveEmoji util method
since it's private

obtuse summit

ah, kk

urban belfry

@obtuse summit ComponentType.SelectMenu

they all now use enums
read the guide

obtuse summit

yep, that works - I read the guide, I just missed it

just not sure why its not editing the original message
I now have a chain of replies (which is not ideal)


  // collector
  const collector = xx.createMessageComponentCollector({
    componentType: ComponentType.SelectMenu,
    time: 4.32e7,
    max: 1,
    fetchReply: true,
  });

  collector.on('collect', async (i) => {
        console.log('COLLECTOR ON: ', i);
        const code = i.values[0];
    
        await event.editReply({ embeds: [embed], components: [], ephemeral: true }).catch((err) => {});
gloomy kayak

Why not i.update instead of event.editReply, iiuc

obtuse summit

thanks, didn't catch the second one

south python

Which discord-api-types package version does the dev version require?

urban belfry

currently 0.27.0 it seems

inland nova

im making a embed and i get this

forest elm

show the code that is causing the issue

tame gazelle

why do we need to set the privacyLevel if GuildOnly is the only value that we have to set?

south python

I was trying to update the discord.js@dev version and discord-api-types version, but now i get this error when starting up the bot.

forest elm
tame gazelle
forest elm

?

tame gazelle

without put the option*

forest elm
tame gazelle

ah I was talking about GuildScheduledEventCreateOptions

inland nova
forest elm

oh

forest elm
inland nova
south python
tame gazelle
forest elm
inland nova tf?

discord.js' reexported embed should allow that, you're probably not up to date

but theres no reason to be passing the hex as a string anyway so might as well just use the literal

forest elm
inland nova
forest elm

nope, 0xff0000

tame gazelle
scarlet tangle
scarlet tangle
forest elm

there used to be 2 options, but now theres only one

scarlet tangle

then that explains it as stage discovery is no more

inland nova
forest elm

?

inland nova

why discordjs bully us

forest elm

what?

scarlet tangle
inland nova
forest elm

good idea

scarlet tangle
inland nova nvm

All of the changes have a reason you can look up in the pinned messages to find out why

forest elm

because if you passed a hex string discord.js would have to parse it into a number

velvet jasper
tame gazelle

thanks yya

midnight herald

Hello, how can I extend a class?

There was Structures.extend in v12, is it possible now?

uncut kelp

Nah

midnight herald

Isn't there anyway, or just for Structures.extend

tame gazelle

anyone know why it doesn't add components?

urban belfry

No
It looks fine
Log the row before sending

tame gazelle

it doesn't log it ._.

urban belfry

What
I thought you meant like it only sent the embeds

tame gazelle

it does that

but like, I add a log before sending and the row doens't being logged

urban belfry

This makes zero sense
Is it saved

tame gazelle

I've saved and restarted

urban belfry

Woth it being this vague it could be anything

forest elm
urban belfry

It reaches this point
But it doesn't? 🤨

tame gazelle

ahhhhh I get why
the wrong file is being executed I have to add a filter while setting commands to the collection

regal mason

Is there a way while using an command handler, a way to not use deferReply every time a command get triggered, but also not crash the bot / do not reply because the bot replied after 3 seconds ?

But you know sometimes the bot can have lag and commands can take more than 3 seconds to reply. That doesn't crash the bot but the command doesn't work obviously

No they work but there's no reply

This is particularly annoying knowing that this feature is mandatory if we want to continue to have a functional bot (above 100 servers)

Not related

Youtube api 😔

silk topaz
regal mason Youtube api 😔

defer the interaction as soon as you receive it, i don't think you won't be able to reply within 15 minutes (after you defer)

regal mason

Yep I did that

tame gazelle

will embed.spliceFields(1, 1) remove the second field?

tame gazelle

cannot try if I don't know if it does that ._.

regal mason

Idk why but this returns undefined

In args[0] there's an message ID that is VALID

plain roverBOT
regal mason

I don't think this will help me

This promise is awaited

urban belfry

(await promise). property

regal mason

if it's what you wanted me to understand

tame gazelle

if someone send something it's not for wasting your time

it's for help you

urban belfry

You're awaiting the (Promise.property)
Not awaiting the promise then getting the property

obtuse summit

is there any way to create a toggle button for interactions?

forest elm

what

obtuse summit

I'm trying to create a 'self assigned roles' menu

with v14

copper jetty
obtuse summit
copper jetty

collectors keep collecting until you stop them

obtuse summit

interesting, good to know

scarlet tangle

How can i install it?

Discord.js v14?

velvet jasper
scarlet tangle

I saw

scarlet tangle
velvet jasper

No

scarlet tangle

Yay

scarlet tangle
velvet jasper

You should be upgrading to slash commands anyways

velvet jasper
scarlet tangle
copper jetty

You can have 200 slash commands in total

velvet jasper
scarlet tangle

Oh

copper jetty

100 guild commands and 100 global

velvet jasper

100 commands is more than enough for any bot imo

If you need more you should probably look at splitting your bot into separate bots

scarlet tangle

Subcommands can also help

quasi kite

why enums?

regal mason

because OOP

plain roverBOT
plain roverBOT

_ ClientUser (extends User)
Represents the logged in client's Discord user.

weak ridge

Hi! Does anyone have the list of events in V14?

plain roverBOT

Documentation suggestion for @weak ridge:
_ Client (extends BaseClient)
The main hub for interacting with the Discord API, and the starting point for any bot.

urban belfry

adding to that you may find more on client.rest

weak ridge

Thank you, but is there a variable in Discord.JS to have all the events?

tame gazelle

like a list of all of them?

weak ridge

Yes

urban belfry

no there isn't, you listen to the specific one

weak ridge

Ok

Is there still the webhookUpdate event in V14?