#djs-in-dev-version
1 messages · Page 19 of 1
yes, that would explain why you get builders in received data
also in the typings file, it says they have to fix that type (ModalSubmitInteraction.components)
How do you update to v14
pins
And is there docs or anything for it yet?
pins
I dont see the changes
then you must look closer, there is a big ass guide preview pinned
Why do you got to be so hasty
if we would explain that to everyone who asks, we would not be able to do anything else
what happened to
Embed.setDescription()```
EmbedBuilder
hello for some reason message content is empty
Again, MessageContent
oh
which you need to import from discord-api-types but v10 instead of v9
alr ty
does anyone know what would be cuasing this problem?
this.components = data.data.components?.map(c => createComponent(c)) ?? [];
^
TypeError: createComponent is not a function
thats a known problem and the pr is still open
wdym pr
pull request on github
pull request
when the pr is merged
when it is is the best response we got
so it has been fixed just not merged yet?
it isn't really "fixed", it just has an open solution
oh ok
Is there any reason why my component only has these two attributes?
a component. From that screenshot, there is no information to narrow anything down
async execute(interaction: ButtonInteraction): Promise<void> {
if (!interaction.client.user || !interaction.client.application || !interaction.guild || !interaction.channel) {
return;
}
// Does not show label property but logs the following:
console.log(interaction.message.components[0].components[0]);
},
{
custom_id: "upvote|2",
emoji: { id: "959512287130042418", name: "24" },
label: "0",
style: 1,
type: 2
}
It doesn't know that the component is a SelectMenu ig
how woudl i get all vcs my bot is in?
``` throw new Error(Found unknown component type: ${data.type});
^
Error: Found unknown component type: 4```
That suggests you're not actually on the dev release because it's erroring on a text input
Why is message.content a empty string
Most likely bc you didn't enable the MessageContent intent in the code
Is it possible to get all members of a guild? AFAIK, with WS you can .members.fetch(). How is this done with REST? Is REST limited to 1,000 at a time?
<:_:874569335308431382> GuildMemberManager#list()
Lists up to 1000 members of the guild.
@fallow steppe
I don’t know the number
The number you used doesn't include the MessageContent intent
It's why prefer to just the enums instead of magic literals
Aw. Was hoping to not have to do it 1K at a time. Lots of the servers I'm in are a couple hundred K each server.
I run a very large scam list (it's a gaming bot) that periodically scans an entire members list and compares it to the scam list to notify the admins
IDK if this is the best approach, but made a recursive function for it. 🤷
async function getGuildMembersAll(
guildId: Snowflake,
after?: Snowflake,
): Promise<RESTGetAPIGuildMembersResult> {
const apiGuildMembers = await rest.get(
Routes.guildMembers(guildId),
{
query: new URLSearchParams({
...after !== undefined ? { after } : {},
limit: '1000',
}),
},
) as RESTGetAPIGuildMembersResult;
return apiGuildMembers.length === 1_000
? [
...apiGuildMembers,
...await getGuildMembersAll(guildId, apiGuildMembers.at(-1)!.user!.id),
]
: apiGuildMembers;
}
use ws if you want more than 1000, or if in djs manager GuildMemberManager#fetch()
Unfortunately, with the size of my bots and their general purpose - responding to slash commands/context menus with dynamic images - using DJS' WS is just a waste of resources — even after all of the custom cache features.
Since switching to Fastify/HTTPS interactions only, and using REST, I can now nicely serve a couple hundred K servers with less RAM and resources than my laptop is using RN for the Discord client - currently a small 96MB RAM, for example.
This is the only situation thus far where WS would be beneficial.
I have to like, hugely disagree there
If one of its jobs is scanning an entire member list that's far better served with caching and gateway, not http interactions
Monitor guildMemberAdd and you don't even have to fetch and scan periodically
In previous version we can fetch the message and get it's embed then only edit certain part of the embed but it's not possible in dev version
Do i really need to recreate whole embed again
you can recreate the embed using the data of the API embed
with whatever changes you need to make to it
in ImageUrlOptions dynamic: true is not working
while the interface has dynamic
extension and size is working just fine
It's dynamic by default now
Enable forceStatic to override this
Idk, looking at old code?
Or prob looking at the wrong rest package version
yeah i think i need to restart my IDE
We recently acquired another company who’s bot does this. We’re just trying to merge their functionality (which uses WS) with our bot (which uses HTTPS) then and discontinuing theirs.
The member’s list check will likely happen once or twice daily. That feature being the only one where the gateway is beneficial, it’s not really worth the added costs.
Yep, attach the video
ohh thx
Hello,
I have a error,
const { Client, Intents, MessageEmbed, MessageActionRow, MessageSelectMenu, MessageButton, MessageAttachment } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_VOICE_STATES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS] });
const client = new Client({ intents: [Intents.Flags.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_VOICE_STATES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS] });
^
TypeError: Cannot read properties of undefined (reading 'Flags')
IntentsBitfield
?
Intents => IntentsBitfield
Like that ?
const { Client, IntentsBitfield, MessageEmbed, MessageActionRow, MessageSelectMenu, MessageButton, MessageAttachment } = require('discord.js');
const client = new Client({ intents: [IntentsBitfield.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_VOICE_STATES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS] });
ofc you have to change all occurrences of Intents to IntentsBitfield
const client = new Client({ intents: [IntentsBitfield.FLAGS.GUILDS, IntentsBitfield.FLAGS.GUILD_MESSAGES, IntentsBitfield.FLAGS.GUILD_MEMBERS, IntentsBitfield.FLAGS.GUILD_VOICE_STATES, IntentsBitfield.FLAGS.GUILD_MESSAGE_REACTIONS] });
^
TypeError: Cannot read properties of undefined (reading 'FLAGS')
IntentsBitField
sorry
Ok ok
But I have a new error kek
const client = new Client({ intents: [IntentsBitField.FLAGS.GUILDS, IntentsBitField.FLAGS.GUILD_MESSAGES, IntentsBitField.FLAGS.GUILD_MEMBERS, IntentsBitField.FLAGS.GUILD_VOICE_STATES, IntentsBitField.FLAGS.GUILD_MESSAGE_REACTIONS] });
^
TypeError: Cannot read properties of undefined (reading 'GUILDS'
<:_:874573879153160212> (static) IntentsBitField.Flags
Numeric WebSocket intents
You should really read the pins with the WIP guide. All references to SCREAMING_SNAKE_CASE strings have been changed to PascalCase and a lot of stuff now no longer takes strings
options: [
{
name: 'create',
description: "Create a custom slash command!",
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: "name",
description: "Name of the custom slash command",
type: 'STRING',
required: true,
},
{
name: "response",
description: "Response of the custom slash command",
type: 'STRING',
required: true,
}
],
},
],```
This is my slash command options structure. In `type: 'STRING',` what shud it be? `ApplicationCommandOptionType` only?
Yeah, enums only
What about magic number, cant we use them instead
You could but bad practice, that's why enums exist
No
trying typing it manually
Intellisense isnt documentation
yeah intelisense does that a lot to me, and then when i fully type it out then it starts working. its like it hasn't cached it or smth
You haven't typeguarded the interaction either
Just type it out
Yeah I did that but I thought it was removed so it isn't shown. Thanks
How its considered as bad practice btw?
Because magic numbers mean nothing to the developer in code. And if Discord ever changes the numbers (they probably wouldn't) it would break, but we can update the enum and you don't have to change your code
why is this change?? EnumResolvers.resolveButtonStyle('PRIMARY'); this is just bloating the code, long lines for no reason
or we need to include billion type exports just to get basic values
terrible
known bug
You can also just use the enum
There's nothing wrong with imports
"PRIMARY" is enum and clearly I cant use it
string representating enum
anyway the modals are broken? or I did something wrong
just import ButtonStyle
^
ah overlooked
No such thing. Just a normal string
there is no such thing as enum in js either its "just" an object
It serves the same purpose, replacing magic strings and numbers
strings are descriptive, its not magic string. anyway i wont argue with you. How can I set "RANDOM" embed color? Colors "enum" doesnt have Random || the worst, most annoying to use version so far||
😦 why there is no EmbedBuilder.addField(...) again making stuff complicated
because addFields can also take a single field
Two methods that can do the same thing is more complicated than one
yes but from one liner its 5-7 liner
.addFieldd([
{
name: 'Price',
value: `${price}`,
inline: true
}
])
.addField('Price', `${price}$`, true)
you can also write the first statement in one line. shorter code =/= better code
addFields also takes rest params, no need for the array brackets
But as you see its changed from djs v13 to v14 itself
Yes, we made that improvement to remove an issue from our previous version
Anybody knows why i get this issue?
0.options[0].type[NUMBER_TYPE_COERCE]: Value "STRING" is not int.
use enums
try it
i am, thats what i have set
OH, nvm. Its the options type not the command type
guys,i have the next code: ```js
client.on('messageCreate', async msg => {
if (msg.content.startsWith("!Hit ")) {
const mention = await msg.content.slice(5);
if (mention.startsWith('<@') && mention.endsWith('>')) {
const file = new MessageAttachment('./media/hit1.jpg');
const embed = new MessageEmbed()
.setTitle("Example")
.setImage('./media/hit1.jpg')
msg.reply({ embeds: [embed], files: [file] });
}
}
})``` the problem is that the message don't appear
i keep getting this error when sending a modal, anybody knows why? I can show code if necessary
How do you set emoji to a button? the zod errors are not helpful at all
I cant tell if your question is meant for me but if it is I do not set an emoji, its just a modal
setEmoji takes an object
no its my own question 🙂
yes but what object
actually the latest dev should support strings, show your code
const row = new ActionRowBuilder().addComponents(
new ButtonBuilder({
emoji: `:upvote:`,
style: Discord.ButtonStyle.Primary,
custom_id: 'suggest_upvote'
}),
new ButtonBuilder({
emoji: `:downvote:`,
style: Discord.ButtonStyle.Primary,
custom_id: 'suggest_downvote'
}),
new ButtonBuilder({
emoji: '📝',
style: Discord.ButtonStyle.Secondary,
custom_id: 'suggest_note'
})
)
this is what I have there, discord converts it back so its just :upvote:
gotta use the emoji id
if you want custom emojis for your components
npm ls discord.js
oh you're using the constructor, it doesn't support strings yet
Parse emoji is broken, in v13 it works by providing this. Util.parseEmoji doenst parse that string, only emoji ID...
got it to work, was some weird issue with the builder
it isnt broken, it doesnt parse strings when you pass them in the constructor
either wait for https://github.com/discordjs/discord.js/pull/7718 to be merged or use setEmoji() separately
actionRowBuilder.addComponents doenst work when passing an array of components, only when passing each component as separate parameter
correct
its a bug
it isnt
just use rest param
try .setEmoji({ id: 'id' })
you're probably using an old dev version
I installed it 3 hours ago
that works for custom emojis but how do I do it for build-in like '📝'
{ name: 'unicode emote' }
djs builders, tbh i dont know where I'm supposed to use it from anymore, its huge mess
the discord.js one supports strings in setEmoji()
I do think we need better guides on the changes and how to use them
Why I cant use message.embeds[0].setDescription(...) ?
let me guess because its not EmbedBuilder but just Embed?
everything was just poorly planned, and having the "reexported" builders behave differently than the ones from /builders is rather confusing
precisely
just construct a new EmbedBuilder
pretty much 1 line for you
will new EmbedBuilder(Embed) work?
no
but why? why it cant be EmbedBuilder already? or why is this one step required?
new EmbedBuilder(<Embed>.toJSON()) should work
and if I cant make this what am I supposed to do with the embed EmbedBuilder? copy one by one?
EmbedBuilder.from(embed)
because it contains api data that should not be mutated
like?
what
Immutability, which is good coding practice
Doing it this way modifies the one in the cache, instead of creating a new one
... which invalidates the cache as it doesnt represent the original message anymore
yes I'm aware of that, i wanted to update the same message tho so in the end it wouldnt matter but okay
in other cases it is good
like what api data
the whole message
we're talking about Embed class not Message
The embed is just part of the message API data
okay
so are the djs builders be part of djs? or do I still keep them? and do I use the ones from djs or djs builders package?
its kinda nonsense to have them duplicated, as I see ButtonBuilder in djs and djs builders but SlashCommandBuilder is only in djs builders
Hey guys, I've moved from a js to ts and I have a problem with sending a message lmao
What's wrong here?
(client.channels.cache.get('951933757768753152') as TextChannel).send('sadasd')
getting a TypeError: Cannot read properties of undefined (reading 'send') error
tried almost everything D:
bad ID?
nah, checked it
wrong id, trying to access it before ready/swept it manually, not in a server the bot is on
I think the intention was to have the ones re-exported from discord.js be the only ones you need, though I'm not sure about the command builders. I don't use them myself so idk
why? if you want to access channels you need to wait until the client has channels
the earliest is "ready", but you can use any event that emits after that as well, of course
hey, for some reason my bot's activity doesnt get set anymore, only the status does, the activity doesnt. Is this a common issue? I am using <client>.user.setPresence()
EmbedBuilder.from() does not exist in djs builders@ dev but it is in djs@ dev
How to fix?
addOptions doesn't take an array
.addOptions([])
remove []
that or just use rest operator
.addOptions({...}, {...})
thanks, worked
Its loaded 2
await rest.put(GUILD_ID ? Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID) : Routes.applicationCommands(CLIENT_ID), { body: slashCommands });
my code
you wanna use global or guild commands?
Global
await rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), { body: [] });
this will remove all guild commands
oh thanks
I have created a SelectMenu, but I want to do how to send a message. how will I do?
do what?
await the fetch
try just doing this:
const msg = await interaction.reply({ ..., fetchReply: true })
const collector = msg.createMessageComponentCollector(...)
DiscordAPIError[50006]: Cannot send an empty message
what?
im fixed
but not send embed
anybody?
oh, let me see
help :/
whats fetch, and show the options you used in the component collector
interaction.reply() after that it doesn't work.
worked! thanks :)
show the code
no prob
you arent sending any components at all
how
how what? you just arent. look at your interaction.reply()
interaction.reply({ ..., components: [...] })
return interaction.reply({ content: "Select a category!", components: [Row]})
I'm sending a command
thats not what you have in your screenshot
this is event
you're creating the collector on the reply you are sending on your screenshot
it has no components, so it wont collect anything
show the updated code
you tell me, whats happening?
i don't know
Hi again,
how to get an array of members connected to voice channels in the whole guild?
Here's the code that I was trying;
console.log(connected_members)```
<GuildMember>.voice is not nullable, that filter isnt doing anything
that doesnt work because Collection.filter() returns another collection, and collections dont have a members property
So, how can I logically do it correctly?
map the collection by channel.members and flat it
that will rely on cache, so you should fetch all the guild members before doing all of that as the other person suggested
data.components[1].components[0].options[0][MODEL_TYPE_CONVERT]: Only dictionaries may be used in a ModelType
any what does it mean i don't get it
type: 3,
placeholder: "Please select a page.",
custom_id: "help",
min_values: 1,
max_values: 1,
options: [categories.map((cmd) => {
return {
label: cmd.directory,
value: cmd.directory?.toLocaleLowerCase(),
//emoji: emojiObject[cmd.directory?.toLowerCase()] || null
}
})]
``` this is the component causing the error
like channels.members or loop all channels of the guild and execute it?
you are passing an array with another array as the options
but i am maping it :(
correct, and <Array>.map() returns the mapped array
so either remove the [] surrounding it or spread it
hmm so can't i just make a variable and do the same stuff then through the map i'll return the object and then assign the variable to it will that work?
no idea what you said
nvm anyways thanks for the help
just do this
any idea when this will be fixed? I wanna play with the modals
when https://github.com/discordjs/discord.js/pull/7649 is merged

Why does this pops up when I submit a modal?
@signal rampart its a bug, fixed in this pr
read the messages above
probably not there is createComponentBuilder but they didn't change it in ModealSubmitInteraction
pull request, the link i sent
oh
what
what about it, that was fixed in the pull request i linked
how for long the bug has been fixed?
the pull request wasnt merged, which means it technically hasnt been fixed yet
yea I haven't seen
yea
use an interaction collector
but how? do I do it on the channel? the message? or the interaction itself? I dont know how the modals work
the former doesnt exist and the latter does nvm
textinput?
modals arent components
if its just one text input, and the modal has several text inputs, it detects only whichever was written first or no?
it doesnt detect anything because modals arent components
you need to listen to the interactionCreate event and use the interaction.isModalSubmit() and get the fields using the fields resolver, interaction.fields
you can probably use an interactioncollector too ig
terrible, anyway what is textInput componentType for then?
TextInput is a ComponentType
according to this https://github.com/discordjs/discord.js/pull/7431#discussion_r807229741 there probably will be a interaction.awaitModalSubmit() in v14
you can either wait for somebody to pr it or just make a custom solution yourself
ModalSubmit is an interaction, you can just use an InteractionCollector to listen for the submit and take the text inputs from it
That’s what I do with a few commands in one of my projects I manage
Does v14 support nodev16?
how do you use it when its broken at the moment? the createComponent error
you only have to change a couple of lines in two files to get them working again
but the PR for the fix has already been reviewed and should get merged at some point in the coming days
I¨ve always had my config in json file, now I cant because it requires your enums, How can I still keep it in a json file?
cool, just did it myself. thx
you'd have to use magic numbers, which is not recommended
That or just convert your json files to TS/JS
What do I change these "magic strings" to?
with their respective enums
if it wasnt obvious I was asking how are the enum imports called
Please refer to guide in the pins for the changes in enum naming conventions
yes I did, I cant find it in the guide nor in the code. I thought it would be Permissions.ViewChannel or PermissionOverwrites.ViewChannel its neither, and no idea what would the type be
thus, I'm asking here
<:_:874573879153160212> (static) PermissionsBitField.Flags
Numeric permission flags.
Oh sorry I thought that was an option type
You can just use PermissionFlagBits.<Permission> directly
Based on your screenshot it would be PermissionFlagBits.ViewChannel
I meant OverwriteType (role or member) but I already found it
https://github.com/discordjs/discord.js/pull/7649 Ready to be merged!
I know I use nodev16 and I thought v14 only supports v17
not like its pinned
No it supports node v16.9 and above
Guys, when I select an option of Select Menu, it keeps selected. How do I "unselect" the option and set the placeholder back?
update the message with the same exact component
hum
I'm getting error here
const selectMenu = i.message.components[0]
i.update({ components:[selectMenu] })
i it's the Interaction
Error:
DiscordAPIError[50035]: Invalid Form Body
components[0].components[BASE_TYPE_REQUIRED]: This field is required
I think you need to rebuild it
Though if you're resending without any changes that should probably be supported
So, how can I detailed unselect the select menu?
I got it making this:
const row = i.message.components[0]
const selectMenu = row.components[0]
const newRow = new ActionRowBuilder()
.addComponents(new SelectMenuBuilder(selectMenu.data))
i.update({ components:[newRow] })
oh right, my bad
Yeah odd that its required though
they should just be resendable
hi, so I have a command handler + discordjs v13
just updated to v14, and switched partials to the Partials.Channel stuff and kept intents the same, intents: 32767,
the only command that exists right now is .ping
it seems that the bot doesn't log in anymore, or at least the bio of the bot doesn't change like normal
there are no errors
is there something else I should change?
I have read the documentation as well
32767 does not include the MessageContent intent
oh, is there something you would recommend then for all the intents?
yes, don't use all
Not using magic numbers so your intents are actually readable
Use the intents you actually need
alright, sounds good
i'll try that
anybody knows why i get this error when submitting to a modal
known bug
#7649 in discordjs/discord.js by ImRodry opened <t:1647136333:R> (approved)
types: fix regressions
📥 npm i ImRodry/discord.js#types/fix-regressions
oh, is there any way to fix it?
I've never done it without just using 32767, which ones am I supposed to use other than these,
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.Messages],
is Messages an intent?
GuildMessages or DirectMessages
ah, alright
alr
for that question I would wait 41 minutes 
ok so its fixed but not merged, welp
ok merged nice
wow it was that easy
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages],
partials: [Partials.Channel, Partials.Message, Partials.Reaction],
allowedMentions: {
repliedUser: false,
},```
so I have this now, but it doesn't log in, no errors though
client.on("debug", console.log)
it just did this-
so it is logged in
normally it looks like this
before I updated to v14, meaning in v13, it responded to a command, and it successfully changed it's bio in the ready event
message command?
yeah
You need the MessageContent intent, available from the dapi types v10
ah got it
client.user.setActivity({ name: `${client.config.prefix}help`, type: "PLAYING" });```
does this look right to you? it worked in v13, but it doesn't set the activity anymore
Documentation suggestion for @crystal valve:
<:_:874569310025179188> ActivityType
(more...)
that was actually an internal bug, what you tried should be possible with https://github.com/discordjs/discord.js/pull/7739
Are modals not finished yet for djs main yet?
Are they considered a component? and wouldn't it extend the Component class ?
they are not components
finished in the sense of you can send (and after the next dev release) receive them
afaik modal collectors will be added at some point too
okay cool, thank u
is it not a component because they dont appear in chat or something 🤔
No, because they just arent components at all
They're a type of Interaction response
I get how they appear similar since they have a builder etc, but Embeds arent components either
The TextInputs in the modal are components though just to be confusing, but they cant go in messages
ahh alright
that clears it up, thanks
Where do I see the permissions for discord.js v14
{
"code": "custom",
"message": "Input not instance of UnsafeSelectMenuOptionBuilder",
"path": []
}
]
at handleResult (/home/runner/v14/node_modules/zod/lib/types.js:28:23)
at ZodUnion.safeParse (/home/runner/v14/node_modules/zod/lib/types.js:141:16)
at ZodUnion.parse (/home/runner/v14/node_modules/zod/lib/types.js:120:29)
at /home/runner/v14/node_modules/@discordjs/builders/dist/index.js:843:159
at Array.map (<anonymous>)
at SelectMenuBuilder.addOptions (/home/runner/v14/node_modules/@discordjs/builders/dist/index.js:843:34)```
`const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, SelectMenuBuilder} = require("discord.js")` using this
```js
const row = new ActionRowBuilder()
.addComponents(
new SelectMenuBuilder()
.setCustomId('select')
.setPlaceholder('Backpack')
.addOptions([
{
label: 'Fishes',
description: '',
value: '0',
},
{
label: 'Animals',
description: 'This is also a description',
value: '1',
},
{
label: 'Potions',
description: 'This is also a description',
value: '2',
},
{
label: 'Craftable',
description: 'This is also a description',
value: '3',
},
{
label: 'Tools',
description: 'This is also a description',
value: '4',
},
]),
);```
same place as before, the Permissions docs
I dont think it takes an array, needs to be rest params
Docs need updating
In which part because I do not see them
oh alright
<:_:874573855715385394> PermissionsBitField (extends BitField)
Data structure that makes it easy to interact with a permission bitfield. All [GuildMember](<https://discord.js.org/#/docs/discord.js/main/class/GuildMember>)s have a set of permissions in their guild, and each channel in the guild may also have [PermissionOverwrites](<https://discord.js.org/#/docs/discord.js/main/class/PermissionOverwrites>) for the member that override their default permissions.
wait wdym by this
There are no names of permissions
Documentation suggestion for @crystal valve:
<:_:957801942573256854> 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.
yeah, I read it, but how does it relate to the SelectMenuBuilder
for options
you're passing an array to addOptions, and you must use rest parameters
It doesn’t take an array it takes an indefinite amount of arguments ie function(one, two, three) vs function([one, two, three])
don't pass an array, pass multiple arguments
if you have an array because that's just easier to handle for you, spread it
<:_:957801942573256854> 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.
ah
i heard this is releasing today, true?
what?
idk i seen somebody say release in 40m or something somewhere
.addOptions(
{
label: 'test',
description: '',
value: '0',
}
)```
so like this? instead of `.addOptions([`
function(one, two, three) vs function([one, two, three])
yes
@hasty gorge release what? i need some context to evaluate that
Where can I see the name of the permissions in discord.js v14?
Thanks
uh, just forget it, im prob dumb and didnt it hear correctly, anyways i saw somewhere that this dev version was releasing in 40m~1h30 i prob didnt understand
yes, there will be a new dev release in a bit
ah, the automated dev releases, yes, every 12h
midnight and 12PM UTC
fixes the modal issue? the createComponent
oh, okay, that explains it
it should, yes
can we stop the countdown though? thanks
is this v14?
pr 7649 merged?
#7649 in discordjs/discord.js by ImRodry merged <t:1649024384:R>
types: fix regressions
thank fucking god pull req 7649 was merged. my clients were getting very angry with me for delays.
k
Probably shouldnt be using an unstable version of the library for commercial work imo
well it works for it's fine 🤷
It literally didnt work hence why that merge was required
<ModalSubmitInteraction>.fields.getTextInputValue(customId)
it works! thanks 😄
There’s a guide that goes over this btw
link
Pins
oh i didn't see it there
hello guys
i have an issue in last djs 14 build
i have blank message content fields
i have all the intents enabled
1sec
well, maybe enabled, but you don't set it in client settings
but you don't set it in client settings

guess i'm bringing the pins to you then
Where did my message content go?
- Make sure you are granted the intent (Discord app dashboard toggle/verification request)
- Make sure you also set the intent in Client settings
MessageContent = 1 << 15(this was not needed on previous versions)
hey, is there a overview of all changes coming in v14 somewhere?
pins
Hey, im sending a reply to an interaction then making a component collector so when the user interacts it shows a modal, but when i submit the modal the collector isnt triggered
modals are not components, you have to use an InteractionCollector
oh, okay
so i make 2 collectors?
that or handle the modal / components in the interactionCreate event
i will make 2 collectors cause i dont want to do any handling in the event
you could also use an InteractionCollector for both components and modals
that works?
let me open docs one sec
sure, both are interactions
got it, thanks!
How to install v14?
npm i discord.js@dev
Ok
it takes a number or an rgb tuple
you can use Util.resolveColor() to convert a color string to a number.
Thanks
i know its just more work man, i will just update my colors file to be int so i dont repeat that util.resolvecolor
you can also use 0xff0000
i dont have the message content intent in the client settings but it still can see contents

iirc they're not enforcing it just yet, also you should see content if your bot is mentioned
ok 
idk i alr converted half 
What's the error?
this is a know issue iirc
A fix was merged. So installing new update should fix it
🆗
TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
at V.resolveRequest (C:\Users\jitup\Downloads\SussyRolex-main\SussyRolex-main\node_modules\@discordjs\rest\dist\index.js:7:3723)
at V.queueRequest (C:\Users\jitup\Downloads\SussyRolex-main\SussyRolex-main\node_modules\@discordjs\rest\dist\index.js:7:2608)
at Y.request (C:\Users\jitup\Downloads\SussyRolex-main\SussyRolex-main\node_modules\@discordjs\rest\dist\index.js:7:5494)
at Y.put (C:\Users\jitup\Downloads\SussyRolex-main\SussyRolex-main\node_modules\@discordjs\rest\dist\index.js:7:5346)
at C:\Users\jitup\Downloads\SussyRolex-main\SussyRolex-main\Src\Structures\Client\Client.js:113:28
at RolexBot.RegisterSlash (C:\Users\jitup\Downloads\SussyRolex-main\SussyRolex-main\Src\Structures\Client\Client.js:119:11)
at RolexBot.RegisterRolex (C:\Users\jitup\Downloads\SussyRolex-main\SussyRolex-main\Src\Structures\Client\Client.js:102:22)
at new RolexBot (C:\Users\jitup\Downloads\SussyRolex-main\SussyRolex-main\Src\Structures\Client\Client.js:49:14)
at Object.<anonymous> (C:\Users\jitup\Downloads\SussyRolex-main\SussyRolex-main\index.js:6:15)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
``` any idea why its happening? i am using a property for my application commands named userPermissions which has the flags and if the GuildMember#permissions.has(FLAG) then i just pass in the cmd but it seems to give me a error i am not sure why
```js
userPermissions: [PermissionsBitField.Flags.SendMessages]
this is how it looks like
does userUpdate fire on banner change? And if so does the old banner exist on the oldUser
It doesn’t
sadge, ty
hi can anyone help me on how to make response of a form with checkboxes to be saved in a json file and then use that json file to create a graph
how is that related to djs at all
the ModalSubmitInteraction#components type is wrong?
wat
the typings for ModalSubmitInteraction#components is incorrect...
it should be an array still
actually, it says TODO fix this type
The array shows ActionRows so the type should be ActionRow[]
Pretty sure there’s a pr to fix that
https://cdn.waya.one/1649089429.png
https://cdn.waya.one/1649089444.png
What am I doing wrong here?
oh
also is it dev "stable" to use for bots (aka what are chances for crashing)
see the lower part of pins
your question for a chance isn't all that realistic. it's an automated 12h release, so if someone messed something up reviews didn't catch, it's bugged
Caught
DiscordAPIError[20001]: Bots cannot use this endpoint
at SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:488:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:201:11)
at async ApplicationCommandPermissionsManager.set (/home/container/node_modules/discord.js/src/managers/ApplicationCommandPermissionsManager.js:165:20) {
rawError: { message: 'Bots cannot use this endpoint', code: 20001 },
code: 20001,
status: 403,
method: 'put',
url: 'https://discord.com/api/v10/applications/598475048952659978/guilds/563287374784888852/commands/952306523005136916/permissions',
requestBody: { files: undefined, json: { permissions: [Array] } }
}
While trying to edit application command permission
what is the relase of v14?
14.0.0-dev.1648515273-ac4bc3a
const { OverwriteType } = require("discord-api-types");
permissionOverwrites: [
{ id: this.user.id, allow: PermissionFlagsBits.ViewChannel, type: OverwriteType.Member },
{ id: config.modRoleID, allow: PermissionFlagsBits.ViewChannel, type: OverwriteType.Role },
{ id: config.guildID, deny: PermissionFlagsBits.ViewChannel, type: OverwriteType.Role }
]
how else am I get the enum? its not exported from discord.js
collector = new InteractionCollector(bot, { channel: interaction.channel, guild: interaction.guild, interactionType: InteractionType.ModalSubmit })
discord-api-types/v10
npm i discord-api-types@latest
then just add filter property to the object?
you can just omit the max option, hold a counter yourself and once you count your descired amount of interactions, stop the collector if the filter property doesnt work for oyu
embedbuilder#addFields doesnt accept array, please make it accept array as well as parameters
We're moving away from arrays as it stands
Well we would have to check that for all arguments
no just first
Originally, Array.flat was used, so you could put arrays in multiple params
You can open a discussion abt it if you want to, but it seems like we're not gonna support both either way
it's just one operator to spread the iterable into multiple arguments as well
still doesnt work
there is no User enum, only Member or Role
:/
its not implemented yet
you don't need to supply a type, when creating
it's just that one of your ids is not valid
Specifying the type shouldn't allow that error to occur tho
Normally, d.js requires the user/role to be cached for the type to be resolved, but specifying the type bypasses that
Log the typeof for each id
The only other way you get that error is if one of the ids aren't of type string
i'm betting on undefined 
undefined it was
also EmbedBuilder.setDescription('') throws error, it should just set the description to null as '' is falsy value but there'll be some reason to why this wont be done i bet
The behavior of builders is to give you the error if the input is invalid. It won't try to fix/resolve ur invalid input
how do I get the locale of a random user? (not only the user who executed the interaction)
You don't
in the DAPI doc it says that we can
you know if it will be possible in the future with d.js?
Where does it say that? A link is more useful than a screenshot with all context cropped away
You need the identify scope for that
Right, you see it says "required oauth2 scope" is "identify"
So it's only available via Oauth
I don't have the identify scope and I can get the ID using <User>#id ._.
Arguably, it also says that for id and username, which Discord def always provides
True lol
Not sure why Discord doesn't document oauth-only fields
Discord doesn't write their own docs half the time
so, not possible? ._.
Not w/o oauth
Is there an issue with resending components? The code below worked fine until i updated to the latest version
interaction.update({components: interaction.message.components})
I get the following error now
DiscordAPIError[50035]: Invalid Form Body
components[0].components[BASE_TYPE_REQUIRED]: This field is required
I think there's another PR pending to address that, they should be directly resendable
the awaitModalSubmit method
alternatively you can just wait for it to be added to v14
its in the interactionresponses file
It doesnt work like that
My one was written for v13, copying it into v14 might not even work
yeah you cant just copy paste it, but the fundamentals are still the same
you just have to use an InteractionCollector
const collector = new InteractionCollector({ max: 1, type: "Modal", time: 10000 }) // something like that, i forget exactly
const submit = await new Promise((resolve, reject) => {
collector.on("collect", resolve)
collector.on("end", (collected, reason) => {
if(reason !== "limit") reject(reason)
}
))```
Could just do something like that
client is the first parameter of the interactioncollector constructor
promisify te collector
Yeah thats why I said I forget how it works exactly
Its a rough example
Thats the basics of how any of the awaitThing methods work
They're just promises wrapped around collectors
The actual method is in structures/interfaces/InteractionResponses.js if you want to look I think
whats going on here, why is this giving errorconst row = new ActionRowBuilder().addComponents([ // create a discord button new ButtonBuilder() .setCustomId('Verification') .setLabel('Verify') .setEmoji(':white_check_mark:') .setStyle(ButtonStyle.Primary) ]);
what error is it giving
addComponents takes rest parameters, not an array
and you have to pass the unicode version of the emote in setEmoji, \✅
i think setEmoji takes an object
discord.js' accepts strings
ZodError: [
{
"code": "invalid_type",
"expected": "object",
"received": "string",
"path": [],
"message": "Expected object, received string"
}
Yeah, setEmoji is wanting an object
Nah it needs an object in latest builders
what would the object be??
you can just import it from discord.js instead
or pass { name: 'unicode emote' }
How this?
ohhh, okay, simple enough
the documentation didn't state it was an object which is why I was so lost
idk why it still wants an object it should accept strings after the PR
/builders only accepts objects
I pulled the latest dev installation a few hours ago
it does tho
const { ButtonBuilder } = require('discord.js/node_modules/@discordjs/builders'); is the one I have
it automatically did that for me LMAO
const { ButtonStyle, ActionRowBuilder, SelectMenuBuilder, EmbedBuilder, ButtonBuilder } = require('discord.js'); then?
yeah
components: [ActionRowBuilder.toJSON()] I think
interaction.reply({ content: "Test", components: [row] }) This is what I have
but it errors ofc
or, doesn't add the button rather
what error is it
Need the error to help
No no, it doesn't have an error
show the rest of the code, what are you defining row as
I lied, the error is component.toJSON is not a function
const row = new ActionRowBuilder().addComponents([
// create a discord button
new ButtonBuilder()
.setCustomId('Verification')
.setLabel('Verify')
.setEmoji({name: '✅'})
.setStyle(ButtonStyle.Primary)
]);
interaction.reply({ content: "Test", components: [row] })
.then(() => console.log(`${interaction.member.id}: (0) Verify; Verification sent`))
.catch(err => console.log(`${interaction.member.id}: (0) Verify; Verification failed` + err));```
remove [] from addComponents, it takes rest parameters and not an array
then why this
it says it's an array 
its wrong
¯_(ツ)_/¯
How to prevent this from happening?
DiscordAPIError[10062]: Unknown interaction
Is there a property that I can use for this?
u prevent it by replying within 3s. Not replying twice
deferring is not an excuse, all reply must be done within 3s, to be able to extend the interaction to 15m.. deferReply/deferUpdate, reply, update, respond, a modal submit.
d.interaction.showModal(new Discord.ModalBuilder().setTitle('hi').setCustomId("id").addComponents(new Discord.ActionRowBuilder().addComponents(new Discord.TextInputBuilder().setLabel("hi").setCustomId("hi").setStyle(2))))
d.interaction.reply("hi")
Something is wrong?
It does not tell me any error, simply when sending a response the bot crashes
whats the error
@copper jetty
I already installed the most current dev, it is assumed that pr 7649 is already merged
TS? Then you might wanna add the specific type to ActionRowBuilder. i.e. ActionRowBuilder<Discord.TextInputBuilder>
How do you wait for a modal response?
I'm trying this but its obviously wrong:
const filter = i => i.customId === 'myModal';
const collector = interaction.channel.createMessageComponentCollector({ filter, time: 1800000, max: 1 });
collector.on('collect', async i => {
console.log("In here 1");
if (i.customId === 'myModal') {```
modals aren't a message component
you need to construct a new InteractionCollector
<:_:874573855715385394> InteractionCollector (extends Collector)
Collects interactions. Will automatically stop if the message (Client#event:messageDelete messageDelete or Client#event:messageDeleteBulk messageDeleteBulk), channel (Client#event:channelDelete channelDelete), or guild (Client#event:guildDelete guildDelete) is deleted. (more...)
How would I use the attachment option in slash commands
Nope
Js lmfao
How are you listening to the event
?
How are you listening to that event?
Like interactionCreate
What are valid responses to modal submit interactions?
reply, update, and the defer variants
Can you just close the modal?
Yes
is there a function within the channel?
It doesn't count a submit tho
I mean can you just close the modal when a users submits, without responding with a message or anything?
No
Ok, thanks!
If it came from a message, you could just do an empty update
Otherwise, ur stuck with reply then deleteReply
How would I use the attachment option in slash commands
What is the estimated ETA for v14?
There is none
But like how much is done and how much is left?
Here's the current milestones https://github.com/discordjs/discord.js/milestone/3
So when it is 100% complete v14 will be released?
Yes
Ok thanks for your help
So I have a question how can I enable message content I checked the pins couldn't understand it?
In the intent of the client
in dev portal
and GUILD_MESSAGES intents
GUILD_MESSAGES is not message content
<:_:874573879153160212> (static) IntentsBitField.Flags
Numeric WebSocket intents
How would I use the attachment type with ApplicationCommandOptionData?
Just set the type to attachment on the enum
What are the possible inputs for modals?
Text. That's it
is there a way to limit to put only a number?
or to make the modal not be able to submit if you put string into a number
anyways..
no
wait what ok
does dev crash on text in voice interactions?
yes, see #769862166131245066
is it possible to know if the user cancelled a modal submit by any means?
no
how?
the message means bots will receive the ws events, the pr for d.js to not ignore them is not merged yet
how, well, by using a command in a text in voice channel
(not rolled out to all servers yet)
does it open/function like a normal text channel?
oh sry. you're right
No
TypeError: Cannot read properties of undefined (reading 'roles')
Error From
if (ctx.interaction.member.roles.highest.position <= ctx.interaction.guild.members.cache.get(user?.id).roles.highest.position) return ctx.interaction.reply({ content: `${process.env.FAILURE_EMOJI} | You cannot do this action on this user due to role hierarchy.`, ephemeral: true });
_User Variable
const user = ctx.interaction.options.getUser("user");
can anyone help me with the error?
Cache is unreliable, fetch or use getMember instead of getUser method on options resolver
i tried getMember but doesn't seem to solve my issue :(
getMember just converts the user mentioned in user option to a member
For modals?
I didn't, modals only submit once
Or not at all
That's a new modal though
I'd handle that with unique custom ids each time it's launched by including the ButtonInteraction id or something
Modal.setCustomId(${button.id}-modal)
That way you know it's bound to a specific button click
uhh i am sorry my bad i mistakenly did a typo i named the option name userr and not user so it returned null
And I always make sure they time out
So if you open and close the modal 10 times, yeah you'll have 10 collectors possibly but they're all waiting for unique customIds
Standard collector time option
It's a required param on my awaitModalSubmit
Yeah that's okay
What is DirectMessageTyping Intents?
exactly what it says, direct message typing events
And DirectMessages ?
direct messages.
How to send components
components: [row]
all components is separated
and it's possible edits components disabled
wat
what is the lastest discord dev version?
14.0.0-dev.1649160496-402514f
Is it possible to add SelectMenu to Modal?
not yet, for now only text input, but discord is looking into expanding the range of possible components
having more textinput types like channels, roles, users etc would be really cool but I know it's unlikely to happen anytime soon
js[ { "code": "custom", "message": "Input not instance of UnsafeSelectMenuOptionBuilder", "path": [] }] This a known error with select menus?
Event
client.on('interactionCreate', async (interaction) => {
const d = {
interaction,
client,
db
}
if(d.interaction.isChatInputCommand()){
const slash = d.client.slashs.get(d.interaction.commandName)
if(!slash) return;
try{
slash.execute(d)
} catch(e) { console.log(e) }
} else if(d.interaction.isButton()){
const button = d.client.buttons.get(d.interaction.customId)
if(!button) return;
try{
button.execute(d)
} catch(e) { console.log(e) }
} else if(d.interaction.isSelectMenu()){
const menu = d.client.menus.get(d.interaction.customId)
if(!menu) return;
try{
menu.execute(d)
} catch(e) { console.log(e) }
} else if(d.interaction.isContextMenuCommand){
const context = d.client.contexts.get(d.interaction.commandName)
if(!context) return;
try{
context.execute(d)
} catch(e) { console.log(e) }
} else if(d.interaction.isModalSubmit()){
d.interaction.reply("hi")
}
})
Handler
module.exports = (client) => {
const fs = require('fs')
const foldersCommands = fs.readdirSync("./cmds/")
for(const folder of foldersCommands){
const command = fs.readdirSync(`./cmds/${folder}/`).filter(x => x.endsWith(".js"))
for(const commands of command){
try{
const cmd = require(`./cmds/${folder}/${commands}`)
client.commands.set(cmd.name,cmd)
client.commands.set(cmd.type,cmd)
let type = client.commands.get(cmd.name)
type = type.type
if(type == "slash"){
client.slashs.set(cmd.name,cmd)
} else if(type == "button"){
client.buttons.set(cmd.name,cmd)
} else if(type == "selectMenu"){
client.menus.set(cmd.name,cmd)
} else if(type == "contextMenu"){
client.contexts.set(cmd.name,cmd)
} else if(type == "modal"){
client.modals.set(cmd.name,cmd)
}
} catch(e) { console.log(e) }
}
}
}
Creating Modal
d.interaction.showModal(new Discord.ModalBuilder().setTitle('hi').setCustomId("id").addComponents(new Discord.ActionRowBuilder().addComponents(new Discord.TextInputBuilder().setLabel("hi").setCustomId("hi").setStyle(2))))
It doesn't tell me any error, it just turns off the bot
Can someone give the dev version v14 from the package.json
@scarlet tangle its not Discord.Intents.FLAGS in v14 afaik.
U can use GatewayIntentBits or IntentsBitField tho
why do you need that 
latest version is 14.0.0-dev.1649160496-402514f
like this?
no, read the pinned guide
If you imported GatewayIntentsBits yes, almost. Don't u have autocomplete in vscode? f.ex it's .Guilds not GUILDS,
but yeah - the guide
ok
it says:
GatewayIntentBits.Guilds
one or more "intents" you passed werent valid
ye just ask here @scarlet tangle if u are on v14
whats that supposed to mean? does the property not exist?
yes
upgrade discord-api-types
What has MessageEmbed changed to in dev?
EmbedBuilder
ty
const createButton = (style, emoji, id, status, label) => {
return new ButtonBuilder()
.setStyle(style)
.setEmoji(emoji)
.setCustomId(id)
.setLabel(label)
.setDisabled(status)
}
let scopeBack = createButton('PRIMARY', 961072959571771442, 'backScope', 'true', null)```
Expected number, received string
what am I doing wrong?
this isn't completely a @dev question, but I'm using v14@dev
The style is a number
oh
The disabled state is a boolean
how is style a number?
oh I see alright
can I not use null as well? are there any ways you would recommend going around this error,
"message": "Expected string, received null"
Why does this throw an error?
new Discord.ActionRowBuilder().addComponents(
new Discord.SelectMenuBuilder()
.setCustomId('test')
.setPlaceholder('Test')
.setOptions([
{
label: 'Test1',
description: 'Test1.',
value: 'test1',
emoji: { name: '1️⃣' },
default: true,
},
{
label: 'Test2',
description: 'Test2.',
value: 'test2',
emoji: { name: '2️⃣' },
default: false,
},
])
);
Error:
ZodError: [
{
"code": "custom",
"message": "Input not instance of UnsafeSelectMenuOptionBuilder",
"path": []
}
]
I am, yes
Does the options need to be spread
for options, try removing [ and ]
this I think
Oh yeah it’s a rest param
Don't think so... wherever you are passing null it's not what it wants I guess
Worked! Tysm!
alright thanks
yep, np
let scopeBack = new ButtonBuilder()
.setStyle(EnumResolvers.resolveButtonStyle('PRIMARY'))
.setEmoji('961072959571771442')
.setCustomId('backScope')
.setDisabled(true)```
"message": "Expected string, received null"
for the emoji
try {
user.send({ content: `\`< Staff >\`: ${content}` });
i.reply({ content: "Successfully sent message!", ephemeral: true });
} catch(err) {
i.reply({ content: "User does not have DMs on.", ephemeral: true });
}
I'm still getting the S[50007]: Cannot send messages to this user error.
Can anyone tell me why
I also tried removing the ' and making it a number... same issue though
try/catch only catches promises if you await them
ah, thanks
for (let i = 0; i < json.length; i++) {
menu.addOptions({
label: json[i].name,
description: `Canarian Air Flight ${json[i].name}`,
value: i,
});
};``` Is returning the error:
{
"code": "custom",
"message": "Input not instance of UnsafeSelectMenuOptionBuilder",
"path": []
}
]```
what is menu defined as?
const menu = new Discord.SelectMenuBuilder()
.setCustomId('menu')
.setPlaceholder('Select Flight')
What's the ZodError actually telling me? I cannot work it out.
Is it internal or something to do with my code?
Try this
menu.addOptions(new UnsafeSelectMenuOptionBuilder({ your options }))```
It should support the object too but looks broken
It's working now.
that's weird I don't have this issue
Will I need to include this in the future?
nah we'll apply a fix
are you using SelectMenuBuilder from @discordjs/builders?
or it might be possible that your option isnt valid, but its throwing the wrong response from the validator
Construct the not-unsafe one and see what the validator says
no. it's directly from the djs lib.
module.exports = {
name: "interactionCreate",
on: async(client, i) => {
if(i.isChatInputCommand()) {
client.log(`@Interactions Manager`, `received a Slash Command`, { ID: i.guild.commands.cache.find(c => c.name === i.commandName ).id, Name: i.commandName });
const script = client.get('slash command', i.commandName);
script.on(client, i);
} else if(i.isContextMenuCommand()) {
client.log(`@Interactions Manager`, `received a Context Menu Command`, { ID: i.guild.commands.cache.find(c => c.name === i.commandName ).id, Name: i.commandName });
const script = client.get('context menu', i.commandName);
script.on(client, i);
} else if(i.isModalSubmit()) {
if(i.customId === "examplemodal") {
const resp = [];
console.log(i.fields);
i.fields.forEach(field => {
console.log(field.data);
})
}
} else if(i.isButton()) {
}
}
}
So, I'm currently messing with modals, and what i'm getting right now is:
TypeError: i.fields.forEach is not a function
i.fields is a Collection according to what I saw in the console, and the Collection class has the forEach method. Can someone help?
Throws the same error. I'm going to continue using that fix until something gets pushed.
bruh use pastebin or something...
ModalSubmitInteraction.fields isn't an Array or a Collection
Documentation suggestion for @long narwhal:
<:_:874573855715385394> ModalSubmitFieldsResolver
Represents the serialized fields from a modal submit interaction
ModalSubmitFieldsResolver {
components: [
ActionRow { data: [Object], components: [Array] },
ActionRow { data: [Object], components: [Array] },
ActionRow { data: [Object], components: [Array] },
ActionRow { data: [Object], components: [Array] },
ActionRow { data: [Object], components: [Array] }
],
fields: Collection(5) [Map] {
'test1' => TextInputComponent { data: [Object] },
'test2' => TextInputComponent { data: [Object] },
'test3' => TextInputComponent { data: [Object] },
'test4' => TextInputComponent { data: [Object] },
'test5' => TextInputComponent { data: [Object] }
}
} <ref *1> [class Collection extends Map] {
default: [Circular *1]
}
it returns this ^
so i.fields.fields is what i need? 
yes
welp, alright then.
is there a way to get the label of the component?
Current discord.js version: discord.js@14.0.0-dev.1649160496-402514f
On TypeScript I was using ModalBuilder and a received ChatInputCommandInteraction from the event interactionCreate to show a Modal:
const Modal = new ModalBuilder()
.setCustomId('verify')
.setTitle('Verification Form')
.addComponents(
new ActionRowBuilder<TextInputBuilder>()
.addComponents(
new TextInputBuilder()
.setCustomId('name')
.setRequired(true)
.setLabel('Full Name')
.setPlaceholder('Your name here')
.setStyle(TextInputStyle.Short)
);
Output:
Error: Cannot properly serialize component type: undefined
at createComponentBuilder (<workspace>/node_modules/@discordjs/builders/dist/index.js:511:13)
at <workspace>/node_modules/@discordjs/builders/dist/index.js:524:46
at Array.map (<anonymous>)
at new ActionRowBuilder (<workspace>/node_modules/@discordjs/builders/dist/index.js:524:35)
at new ActionRowBuilder (<workspace>/node_modules/discord.js/src/structures/ActionRowBuilder.js:8:5)
at file:///<workspace>/build/commands/some_command.js:123:28
at async Object.value (file:///<workspace>/build/utilities.js:111:13)
at async value (file:///<workspace>/build/utilities.js:72:13)
at async Object.execute (file:///<workspace>/build/events/interactionCreate.js:18:17)
I also verified that any combination of TextInputBuilder components produces this error.
It was working at the yesterday's version of discord.js@dev but not today's. Was there a change to ModalBuilder?
Okay thanks for noting! 
When i try to Select a role and see what data i can get it just says null
case matter here
Did the modalSubmit event get removed?
what modalSubmit event, it was always interactionCreate?
Oh, i prob confused it with another package
you can always make your own
Client#on('interactionCreate', async(interaction) => {
if(i.isModal()) {
Client#emit('modalSubmit', (interaction));
}
});
then call it like:
Client#on('modalSubmit', async(interaction) => {});
not sure if this is recommended/removed, this is just how i remember it being done
👌
What is the new "Text in Voice" feature? I didn't quite understand.
boils down to
• Users can now send messages to voice channels in guilds that get the feature (gradual rollout)
here's images
Wait so, its a chat part of a voice channel kinda like a youtube live chat?
i recently faced an issue with not being able to resend components and it happened to be a bug. Was the issue resolved? How can i track such bugs and is there any way for me to know when a fix gets pushed? for info, im talking about me receiving components[0].components[BASE_TYPE_REQUIRED]: This field is required for trying to resend components
yeah, its pretty cool to be honest
has interaction.options.getString() changed ?
nah
I don't use TS
Documentation suggestion for @forest willow:
<:_:874573924988518500> Interaction#isChatInputCommand()
Indicates whether this interaction is a [ChatInputCommandInteraction](<https://discord.js.org/#/docs/discord.js/main/class/ChatInputCommandInteraction>).
or type interaction as ChatInputCommandInteraction
thanks
if i use interaction.options.getSubcommandGroup() can i do interaction.options.getSubcommandGroup().getSubcommand("name here")??
no, you still get it from the options
interaction.options.getSubcommandGroup() and interaction.options.getSubcommand()
How would i get the getRole from a Subcommand?
just getRole()
displayAvatarURL() doesnt accepts format: anymore?
renamed to extension
oh
and .setFooter() is accepting only one option, contradicting to the previous one accepting string and image separately
correct
<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' })
thanks again
yeah, its like a no mic chat but affiliated to the vc
oh so this like to replace no-mic chats?
thats one of the use cases
how to set activity in setActivity()?
<:_:874573924988518500> ClientUser#setActivity()
Sets the activity the client user is playing.
thanks
.addComponents(
new ButtonBuilder()
.setLabel('Some option!')
.setURL('https://youtu.be/dQw4w9WgXcQ')
.setStyle(ButtonStyle.Link),
);```
I am using it in another file as:
```import { row } from "../index";
msg.reply({content:`some text!`, components:[row]});```
error
ig its probably a type error but am not sure
it is a type error the builder isnt returning the correct type
if I set the defaultPermission for a global slash command to false when creating it, how do I enable it on a per-guild basis
you can allow the guild's everyone role to use the command
And I would use this? https://discord.js.org/#/docs/discord.js/main/class/ApplicationCommandPermissionsManager
that would work, yes
Can you fetch a command by name?
got it, thanks
let scopeBack = new ButtonBuilder()
.setStyle(EnumResolvers.resolveButtonStyle('PRIMARY'))
.setEmoji('961072959571771442')
.setCustomId('backScope'
.setDisabled(true)```
```issues: [
{
code: 'invalid_type',
expected: 'string',
received: 'null',
path: [Array],
message: 'Expected string, received null'
}
],```
this is for the emoji. any idea why it's saying it received null?
.setEmoji takes an object
so instead of an ID, what would I use?
ah
.setEmoji({ name: "…", id: "…" })
I have a problem, my editor is telling me that string is not assignable to any in the field
What's the full code there
ping
What
nvm, I got a ping here
.
yeah just saw that
.
How are you doing new MessageEmbed on the dev version anyway
all good, so youre not on v14, just need to know
yeah no idea, looks fine. Does it work?
Seems like your editor is just being dumb
Hi
Is there a way to prefill a modal field with text? For example, grabbing data from a database and having it displayed inside a paragraph field.
Yep you can
You can set placeholder or value, yes
<:_:874569335308431382> TextInputBuilder#setValue()
Sets the value of this text input
Awesome, thanks!
or placeholder, if you want it to not be editable and just display usage examples
Is DiscordJS having modals or we have to use discord-modals
As i have seen there is but what should be in place of .showModals
For example?
?
That was i telling

Thanks for it
I just want that so!
Documentation suggestion for @river harbor:
<:_:874573879153160212> (static) PermissionsBitField.Flags
Numeric permission flags.
@tame gazelle I have no clue how to use bitfields. Are there any IDs we can specify that are just numbers?
oh. is there a list for the strings?
Documentation suggestion for @river harbor:
<:_:874569322742308864> (static) Permissions.FLAGS
Numeric permission flags. All available properties: (more...)
same in dev version just in PascalCase instead of SCREAMING_SNAKE_CASE
we are talking about the dev version.
I know?
so why did you specify it as "same in dev version"?
because I sent the stable (v13.6.0) doc
Does RANDOM not work in v14? (For .setColor)
pretty sure you can pass Util.resolveColor('Random') to setColor()
okay ty!
How do I create channels in d.js v14?
This isn't working
interaction.guild.channels.create(`${name}`, {
type: "GuildText",
});```
you have to use the ChannelType enum
or just omit the type entirely as thats already the default
oki ty
Is the interaction.isChatInputCommand() specific to / commands on dev, as opposed to just interaction.isCommand() on 13.4?
the canonical name of slash commands is "chat input command"
Hello When im trying to get role member count
Always give me the count 1
role.members relies on cache, you have to fetch members first
any fixes?
help would be appreciated
i would have to see the rest of the code but my guess would to to have the builder return MessageActionRow type as i think that is the expected type
i tried it
you can provide a generic to the actionrowbuilder
do you need the builder? why not export the pre-built row?
you are not using generics here
generics, meaning smth like new ActionRowBuilder<ButtonBuilder>()
oo lol, my bad
Quick question, do modals support images and videos in modalfielddata?
no
for now you can only put text input
Noted, thank you
If I made a code showing a members badges, it would show smth like VERIFIED_DEVELOPER or HOUSE_BRILLIANCE in v13, now will that look like VerifiedDeveloper or HouseBrilliance in v14?
