#djs-in-dev-version
35223 messages · Page 5 of 36
Is there a way to do so?
I'm using it and still get the type errors
npm i @discordjs/builders@dev?
yes
I just installed everything with npm i discord.js@dev @discordjs/builders@dev @discordjs/rest@dev discord-api-types
Same output for me
@cerulean bay might work to install api types 0.27.0
oh I had skipLibCheck set to true, getting similar errors now
npm i discord-api-types@0.27.0
Seems to work
True
But this is not the latest?
but it is the one d.js is using currently, even though there shouldn't be any breaking changes in a patch
Alright. Ill use this one for now i guess.
Thanks for tagging me @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
Is it a popular issue that the SelectMenuComponent doesn't work correctly?
which error?
Did you pass nothing to addComponents or something
this happened when we called SelectMenuComponent
but it has been fixed
make sure your djs dev version is up-to-date
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]})
Colors should now be numbers
Fields should be objects
Read the guide
Can u provide link? I'm seeing on pings but maybe i'm wrong xD
Pins
ty :3
I'm looking into website for messageDelete and i can't see anything at respect, are to be added or something?
Not sure what you mean
messageDelete hasnt changed
action_type[NUMBER_TYPE_COERCE]: Value "MESSAGE_DELETE" is not int.
I'm using: message.delete({timeout: 1})
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
Then, for delete a message, i must delete message.delete(1)?
Or how
message.delete(), timeout isnt required
Oh, ty 😄
The error is not from message.delete though, its from fetchAuditLogs
is there a color converter, I’ve always used hex codes
Or is that only for the default Colors?
Wait nvm
You can use hex literals, 0xFF0000
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
help, this error is occurring
what is that second screenshot of?
addOptions takes rest params, not an array
You'll need to spread it I think
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
? then how
Spread
You mean something like this?
just remove the array ._.
in .addOptions?
yes
ok
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 🙃
It is milestoned for the next feature release (13.7.0), if you want it immediately, use the PR: https://github.com/discordjs/discord.js/pull/7431
Ah, right.
I think the v13 and v14 PRs will be merged almost together as they're quite ready however
I passed in the SelectMenuComponent
.addComponents(<SelectMenuComponent>)
Can you show your code and your version
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
You misspelled Success
But it still doesn't work with ButtonStyle.Danger etc
what is the error?
show code
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'.```
is there a documentation page for v14?
pins

You probably are using a different discord-api-types version
Try to set the discord-api-types version in the package.json to "*" and then reinstall with npm i
It didn't change anything
where can i get djs at dev docs
pls send fast
pins
which channel
this one?
ohh ghanks
thanks
const row = new ActionRow()
.addComponents
(
new ButtonComponent().setLabel("Cancel").setStyle(ButtonStyle.Danger).setCustomId('permCancel')
)```
hi
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.
i found a solution, thank you though
Are Modals Out yet ?
in the discord.js@dev version ?
its not merged
Any ETA ?
ETA
we dont to that here
Nvm, I Hope it gets merged soon.
Can you provide me the PR link that would be merged.

#7023 in discordjs/discord.js by suneettipirneni opened <t:1637621711:R> (changes requested)
feat: Add Modals and Text Inputs
📥 npm i suneettipirneni/discord.js#feat/text-input-interactions
const rest = new REST({ version: '<Version>' }).setToken('token');
Should I use v9 or v10 of Rest API ? 🤔
are you aware of all the changes made in v10?
is there a v10 specific thing you need to use?
if not, use v9 for now
Not sure about v10 yet so Will use v9
exactly 👍
rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), { body: commands });
How can I change this to set the Application Commands Globally
these don't sound like v14 specific questions 
embed'
I got this when sending an embed
setColor takes a number now
read the guide
Yeah I know
And that's dumb as fuck
And how do you decide those numbers ?
binary or smth i forgot
I passed a number
Ah yes the 10 numbers, I don't want to convert hexadecimal every time I send an embed
well then make a function for it
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()
const { Util } = require('discord.js')?
yes
is there docs for this
i wanna see
Documentation suggestion for @oak raft:
Util
Contains various general-purpose utility methods.
thanx
For the field it requires a "APIEmbedField"
correct, it does
I found by myself, but thanks
also instead of instanceof CommandInteraction or ContextMenuCommandINteraction..
can't you just use <Interaction>.isCommand()?
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
no no, A CommandInteraction would mean it's a slashie of a context menu interaction
at least for now
isCommand() checks if its an application command
isContextMenuCommand() checks if its an application command and a context menu command
isContextMenuCommand() calls isCommand() internally
okay
that was confusing
the point is that context menu interactions and slashie interactions both extend command interaction
so isCommand checks both
so yes, just isCommand already handles context menus
you're confusing it with the old isCommand, now it checks both
isChatInput only checks for slashies
Oh okaayyy thanks
i thought that was the only way so i've done that since day one
thank god
^
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 ?
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
I can make a gist of modals if you want ?
Using discord.js
I see.
(not with the pull request)
How do we use setColor on embeds in V14?
number
Number ?
yes
Hexadecimal
Ok, thanks
What's the minimum NodeJS version required to use the dev version ?
Or is there any specific version that it focusses on
16.10
16.1 !?
Pins say 16.9
Though I have 17.5
throw er; // Unhandled 'error' event```
But I get this error
Is that the full stacktrace?
How can we make Modals?
by waiting for them to release
Because I saw people do it, and they told me it would be in V14
yes and v14 isn't released yet, still in development
Oh, okay
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
set emoji takes an object now an object containing id, name or animated properties
it doesn't take a string anymore
i guess you could use the util method to resolve the emoji here as well
Oh.
can you give me the docs link for it
Documentation suggestion for @dire rover:
(static) Util.resolvePartialEmoji() PRIVATE
Resolves a partial emoji object from an [EmojiIdentifierResolvable](<https://discord.js.org/#/docs/discord.js/main/typedef/EmojiIdentifierResolvable>), without checking a Client.
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 ?
wait it's private?
okay then just go with passing an object in that case @dire rover
no no i would still recommend just passing as an object
K I'll do that.
any answer to this ?
yes it did, it takes an embed object, the guide covers this i think
Hmm.
that's kinda wrong haha
addFields don't take arrays anymore, they take rest parameters
the guides are still a WIP
.addField("Name", `${object.displayName}`)
The node:events error refers to fields I use in the commands
The documentation says it takes an array
docs wrong
hmm.
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
if you have an array (for example because it's returned from another util function) spread it with ...
Wdym by rest parameters, Could you show an example ?
addFields(field1, field2, field3) multiple parameters
each field is {name: ..., value, inline}
hmm
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.
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
the plan is to apparently swap out zod entirely
but as this error says, you passed only one option to the select menu?
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()
could you show more of your code? including the followUp
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
i have no idea what you mean with it becoming an empty array, might be an issue with scopes
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
I get this error when trying to trigger a modal. Anyone know why? 😅 nvm <3
V14 or v13 modals?
Wrong project folder xd
Is there a list for all new permission names? https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html#permissionoverwritesmanager
I struggle with MANAGE_CHANNEL
ManageChannel is not correct
its ManageChannels 
why my bot doesnt read dms
partial types changed, read the docs
Aw i just ctrl+f and found this my bad
dev forces you to either use enums, numbers or the EnumResolver yourself, it won't accept strings anymore
DiscordAPIError[50035]: Invalid Form Body
type[NUMBER_TYPE_COERCE]: Value "GUILD_VOICE" is not int.
What should I use instead of GUILD_VOICE?
Is there a difference between the 2 channelTypes options?
you can import the ChannelType enum from d.js
no, the snake case one is so you can use builders iirc
Ok thanks!
How can I do that? 😅
Was just wondering if one is going to be deprecated
import { ChannelType } from 'discord-api-types/v9'
you can import it from d.js, it gets reexported
😅
Show code?
Breaking change for channel creation?
const channel = await member.guild.channels
.create(name, {
type: 'GuildVoice',
userLimit: limit,
permissionOverwrites: permissions,
parent: creatordb.categoryid,
})
ChannelType.GuildVoice
^^
strings are only allowed for bitfields
I wanna cry
but yeah its working. Thanks
just to clarify for me
a bitfield is a number that represents a specific value? ._.
BitFields are like permissions and flags
Why member.permissions undefined
member isn’t a GuildMember
Its
log it
member.permissions is a manager, no chance its undefined
Didn't know it was a manager
That's just the guild object
Oh wait
What
i lied, its not a manager
It's a getter so it won't appear in there btw
it wont be undefined anyway
Show code?
This is dev, not stable btw
and intents?
lol
yes
that’s all?
i beated my bad england
What
Permissons
Permissions
Yes, you made a typo
Just couldn't understand that sentence lol
@tame gazelle just search for bitfield on the docs and open the search page, youll see all the classes that contain bitfields
Would it be possible to add options to interaction.getChannel('name', true) to specify the type of channel that will be returned?
No because the information can't be 100% guaranteed compile-time. You'll either need to cast or use a typeguard to narrow
Alright, thanks.
i mean, it could have a type option for you to pass the channel type, but you could just check that yourself ig
that just means the library will cast the result to T better to be explicit about it on your end
i meant an actual parameter, and the lib could validate the channel type at runtime
the enum is called AuditLogEvent
and the resolver is EnumResolvers.resolveAuditLogEvent
though it seems the enum is not reexported from d.js
is this a djs 14 thing???
thats a new discord thing
how the-
yep
what? how do you get that
try joining a new server
any server?
yep
do they have to enable that?
no
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
How would I be able to make users do that every time?
please....
bro I'm legit dumbfounded
Ask ddevs #useful-servers
This isn't fjs
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
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
it's good in the future to fight against raids, when for example too many people join a server at once, for the "moderation" tab of the server
will see what discord does with it
I always wondered how many developers were behind discord lol
sometimes i think its 6, maybe even 7 but then a lot of support personnel
So little ? I don't think so 😮
🤣
I was thinking of hundreds of developers lol
thousands
after that it's different the developers for the discord api, and the developers who work for discord in general I think well
probably
You greatly underestimate how enterprise development works
Hundreds or thousands of developers would be a nightmare to coordinate
millions
Realistically theres probably a number of small teams dedicated to different parts
Teams under 10
that's probably right. probably a team just for android mobile
Small teams for everything
Found out selectmenu#collector was not working because componentType, why?
as any of the types, not a string anymore
Oh, i get it
What's it called
Discord.SelectMenuType?
ComponentType.SelectMenu
Alright, thanks
<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' })
.addField() takes an object now
Is the
<Webhook>.deleteMessage()
method removed in this version? If yes what to use now instead of that method?
It is not removed
I don't get the option tho
Cannot reproduce
Webhook code hasn't been touched for a month or two. I believe you are doing something incorrectly
you cant just.... declare a variable as a webhookclient
and it actually is one
Thats undefined
Im so confused
Is re-installing the dev version going to work?
That shouldnt work lol
I get some options on v13, but none on v14
The webhook.delete function is also gone
it's an example
this is telling ts there is a const called a that has that type
this is purely to demonstrate typings
Show where r u defining the webhook
How do you set Emoji to a button in v14, as People are saying it takes an object now
exactly how people are saying it yes
an object that has a name, id or animated property
If it's an object then {name,id, animated}
hmm
U can use Util.parseEmoji
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?
issues: [
{
code: 'invalid_type',
expected: 'string',
received: 'null',
path: [ 'id' ],
message: 'Expected string, received null'
}
],```
```js
.setEmoji(Util.parseEmoji(`923978918048985128`))```
What is wrong ? 🤔
This is not how Util.parseemoji works. It'll make the id as emoji name u can pass {id:id} instead
I am getting all the autocomplates other than delete, deleteMessage and some others
When you actually run your code, does it work?
Im using typescript it doesnt let me run my code
hmm
But you can o,o
wait wait um
@uncut kelp wait yeah it runs the code
It runs the code but this error needs to be fixed
If you compile again, can you screenshot it
Restart your ide
As it's working fine when compiling
It just works fine, and I tested it deleted the msg
Aight
Then the issue is with your IDE and not discord.js
The same thing after restart
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
ok
I tested everything
still the same
I'm gonna ask another person and see if they have the same problem
Response: Internal Server Error
Not sure why'd this come
that is very little information to even start guessing
I can guess tho:
Discord was dying, thats why 
Hey, Were collectors changed ?
My buttons no longer seems to work
Well, I assume the componentType takes an enum value now, or is at least PascalCase
can you provide me the docs link for the same ?
Sorry, but the docs don't link to the api types yet, so no idea where to find it
Np.
Hi! Does anyone have the list of permissions in V14?
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 ?
Determining your discord.js version:
• npm list discord.js
• Make sure you use the right documentation for your installed verison (selector on the left)
Wasn't expecting this
78aa36f in discordjs/discord.js by ImRodry committed <t:1645361176:R>
fix(invite): add back channelId property (#7501)
well, i mean, the obvious fix is to use iso instead
Hmm, So Date.now was removed ?
? that's core js, what do you mean
Wait nothing...
No
what even is that
unsafe embed, embed, raw embed data
if you use objects you have to provide iso-strings, builders still accept the timestamp and convert it internally
embed
an Embed instance imported from djs?
How can this fits with the new djs builders
i had the same bug and i fixed converting Date.now() to new Date().toISOString()
/.../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
}
this makes no sense, i'd imagine it wants to use client.users
is this modified or is it just the internal code?
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
time to see who to git blame
making a pr
internal, still in djs AT dev
?
is this on stable too?
not sure, let me check tho
shouldn't be, seems like an oversight from the rest pr
ah
#7537 in discordjs/discord.js by BenjammingKirby opened <t:1645632749:R> (review required)
feat(guild): fix typo accessing user instead of users
📥 npm i BenjammingKirby/discord.js#patch-1
not a feature
defo bug
"feat(guild)"
i did it on phone, let me fix that
Will v14 have support for Interaction POSTs?
Wdym?
he means http based bots (im pretty sure)
probably going to be another package if discordjs makes anything
There's already /rest
You can easily use client.rest actually
Though there shouldn't be any reason to
n o
interaction posts
is discord sending you a post request everytime there is an interaction
instead of connecting to the gateway
Ohh I see what you mean
Receiving interactions via "webhook" instead of websocket
i have a bot like that
it doesnt have a status
This isn't actually supported and I think it's very difficult to apply to a library like discord.js
its actually not that hard to do that
Well, whole djs is based on a websocket gateway
yeah
but there is a tutorial for javascript on discord developer docs
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
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
also getting guild count and stuff is also harder
and its mostly not good for bots unless they just send messages
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
(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?
yes it's internal
do you think modals are almost done
We have no etas no clue
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
v14 replaces strings with enums/numbers
And do you know how I can fix this error?
I think it'll be ApplicationCommandPermissionType.Role
I don't use "ROLE" in my command
You clearly do
Value "ROLE" is not int.
On line 52 of Commands.js
Commands.js is my handler
Well thats where the error came from
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
}
then its not from that one
I will send my handler
Dude just go look for wherever you set a role type permission with the world ROLE
And stop sending unrelated code
No, i don't have this
Just search for "ROLE" in your project actually lol
You're arguing with your own error message
Dont waste my time
Twerk
Hey guys, is it still possible to get png format avatar URLs using member.user.avatarURL()?
Thanks
Yes there is a format property in options for the exact method
User#displayAvatarURL()
A link to the user's avatar if they have one. Otherwise a link to their default avatar will be returned.
When I use format: 'png' I still receive a webp format image.
Oh wait now it's extension
Not format
Ah ok, thanks for your prompt assistance.
<@&839912195994812420>
@knotty plover
i am using this cmd to leave fake guilds but not comming
And you have pinged me for this why?
by ds,js version is v13
ha pls tell the cmd
Please read the server rules
Can anyone provide a guide to discord.js v14?
literally 
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 ?
Maybe the bot doesn't have access
Did you invite bot with application.commands scope in that guild
Yes I did.
Error says the opposite
kick your bot and invite it again with all scopes (bot and application.commands)
Make sure the guildId is correct
Kicking is not necessary for adding a scope.
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.
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
Let me confirm.
The error already did 
Just reinvite the bot with the correct scopes
Was not about reinviting, One of my admins kicked the bot from the guild I was registering the slash commands to.
How i'm supposed to declare guilds?
So it didn't have access to the guild
It should be part of GatewayIntentBits
what even is the error?
Looks like it is my ide
Colors is an integer value now right?
I never used colors before, i used hex as an string
You can use hex literals then, e.g. 0xFFFFFF
You mean like this?
Yep
Thanks
.setColor("#FF0000") dosent work?
No, it must be a number or rgb array now.
You can use Util.resolveColor to maintain the old behavior, although for literals like that, you can just use hex literals.
https://discord.js.org/#/docs/discord.js/stable/class/Util?scrollTo=s-resolveColor
okay ty
Is there this page but for embeds? https://discordjs.guide/popular-topics/embeds.html#embed-preview
for v14? not yet
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?
not at all, each field has a name and value property (not text)
and you can't pass an array to them, they expect strings
setFooter({ text: 'footer text' })
This is what i already had
but
.setFooter({text: `${moment(date.now).format("DD/MM/YYYY hh:mm:ss")}`})```
npm ls discord.js or yarn why discord.js
okay?
cannot replicate your issue
Maybe ide being dum
webstorm dosen't like new versions of discord.js
i wouldn't blame the ide if you're using javascript (instead of typescript)
nah it's some webstorm type checking stuff, try restarting the server if that's an option
server? i'm coding this locally
What do you mean by restarting the server
restart the ts server
just restart the ide
Didn't work at all
anyways if it works it works
gotta stick to that
or maybe start using vscode?
wait how'd you define Embed? are you getting it from builders or djs?
const { Embed } = require("discord.js");
can't replicate on webstorm either
oof
maybe because this?
I someday deleted a discord.js thing that was created here and intelisense started responding
Hey! Is there a guide for modals?
not yet
it didn't even get merged on djs yet
👍Ok 👍
Hi! Have collectors changed in V14?
Why
Because they don't work now
Okay
Perhaps it would be better to ask a question where people can help you
Hey im using monbrey/discord.js#modals, how do i create modals?
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
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
ComponentType.Button instead of the string
read the guide pinned on this channel
Ok, thank you!
i found a handy function so im ok, other than, i need to know if there is a component that only accepts channels
i will just use a select menu
Documentation suggestion from @icy dew:
GuildMember#roles
A manager for the roles belonging to this member
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
2 also possible
Avoid magic numbers
i like these
But they’re not readable
Most people don’t know what 2 means when they see it code
1 - action row 2 - button 3 - select menu 4 - text input
iremember
Most
k
can you send a example of 4
in modals
huh?
Oh wrong one
just asking, we can't use json objects & magic numbers for modals until it's supported right?
Wdym json objects are supported and modals aren’t out yet
ye ik, i meant as in djs won't parse json objects for modals even if we use objects right?
Yeah not until the modal PR is merged
alright, thanks
await i.resetTimer() not a function... help
i is not the collector, use .resetTimer() on the collector
Ohh, I get it, thought this was djs v14 problem
When will modals come out?
When theyre ready
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?
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)
Okay, cool, I figured that kind of update was one that could wait a little while but didn't hurt to be sure.
the only thing that can't really wait is <v13 switches, because those are going to be decommissioned soon'ish
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)
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.
Yeah you'll need to download, install and then link the installation to your project
However how you'll do it isn't djs, this is a pr and technically isn't djs yet, wait for it to get merged, that's the best option
does djs v14 uses api v10?
it will iirc (or actually does)
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]})
if it dosent use v10 then it dosent make sense to update to v14
embeds not embed
due date is april before that we need to shift to v10
v14 was in dev before the dapi announcement
still not sending
show now
What do you mean?
hm ig devs will recode it in v10..
I can send the whole module code
isnt it " new MessageEmbed() "?
v14
const Help = new Embeds()```
damn they changed it too
ah no not that
channel.send({ embeds: [embed] })
Still not sending like that
show your code now
whats the error in the console?
There is none
it ignores the existance of it
.
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?
nope
still works
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.
That should work as expected
It ignores the thing as it didn't exist
maybe something related to the intents?
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
}
}
}
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
const bot = new Client({intents:[]})```
Intents Is Array (Intent List)
Thanks a lot
Will Node.JS v16.9 be required on release of v14?
for now, that is the minimum version yes
Ah minimum 😅 that works haha
Was making sure it wasn't version specific
As I run some stuff requiring 16.13+
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
I'm just hoping modals gets pushed into v14
Oh sweet, thank ya much 😅
is fetchWebhook function changed/removed ?
please be a bit more verbose
if you get errors, provide errors and code, explain what doesn't work, etc.
already answered

w.. am i blind?
ah, crossposting, nice
both 
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
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(),
})
})
)
),
];
wrong
addOptions doesn't take in an array, it takes a rest parameter
true, now it should go
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
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.
ohhhh
Shouldn’t .isRepliaple also check whether it’s replied to
hey discord.js@\dev doesn't have Partials in export
||oof it pinged someone||
it does
Turns out there was some error with vsc not reading types correctly. It needed a reload
idk what's wrong with components
setComponents doesn't take an array
What does it take ?
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!
What do you recommend to use instead ?
Or spread
Spread ?
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
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.
but you don't need spread, just use separate arguments
mmmh
Something changed there too
ButtonStyle.Secondary
read the guide!~
emoji: { name: '<insert emote here>' }
also i'd much rather use the builder methods than passing these at once in the constructor
I forgot that using discord.js@dev is going to be so different from using the stable version
who would have thonked
Im gonna code the bot twice I guess
One in stable and one in dev
What's wrong with the customId
pretty sure you have to use snakecase when passing things directly in the constructor
??
custom_id ig
Oh
Shouldn’t need to if it’s djs
Are you using builders from djs?
if not that then they're doing something wrong
ButtonComponent is at the right place ?
Oh yeah that’s ur issue import the components from djs not builders
why does builders not accept camelcase on the constructor, it uses camelcase on the getters
Idiomatic js classes always have camel case props. In builders the json data is always meant to be api data
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)
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
you dont have to install it? discord.js uses builders so it will be installed regardless
vscode even suggests builders before discord.js
What does that means ?
DiscordAPIError[40060]: Interaction has already been acknowledged.
you're replying/deferring the interaction more than once
Install it to use it as a dependency in your code
ok, but you dont have to install it manually, and to the uninformed user the auto import from vscode suggests it before discord.js as showcased in the screenshot
That happens to interaction.update
update is a reply
Ah
how would u get rid of the error?
don't reply more than once
but i want my embeds updated everytime a button is pressed ?
edit the reply
then use editReply method
can't reproduce without manually installing the seperate builders package
of course typescript wont allow it
the uninformed user will not be using typescript
but im not replying, im only editing the embed
^
just edit the message instead of using update()
e.g. interaction.message.edit()
and either way, if you were using typescript you wouldnt be able to pass camelcase stuff in the constructor anyway
The uninformed user will miss a lot of things besides using typescript. But we're not going to add camelcase constructors to base builders simply because it's built exclusively for API json not djs json
It's meant to be extended in this manner for different use cases
👍
Accepts a rest array not a regular array.
The documentation is being fixed soon
What ??
Rest Array ?
multiple parameters, a rest parameter
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.
Ah yes
This feature
I have the same problem here
I added ...
But there's the same problem
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
Is slash command option attachment supported in v14 ?
With your solution, there's only one element
not yet
that's not what i told you to do
for each of the options, you'd make a new SelectMenuOption
did you try updating and trying though?
Should’ve been fixed
support for objects in options was merged over a weak ago
weak week
then update and try as i've told you already 🙃
I think I have to update djs
That is not fixed
It is, you need to update djs
Already updated
What did you do to update it
npm i discord.js@digital dust
lol
Am I done something wrong ?
as a side note: the regular SelectMenuComponent#addOptions() isn't being validated on runtime 
@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
Found a fix
yes, that's what ben told you to do
but that shouldn't be required anymore
if it's fixed, just update djs
I got this idea before Bwen told me to
okay that's irrelevant but did you actually update and try?
Yeah already tried
now that's an issue then
could it be some npm cache stuff?
try uninstalling, cleaning cache, and then reinstalling
How to clean cache ?
i forgor what it was exactly, but you can google it, it should be a simple command
npm cache clean --force
Found with duckduckgo 😎
Same error @urban belfry
cannot replicate your issue
this works on latest @dev
I love your color scheme btw
do this
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)
What is your color scheme ?
do you have builders installed?
Yes
if so try updating that too
i couldnt replicate your issue with 0.13.0-dev.1645142857.f7257f0
the color scheme is one dark pro
Okay
which sharding is good for discord music bots ?
iam using discord hybrid sharding but its bad
I updated discordjs/builders
and that works
0.13 ???
discordjs/builders@dev
that's the latest builders @dev
doesn't sound like a discord.js thing
yehh iam just asking
bcs no one is online
probably this when it comes out https://github.com/discordjs/discord.js/pull/7204
are you talking about it not validating the length?
validating anything at all, the safe version doesn't override the unsafe method
well originally my idea was that SelectMenuOption would be validated and passed in, but I see the issue now
setOptions() isnt being validated either
is there a guide to use modals?
Since modals are not even merged yet, no, there is not
The only thing available is the pr description.
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?
RichEmbed was like 2, 2 and a half years ago
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.
Ik thats just an exampel
I mean all I can really say is that we do always have a reason for it
since they things keep changing left and right. and i use buttons and embeds alot
Think smart
If you do use them a lot
You can search and replace
i know. still a pain tho
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
How?
It's a matter of 10 seconds
But now we're refactoring them all to a new, still consistent approach
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
Oh yeah isn't MessageAttachment turning into attachment?
Yeah we're also doing a 13.7 release
Ayo if I move over to main branch (yes I understand the risks) will I be able to use text input components?
Not yet
Damn, so no version of djs supports text input at all?
No because none of the PR’s have been merged yet
Kk, thank you
does the dev version support the new interaction models?
Not yet + check #769862166131245066 + check pins
+ you could've scrolled a bit
👀
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
did modals release :/
no, see #769862166131245066
are modals available in the dev version of djs?
look one message above
oh okay sry
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
setStyle still exists
it's just that now it uses the enum
ButtonStyle.Link would be passed to the method
ah, gotcha
and support for custom icons is still not available for discord's api, yeah?
custom icons? like custom emojis on buttons?
yeah you can
so its from a dedicated method, I was trying to inject it's id tag as the string
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
ah, kk
@obtuse summit ComponentType.SelectMenu
they all now use enums
read the guide
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) => {});
Why not i.update instead of event.editReply, iiuc
thanks, didn't catch the second one
Which discord-api-types package version does the dev version require?
currently 0.27.0 it seems
im making a embed and i get this
show the code that is causing the issue
why do we need to set the privacyLevel if GuildOnly is the only value that we have to set?
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.
you dont have to set it? its optional when creating
the doc disagree but I will try without
?
without put the option*
its clearly labeled as optional
https://discord.js.org/#/docs/discord.js/main/typedef/StageInstanceCreateOptions
ah I was talking about GuildScheduledEventCreateOptions
@forest elm :>
oh
its not optional on discords end either, idk
https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
setColor(0x2F3136)
tf?
It seems to only be the problem with the ChannelType from the discord-api-types package
is it possible to make the default value GuildOnly internal?
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
is it possible? yes
do they want to? 
will .setColor(#ff0000) work?
nope, 0xff0000
I wanna make a PR but :
- I don't know how to use GitHub
- I don't understand how the d.js code works ._.
.setColor(0xff0000) should
Might be due to stage events or something related to discovery
there used to be 2 options, but now theres only one
then that explains it as stage discovery is no more
why they bully
?
why discordjs bully us
what?
There's a difference between hexadecimal value and a string with hex digits
nvm
good idea
All of the changes have a reason you can look up in the pinned messages to find out why
oof
because if you passed a hex string discord.js would have to parse it into a number
I would make an issue ticket for this and see what the others say
thanks 
Hello, how can I extend a class?
There was Structures.extend in v12, is it possible now?
Nah
Isn't there anyway, or just for Structures.extend
anyone know why it doesn't add components?
No
It looks fine
Log the row before sending
it doesn't log it ._.
What
I thought you meant like it only sent the embeds
it does that
but like, I add a log before sending and the row doens't being logged
This makes zero sense
Is it saved
I've saved and restarted
Woth it being this vague it could be anything
there you go then, has your question been answered
It reaches this point
But it doesn't? 🤨
ahhhhh I get why
the wrong file is being executed I have to add a filter while setting commands to the collection
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 😔
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)
Yep I did that
will embed.spliceFields(1, 1) remove the second field?
Try it?
cannot try if I don't know if it does that ._.
Idk why but this returns undefined
In args[0] there's an message ID that is VALID
Tag suggestion for @regal mason:
Resources to understand Promise:
• MDN: learn more
• Guide: learn more
• JavaScript info: learn more
I don't think this will help me
This promise is awaited
(await promise). property
if it's what you wanted me to understand
if someone send something it's not for wasting your time
it's for help you
You're awaiting the (Promise.property)
Not awaiting the promise then getting the property
is there any way to create a toggle button for interactions?
what
I'm trying to create a 'self assigned roles' menu
with v14
do you mean a switch button on/off
potentially, I'm just not sure if I can use a collector multiple times to catch multiple edits
you can
collectors keep collecting until you stop them
interesting, good to know
How can i install it?
Discord.js v14?
Please read the pins
I saw
Will it be slash commands only?
No
Yay
Also are they some docs?
You should be upgrading to slash commands anyways
Read the pins please
Yep but it can have up too 50 comamnds
You can have 200 slash commands in total
100*
Oh
100 guild commands and 100 global
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
Subcommands can also help
why enums?
because OOP
ApplicationCommandOptionType
The type of an [ApplicationCommandOption](<https://discord.js.org/#/docs/discord.js/stable/typedef/ApplicationCommandOption>) object: (more...)
ClientUser (extends User)
Represents the logged in client's Discord user.
Hi! Does anyone have the list of events in V14?
Documentation suggestion for @weak ridge:
Client (extends BaseClient)
The main hub for interacting with the Discord API, and the starting point for any bot.
adding to that you may find more on client.rest
Thank you, but is there a variable in Discord.JS to have all the events?
like a list of all of them?
Yes
no there isn't, you listen to the specific one
Ok
Is there still the webhookUpdate event in V14?