#djs-in-dev-version
1 messages Ā· Page 9 of 1
i don't know
then find out?
No, just the buttons don't respond
I couldn't find the problem
thanks
if(button.customId === 'last')
^^^^^^^^
What should I write here?
what is button
let fetch = await interaction.fetchReply();
const system = fetch.createMessageComponentCollector({ componentType: 'BUTTON', filter: (clicker) => clicker.user.id == interaction.user.id })
system.on('collect', async (button) => {
if (button.customId === 'delete') {
interaction.deleteReply();
await button.deferUpdate();
} else if (button.customId === 'first') {...}
button didn't respond to it either
wait it's still going to be called MessageComponentCollector?

what will i write?
log button
and show the output
.
explain that
you know not answering
no, even i don't understand what "button didn't respond to it either" means exactly
No movement in console.
no output
these were working fine without custom_id, when I did v14 customId started giving error.
if(button.customId === 'delete') {...}
^^^^^^^^
I just don't know what to write here
@undone yew import ComponentType from discord.js and access ComponentType.Button instead of this componentType: 'BUTTON'
ComponentType.Button or componentType: ComponentType.Button ?
which one will i write
the latter of course
The stacktrace tells you what method you used and where you used it, the error tells you what was expected and what was received.
I'm not sure what more you'd need.
i don't know
something needed a string, but you gave undefined
yes
already talked about that here
setAuthor takes an name option, not content
addFields takes multiple field objects, not an array
so the docs for addFields is wrong too?
yes
outdated but yes
question, is it just me or does anyone else get FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory
never got this in v13, but i get this in v14.
could it be because i have multiple setTimeout or smth
What do I need to change on addFields?
remove the []
we where talking about that idk how you didnt see it
Will fix
i will open a issue for the types
nvm it's probably because of my system
didnāt read
it is documented, just not in the guide
not on the changes they posted both on the guide preview and the github v13 -> v14
with documented I mean discord.js.org
if you click on imageurloptions in the docs, it directs you to the proper page
Yes, but you should always look at the docs if you get a problem like that anyway 
and its rare for me to go to the docs since i have all directly on my ide, thats how i found the errors in the types
i didnt look, just ctrl+click on the type and i saw why xd
just to clarify, you changed yours to forceStatic, right?
Not that you think it got removed 
i didnt change bcz forceStatic now its true by default so i just deleted it
wut, its none by default according to docs
true now its the oposite of the dynamic: true (?)
if we use dynamic as an example, by default now it's dynamic: true
forceStatic: true would be explicitly saying dynamic:false
forceStatic is made false by default, so I think the type should be changed too
https://imageing.eu/shared/dGYFf0Y.png
Its on the name
ForceStatic forces the url to be the static one
So having it to true is the same as dynamic: false
well yes, saying its none by default is not correct tho
it doesn't matter really, but I think showing it default false in the docs is cleaner
I didnt see none tbh
Thats true
But that maybe happened bcz the type is forceStatic?: boolean or forceStatic: boolean | undefined
Docs maybe got confused with that
it doesn't mention @default false
unlike MakeURLOptions.extension
Yeah, and for what im aware the docs arent made by hand so it got confused
They can change that ez but its not smtg that will break your code
whats gonna change with v14?
Many things, please check pins
const button = new ctx.Discord.ActionRow(
new ctx.Discord.ButtonComponent(
{ name: "Boy", style: ctx.Discord.SUCCESS, emoji: ctx.client.emojis.cache.get(ctx.config.emoji.OptionalEmojis.AccountUser), custom_id: 'boy', disabled: false }
)
)
where is error?
Check the pins
register js line 116
const button = new ctx.Discord.ActionRow(...)
oh no sory
since when does ActionRow takes a buttoncomponent in the constructor 
it doesn't
it takes an apiactionrowcomponent, which has a type property and a components array
@undone yew pass nothing to the constructor and use addComponents
they were being sarcastic but ok
š
well.. what is fetch?
fetch = interaction.fetchReply();
prooommiiissseee
Tag suggestion for @undone yew:
Resources to understand Promise:
⢠MDN: learn more
⢠Guide: learn more
⢠JavaScript info: learn more
await moment
-_-
@undone yew you're being difficult, that error's not telling us much, show us the code if you want someone to be able to answer you
instead of passing an object, use the builder methods
like ButtonComponent.setLabel('something')
also this is a good time to mention, content?? button.content?
:D
working, but buttons not work
also addComponents doesn't take an array afaik
same as addFields in an embed
but setComponents takes an array of components
yes
whereas setFields takes a rest parameter
thats a change that i still dont understand
i understand not wanting to support multiple types of input, but they should be consistent
i'd expect setFields and setComponents to be consistent
bruh
again, you're not showing code
they used to be...
thats a v14 change for some reason
well they aren't now š
no code errors
wait
use interaction.followUp instead
thats on your end
the bot has no permissions on that server to execute the action you want
I think we even have a rule for that... rule 4
no bot has permission
apparently not š
wdym?
yeah and we're gonna take you on your word and not the api error you're receiving
Tag suggestion for @undone yew from @urban belfry:
⢠Bots cannot moderate (kick/ban/nickname/...) a target with a higher or equally high highest role or the guild owner.
⢠Bots cannot modify (edit/add/remove) roles that are higher or equally high compared to the bot's highest role.
⢠The ADMINISTRATOR permission does not skip these checks.
I tried a member lower than myself, this time it doesn't give a perm error, but it doesn't process either.
sucks then
uh wait
cant help you with that little you give us
gives role but message is not edited
nice
How do I edit the message?
thats literally basic djs
you should read the docs instead of asking everything
and if you know that little im not sure if you should be using a dev version
nono, they have a point
.edit() is very very different to send(), that may result in confusion 
just ignore me 
no
no
not editing message
ok
you have been told many many many times. you aren't providing code. we can't help you if you don't provide code
anyone know why @discordjs/rest cannot be required from BaseClient?
Error: Cannot find module '@discordjs/rest'
Require stack:
- /home/koyamie/koya.gg/interactions/node_modules/@discordjs/discord.js/packages/discord.js/src/client/BaseClient.js
- /home/koyamie/koya.gg/interactions/node_modules/@discordjs/discord.js/packages/discord.js/src/index.js
It's not exported
wym
If something is not exported, it cannot be imported
will the method name be changed to createComponentCollector since now its ButtonComponent?
Maybe
can we put string for this option in <Guild>.scheduledEvents.create() ?
or we need to use enum?
Enumerables everywhere
rule of thumb: if it's a Bitfield you can use a string, if not use an enum
I don't get it
it's d.js code importing rest package
and it doesn't work
so this isn't true?
It imports for me so maybe your installation is corrupt
do you have rest in your @dry tulipjs folder in node_modules?
it's true for areas that don't use a bitfield
what's "areas"?
discord.js isnt a scoped package
why is it in @discordjs/discord.js
how did you install it?
places that don't accept bitfields
using my fork
you're not installing it properly
nice, thanks
how should I then
idk. you didn't actually tell me how you installed it
npm i https://github.com/Koyamie/discord.js.git
the repository is not a single package, its a monorepo
you can't just install it like that
#7360 in discordjs/discord.js by DraftProducts opened <t:1643366357:R>
Fork installation
just install the dev version
oh missed that, then yeah you'll have to look at that issue ticket
hm I see, the dev version installs rest in node_modules/@discordjs
found my workaround 
please move to #djs-help-v14 or #archive-djs-help-v13 this channel is only v14 users
someone was faster than me
ok
does NONE still exist?
Hi
whats wrong here
const {Discord, Embed} = require('discord.js')
if(interaction.user.id != '736648341848326287') return interaction.reply('No puedes usar esto')
const embed = new Embed().setFooter({text: "hi"})
interaction.reply({embeds: embed})
embed in an array
okay
oh now it's Tier1 ..
why Discord.Embed() isnt working for me, but Embed() works
'cuz you cannot destructure it
what
+ const Discord = require('discord.js')
- const { Discord } = require('discord.js')
ok
well I already had that
You need to do const { Embed } = require('discord.js');, then again I have no idea what Discord is if it's not the default export
nop
what nop? ._.
I fixed it
^^
const Discord = require('discord.js') -> new Discord.Embed()
const { Embed } = require('discord.js') -> new Embed()
ik
you literally sent a screenshot of it... what exactly are you expecting us to say?
since you're on the source, you can click the documentation url on the comment and see that yes, "Public" does not exist anymore
whats that
you passed a string where a number was expected
it's a slash command
that's not relevant, look at the error stack, find the line that points to your code
const Discord = require('discord.js')
if(interaction.user.id != '736648341848326287') return interaction.reply('No puedes usar esto')
try {
const embed1 = new Discord.Embed().setTitle('Entrada').setDescription(`\`\`\`
${interaction.options.getString('code')}
\`\`\``).setColor('GREEN')
const embed = new Discord.Embed()
try{ // Intentarč°© ejecutar el siguiente codigo
let evaled = eval(interaction.options.getString('code'))
embed.setTitle('Salida').setDescription(`\`\`\`
${evaled}
\`\`\``).setColor('RED')
interaction.reply({embeds: [embed1,embed], ephemeral: true})
} catch(error) { // Capturarč°© si hay algun error
interaction.reply({content: 'Hubo un error!', ephemeral: true})
console.log(error) // mostrarč°© en la consola el error
}
} catch(e) {}
whats wrong
.setColor() now only accepts numbers
oj
Documentation suggestion for @scarlet tangle:
<:_:874569335308431382> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.
use this
ok
You check that in the src right, because in the guide I don't see anything
nope
I've already had the error so I know what's wrong
V14
What's in node 16.9 that is the breaking change?
nothing in node 16.9 should break from the version v13 was using
Object.hasOwn i'm guessing
but is that considered a breaking change?
no, if it was then it would have been added to v17 or 18
but yes, afaik the increase in minimum node version was because of Object.hasOwn
But why Object.hasOwn over the in operator?
in returns true for inherited properties, hasOwn does not
in also returns true on getters I think
ahh
const row = new Discord.ActionRow().addComponents([
new Discord.ButtonComponent().setLabel('hi').setCustomId('ow').setStyle(5)
])
interaction.channel.send({content: 'hi', components: [row]})
whats wrong
Well, it throws a huge text
and some invalid component type
Error: Cannot serialize component type: undefined
addComponents takes multiple objects, not an array
that's how I've always used it
well, it changed
its an in dev version and the docs not fully up to date
you should know that when using a not released version
then the error is
addComponents takes multiple objects, not an array
then
const row = new Discord.ActionRow().addComponents(
new Discord.ButtonComponent().setLabel('hi').setCustomId('ow').setStyle(5)
)
interaction.channel.send({content: 'hi', components: [row]})
yes
Are new API features going to be added to v13, v14 or both versions from now on?
Only v14, v13 would be deprecated after v14 releases
Thanks!
what changes can i make in v13 to make it easier for myself to update to v14 in the future?
If you dont move to the dev version that arent any
i won't move to v14 just yet
just seeing if there's something i can do to make it less tedious when it's time
You will have to update them later or the second option is to import all the Enums from discord-api-types and use them
so i'm better off doing npm i discord-api-types and use those enums instead of string literals?
because that seems to be the big(ish) change this time
alright
You can try if this works, even tho im not rly sure if it does on v13, didnt try
But since im not sure if the enums are exported on djs13 you are better off getting them from api-types
But you will make a lot of changes abyways bcz renames and whatnot
imo the changes aren't that brutal, a lot of things moved to enums, that are re-exported from api-types, which aren't valid as enums yet in v13
Ik but for a big bot abd without some tooling that ides like vscode have it might be "hard" to change all MessageEmbed to Embed
is it? it would probably be a find and replace all job
find and replace in all files, ez fix
Notepad++ users dont know that
notepad++ has that too, so wdym
But im using v14 as an excuse to refactor all my projects
Does it? Welp thats smtg new for me then
Even tho i still think that a lot of the refactors are kinda useless since you can index strings into enums and get the same output
did you read the Why are you changing "X" for "Y"? discussion?
I did but still some of the points do not make sense in my point of view
And others im rly glad they decided to do
whats the eta of the the stable version of djs v14?
none
what a nice eta..
no problem
;-;
there simply is no eta
2022
are you sure lmao
imma get a ss
https://imageing.eu/shared/muX7TUH.png what the fish happened here?
its a CommandInteraction<"cached"> 
thats... what
wrong server oof
I'm pretty sure that wasn't meant for a different server lol
shouldn't the type be ChatInputCommandInteraction?
yes
im just stupid
How can i use intent bit eg i was using
intents: [ new Discord.Intents("32767")]
uhh guys i cant click the GatewayIntentsBits
see pins
What do we use instead of embed.type
How else do I check if an embed is picture/video media
Furthermore,
I get a type error when getting an embed image url -
TypeError: Cannot read properties of undefined (reading 'image')
const { guild, author, channel, attachments, embeds } = message;
console.log(embeds.length, embeds[0].image.url)```
there is no embeds[1]
embeds.length was 0?
and what did embeds.length print
1
you sure it was 0 then?
cuz your error says embeds[?] is undefined
or whatever you call image on
const { guild, author, channel, attachments, embeds } = message;
const Gallery = guild.channels.cache.get('935853562997665823')
const ImageAmount = attachments.size + embeds.length
console.log(embeds.length, embeds[0].image.url)
if (author.bot || !channel.equals(Gallery)) {
return
}
const FailResponse = new MessageEmbed()
.setColor('GREYPLE')
.setTitle('Message Deleted')
if (ImageAmount == 0) {
FailResponse.setDescription('ā ļø You cannot talk in gallery')
} else if (!attachments.first().contentType.includes('image') || !embeds[0].image.url) {
FailResponse.setDescription('ā ļø You can only send image media')
} else if (ImageAmount > 1) {
FailResponse.setDescription('ā ļø You cannot send multiple images')
} else {
message.react('ā')
return
}```
Yes. It was, and still is, 0.
https://imageing.eu/shared/eRKJ2jm.png either I'm blind or thats a one
Oh! I didn't see that. Thanks.
TypeError: Cannot read properties of null (reading 'url')
well, no image in that embed 
But, my friend, there is? https://gyazo.com/d41c7333c43ad6096fb4032ec786506f
thats the thumbnail, believe it or not
you could have simply logged the embed object instead of all of that
true
I simply need to check if an embed contains a visual media, if not, delete it
ok
That's hard since type is deprecated, and apparently .image neither .video are actually accurate to whatever the embed contains
well now you know that you also need to check for thumbnail
how to use v14
What if the embed is not solely an image, but a thumbnail for a per say ...Wiki?
do you even need it, its an early dev version
channel topic
i wanna test it, can i?
no, you, in particular, cannot
ty almedia ur so cool'
what

yes, you can test it...
k
also umm there is no Embed in main docs
is it fine to just use the v13 MessageEmbed as docs refrences for now ?
it's in builders docs
not extending, reexporting
lmao yea rexporting
exports.Embed = require('@discordjs/builders').Embed;
how do you use hex on the Embed.setColor ?
it only accept null|number
use resolveColor from the util class
oh okay thanks
or simply '#ffffff' -> 0xffffff
CommandInteraction will be removed?
why would it be?
because I saw that there is ChatInputCommandInteraction and CommandInteraction
ChatInputCommandInteraction etc. extend on that
š
Is the discord.js v14 version out?
does it look released to you
So discord.js v14 version is out?
does it look released to you
No
then that's your answer
So she wasn't released?

...
What?
No
....
Okey thanks you š
ZodError: [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [],
"message": "Required"
}
]
at new ZodError (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\ZodError.js:80:28)
at handleResult (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\types.js:115:21)
at ZodString.ZodType.safeParse (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\types.js:191:16)
at ZodString.ZodType.parse (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\types.js:172:27)
at Oe (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\@discordjs\builders\dist\index.js:3:1905)
at Q.toJSON (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\@discordjs\builders\dist\index.js:3:4367)
at H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\@discordjs\builders\dist\index.js:3:5347
at Array.map (<anonymous>)
at Z.toJSON (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\@discordjs\builders\dist\index.js:3:5338)
at H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\@discordjs\builders\dist\index.js:3:2916 {
issues: [
{
code: 'invalid_type',
expected: 'string',
received: 'undefined',
path: [],
message: 'Required'
}
],
format: [Function (anonymous)],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)],
flatten: [Function (anonymous)]
}
the stack trace didn't say at which line the error is ._.
it is your builders code, that's for sure haha, show that
is that your only command?
nope
Then the error is probably somewhere else
the error appears when I execute this command
nope
okay thats new
i cannot reproduce this error
import {ApplicationCommandType} from "discord.js";
import {ContextMenuCommandBuilder} from '@discordjs/builders'
const myMenu = new ContextMenuCommandBuilder().setName('hey').setType(ApplicationCommandType.User)
console.log(myMenu) // ht { name: 'hey', type: 2, defaultPermission: undefined }
```it works fine for me
maybe with my select menu?
show that code too then
Try starting node with --enable-source-maps https://nodejs.org/dist/latest-v16.x/docs/api/cli.html#--enable-source-maps
try to remove [] in addOptions
--enable-source-maps https://nodejs.org/dist/latest-v16.x/docs/api/cli.html#--enable-source-maps in the terminal?
no that was a reference to the docs
xD
._.
node --enable-source-maps index.js or stuff
thanks
was that it?
yup
wait addOptions only takes the SelectMenuOption class instances now?
...SelectMenuOption
if you pass an array, the method would get that array inside of an array which then throws that error I guess
wait
how does it become ActionRow<ActionRowComponent> ?
now <ButtonInteraction>#customId is <ButtonInteraction>#custom_id right?
no?
according to the docs, still customId
my bot doesn't respond when I select an option ._.
addComponents also takes multiple components, not an array
ahhhh get it
component type
SELECT_MENU => SelectMenu
ah no
still don't response
ComponentType.SelectMenu
didn't you say if it's a Bitfield we can use strings?
That's not a bitfield
when does it throw that error
When i run my command
let ping = await Date.now() - type.createdTimestamp;
const embed = new Discord.Embed()
.setColor("RANDOM")
.setDescription(`Pong! | \`${ping}ms\``)
return type.reply({ embeds: [embed] })
module.exports = {
name: 'ping',
description: 'Pong!',
options: [],
ClientPerms: [],
MemberPerms: [],
async run(client, i) {
i.reply("Pong!")
//client.Commands.Other.Ping(i)
},
};
also why are you awaiting?
I hope that code is in your run method and not outside of it
lol the await
I made this code long time ago and i was thinking await works different
Thanks i made my first v14 command
Just a heads up soon if you want to use the preset colors you'll use Colors.Blurple for example
strings won't be supported anymore
Whats with hex colors?
use the 0x number literals
for example for white it's #ffffff, you'd just do 0xffffff
As in Util.resolveColor("BLURPLE") won't work? or did i misunderstand that?
that will work since it returns a number, but like for some it may be easier to use the enum
we just import Colors right?
yeah, but it's not available yet, the PR hasn't been merged
Ah, alright
I use red, green and blue for most of my embeds so not gonna be a problem for me anyway
expected number recived string
Huh resolveColor returns number. U r getting error in color or anywhere else
Oh then remove color and run if this error comes then it's not a error in color as it's not expected
After removing color?
see bot.js file, line 42
Same
Yeah so it's not because of color check L42
how do i send embeds in discord?
like, just send them as messages, for example: this
You arent bot you cant
<TextChannel>.send({ embeds: [embed] })
not like that
like what then
oof so how did u send it?
What I mean to say is, when you send code to a discord channel and it looks like this
Ohh
Tag suggestion for @scarlet tangle:
Codeblocks:
```js
const Discord = require("discord.js");
// further code
```
becomes
const Discord = require("discord.js");
// further code
Inline Code:
`console.log('inline!');` becomes console.log('inline!');
Code
next time just say codeblock 
Okay mb
hmm looks like emoji strings may not be accepted anymore, this may or may not be a regression. I'll look into that
I am not sure even this button style true
why not use the builders' methods?
Bc this way more easy
yeah you should either stick with just builders or json
also i believe it takes an object that has an id, name and animated property
Actually it was
Its not easier, you make an error way easier with json.
but anyways yeah if you're using json you need the APIEmoji thing
so what you need to pass it as is {name: 'emoji'} since it's not a guild emoji
let b2 = new Discord.MessageButton().setStyle('LINK').setURL(voteURL).setLabel(`Upvote ${this.client.user.username}`).setEmoji(':dbl:')
I mean that one
so is there any eg for v14 buttons
without builder
not entirely sure what you're asking
still dont see why you dont use the builders methods
This one easier
yes, it is, so why do you want to switch away from that
I mean, if you dont know what you are doing, why are you on the dev release.
The update guide clearly states that components are now in the builders package and also renamed to ButtonComponent etc
its as simple as changing the import from MessageButton to ButtonComponent
and i guess you still need to change the style
and the setEmoji
Yes, that too.
ah yeah setEmoji used to take an emoji resolvable, now it takes an APIMessageComponentEmoji , i think the guide should mention this
MessageSelectMenu's addOption used to take an emoji resolvable as well
I'm not sure yet if it that's a fully intentional change
I looked at the docs and it says APIMessageComponentEmoji.
And if emoji strings aren't accepted, how are we suppose to send unicode emojis?
{name: unicodeEmoji}
yeah that should work
Yea this is gonna upset a lot of ppl
wait what? Djs v14 is coming out? What will be the updates?

not yet, it still in development. it will come out when it's ready
ooh
What's gonna be the updates? Any estimated ideas?
new features, removing old and deprecated methods
again, 
there's a guide pinned, as chewbaka said,
so that's their name

this channel is not for v13
yea ik, mb
So to use custom emojis in buttons / select menus, we would have to use the id property right?
id name and animated
animated will be a boolean right
let inv = new Discord.ButtonComponent()
.setStyle(Discord.EnumResolvers.buttonStyle('URL'))
TypeError: Discord.EnumResolvers.buttonStyle is not a function
yes
yep, i don't think name is required but you can test, right? š
i can test
Documentation suggestion for @scarlet tangle:
<:_:874573924988518500> (static) EnumResolvers.resolveButtonStyle()
Resolves enum key to ButtonStyle enum value
Or just use ButtonStyle.Link
also, its LINK and not URL
one doesn't exist
So when using id only (for custom emojis in buttons), it works great, however when i use the name property only, it throws an error
when using both it's fine
for custom emojis, names may not be unique across servers
id should be used as an identifier so it makes sense
yea
so you're confirming with the tests that when using custom emojis name isn't really needed?
yup
neat
so this works as intended
but then what would the animated property do?
i've never seen an animated button emoji but the docs say animated is taken
hmm
i think it's to either make the emoji static or animated if it's an animated emoji, but I'll re-check to confirm
i just checked, i just saw an animated emoji on a button
by default, animated seems to be true
hmm
if its an animated emoji, and you set animated to false, does it change the animated state?
no 
so ig it's only for accessing
what does it mean
MANAGE_GUILDS -> ManageGuilds
MANAGE_MESSAGES -> ManageMessages
Okay thanks
is there any new features besides refactors
Not yet. Once v14 starts getting new features, v13 wonāt get any
Hey team, where did <Embed>.setFields([]) end up? (i.e. when trying to remove all fields from an existing embed)...
I think its just pending a builders release, it was added to discord.js after the builders one was made
<:_:874573940956217415> TextBasedChannels
The channels that are text-based. (more...)
There are docs for all these methods if you switch to main in the dropdown
<:_:874573855715385394> GuildChannel (extends Channel)
Represents a guild channel from any of the following: (more...)
Oh ok, so I'm still able to do it the same way, just can't ATM?
Why not do <Embed>.fields.length = 0 or <Embed>.fields = []
Ok sweet, thanks š
It will be added in the future
You will be able to yeah
wdym
v14 require rewrite anything?
It will
alr like v13 -_-
Major semantic versions do be like dat
ya, im outta
i think i feel like wanna quit
When using a unicode emoji as a <SelectMenuOption>.emoji DJS yells at me š
components[0].components[0].options[0].emoji[MODEL_TYPE_CONVERT]: Only dictionaries may be used in a ModelType
Yeah docs are wrong on this, I think handling arrays is currently broken
I would say it's for you haha, I'm not talking about arrays at all š¤£
no idea
that's what happens when you use dev releases ĀÆ_(ć)_/ĀÆ
are there any breaking changes planned? so far most changes seem to be just stuff moved to enums and a few name changes
Those are breaking
look at the github pull requests with the v14 milestone and the semver:major label
Docs not displaying rest parameters is a known issue
I donāt think anyone made an issue for it tho
I mean too breaking as in "doesn't solve with just replaces" (about the class renaming parts)
when components moved to builders
you mean the pinned guide?
if you want to adapt component syntax read builder docs
seems like that isn't added yet
well, only the renames are listed but not the changes in method signatures
throw result.error;
^
ZodError: [
{
"code": "invalid_type",
"expected": "number",
"received": "string",
"path": [],
"message": "Expected number, received string"
}
]
at new ZodError (C:\Users\zasti\Documents\Bot\Esmile Discord.js v14\node_modules\zod\lib\ZodError.js:80:28)
at handleResult (C:\Users\zasti\Documents\Bot\Esmile Discord.js v14\node_modules\zod\lib\types.js:115:21)
at ZodNumber.ZodType.safeParse (C:\Users\zasti\Documents\Bot\Esmile Discord.js v14\node_modules\zod\lib\types.js:191:16)
at ZodNumber.ZodType.parse (C:\Users\zasti\Documents\Bot\Esmile Discord.js v14\node_modules\zod\lib\types.js:172:27)
at W.setStyle (C:\Users\zasti\Documents\Bot\Esmile Discord.js v14\node_modules\@discordjs\builders\dist\index.js:3:3314)
at Object.<anonymous> (C:\Users\zasti\Documents\Bot\Esmile Discord.js v14\Util\function.js:8:8)
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)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
issues: [
{
code: 'invalid_type',
expected: 'number',
received: 'string',
path: [],
message: 'Expected number, received string'
}
],
format: [Function (anonymous)],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)],
flatten: [Function (anonymous)]
}
const row = new ActionRow()
.addComponents(
new ButtonComponent()
.setLabel('Support')
.setStyle('LINK')
.setURL(link1)
.setEmoji('882684602639081492'),
new ButtonComponent()
.setLabel('Invite')
.setStyle('LINK')
.setURL(link2)
.setEmoji('882683102890197062')
)
use enums or numbers for the type
ok
What would be the number for the link
refer to discord dev docs for those, or just use ButtonStyle.Link
ok
I already put it by the number of the link and how you put but continues to mark error
the same error? show your updated code
The error is the emoji as serious for v14?
{ id: 'emojiid' }
thanks
what are the changes in v14?
pinned
ok thx
Someone passes me the link of what updates to the message embed and the select menu please
you can check the builder docs
In which section
Well I don't know what is the github xd
I don't mean GitHub, go to the docs page and select builders as package
Hey guys, is there an enum resolver for embed colour names?
Thanks
there is a method resolveColor() in the Util class.
Nice, thank you
I think one of the most irritating changes here is the fact that the embed builder doesn't accept strings.
Rewriting all my embeds is going to be a joke and a half.
Is the slash command builder still imported by @discordjs/builders or differently now itās a monorepo?
still builders import
djs installs with builders
and rest and all the other stuff you need 
Not sure what you mean, all methods that need a string still accept strings
they mean setColor
which only takes a number now
But that shouldn't be a problem with the util method
I'm talking about the .addField() method and .setDescription()
wdym, setDescription will always take a string
I receive errors about these methods not accepting strings anymore.
addField takes an object, but description is file though
Will have to look in to that one but definitely .addField() doesn't
Yes, that takes an object
yes now it takes an object on addField
https://discord.js.org/#/docs/builders/stable/class/Embed?scrollTo=addField
an object with the name value and inline property
I see, my mistake, but anyway it doesn't detract from the fact that this particular refactor is going to be the most time consuming to work through.
Anyone know of a good regex find/replace that can be used with Notepad++ to adjust these methods?
Literally 3 seconds to refactor with a simple regex replace
Yeah I always have trouble working out regex lol
Wait this is a support channel nvm bye
\.addField\((.*), (.*)\)
.addField({name: $1, value: $2})
or something along those lines - maybe another one if you use the inline flag
note: did not test, might not work at all, just woke up
Nice, thank you for your help.
no idea if notepad++ even supports group replace patterns with $
It appears to, I'll be making a quick backup before I try it though lol
so, is there a list of all current intents for @ dev? i tried looking for GatewayIntentBits in the docs but nothing comes up
or are they the same as v13
Basically the same
"basically" is enough to fuck people over tho
ty
Existing intents havent changed yet, just naming conventions
aight
Thereās no features yet to v14 right?

Someone pass me what I change in the SelectMenu
addOptions takes multiple options, not an array
But they don't have it on github or in the guide?
yup
But you don't pass it :v
wdym
you didn't give them the docs probably
if they confirm the setEmoji only taking a raw emoji object, i'd mention that too here
its wrong in the docs or code, so no point 
true
Has client.user.setActivity been changed in v14?
yes you need to use an enum: ActivityType
client.user.ActivityType ?
no setactivity is the same you just use the ActivityType enum with it
okay
It was changed to Embed
setColor now takes a number
Documentation suggestion for @scarlet tangle:
<:_:874569335308431382> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.
you can use 0x5980f1 too i guess
better way ^
So from my understanding D.JS V14 is all about cleaning up the code and stuff which requires a major ver change?
MessageAttachment, afaik didn't know
the guide lists most of the changes, it's still being worked on
kinda yes, there's no big feature added as far as now, just a bunch of refactoring to improve flexibility and major changes, that's all
Ah okay, every code project needs some refactoring every now and then š
no
then use the color resolver
https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html#enum-values i told you, read the guide
it doesn't or isn't recommended
the first part is already telling you what to do
you sure can....
Documentation suggestion for @scarlet tangle:
<:_:874573924988518500> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.
click the </> button
addFields expects multiple field objects, not an array
sad but true :/
yes
don't use a dev version if you cant live with changes
full error?
that change also applies to actionrows, selectmenus etc
multiple objects instead of an array
yes
please show the full error :D
are you using select menus
thought so 
can you show the code
for emoji you need to pass an object, but I'm not sure what exactly, hold on
i can't import MessageEmbed from discord.js it moved to discord-api-types or another?
its Embed if you would care to read the update guide 
oh thanks and how can i reach update guide?

okey thakn
thanks*
and also how can set color of embed in v14 cause it says color needs to be a number
Use the resolveColor method from the Util class
seems like there is an inconsistency here, docs says array, code returns an error
that is not the way, addFields should accept an array
no
it doesn't
it should but doesn't
#addField and #addFields both accept an object or array of APIEmbedField(s) respectively. (add link to dapi site)
already making a pr for that, for now you have to remove []

I won't edit hundred lines of codes for an issue that will get fixed
thats true
This doesn't need to continue
no, its an error
It's got a fix coming, they don't wanna change, that's all there is for now
This isn't the channel for this discussion
anyways thanks for the answer
Probably made a mistake when bringing it over to builders
thats not just applying to embed
djs does tho 
Embed etc. just gets re-exported
its a monorepo now, it gets updated at the same time
Sry, forgot this is dev. There should be an enum for it
I guess you could
ApplicationCommandType.MessageComponent and ComponentType.SelectMenu
Should also work
The main reason I donāt like number is bc I donāt like memorizing what each number is
Too many enums to memorize
big brain
Whatās the int for channel type guild category?
3? ._.
Channel type is an enum
what is this 
beta version for discord.js
will bots be able to stream yet?
no
Thanks
Unless you actually need help, don't comment, thx
What is enum lol
Coding wale nibbe
who ayu
@jolly idol your fan xD
@forest elm ok

@scarlet tangle ty
No
pins
nope
Except the guide actually does that
you can check the commit history if you really want that
setColor takes a number, use Util.resolveColor()
yup
K
@scarlet tangle use new ActionRow().addComponents(btn) instead of passing it to the constructor
Yes mb i forgot it
guild.fetchMember('id') or client.users.fetch('myId').then(function);?
what the
sorry wrong channel lol
does v14 contains breaking changes? like we did with v13 when we needed to rewrite everything from A to Z ?
Pinned messages
i checked but i wanna know more
like, we need to rewrite a lot or a little?
all the big ones are listed, that's all
Depends on your bot code idk
depends on how much you used one feature and how big your bot is of course
will a message be sent here when I new dev version will be available?
#announcements definitely
Dont think so, only when v14 is actually realesed
He is asking about dev versions
they didn't sent anything for this
i thought you were talking about v14 
yeah but the dev version ._.
You can just try to install djs dev everyday and see xd
A new dev version is available every 12 hours
thanks
What error is this? And how do I fix it?
#addField needs to be passed an object
The error says its here
that's the only one you adapted
Now this error occurs
cmd.description has a value of undefined
No
Yes
yeah and there isn't a description there
your not helping there is a description there
Try cmd.description ?? "undefined" and you will see
look at your eval command bruh
- cleaner
Bruh
is there any reason why its not working?
Tag suggestion for @coarse marten:
Sending and editing now takes only a single object parameter!
- channel.send(embed);
+ channel.send({ embeds: [embed, embed2] });
- channel.send('Hello!', { embed });
+ channel.send({ content: 'Hello!', embeds: [embed, embed2] });
⢠Full migration guide: learn more
also now it's Embed, and setColor only takes a number (or null)
these are not the problem, for sure.... I copied it from another commands I have and it works perfect.
and this is the value in setColor
no that is indeed a problem, maybe not the problem which is most probably Intents
what version of djs are you using?
the thing is, even without embed, the bot doesn't detect new server members, I tried to do only the guildMemmberAdd line with console.log(1) just to see output, and its not working
13.6.0
then go to #djs-help-v14
I tried, they told me to come here... \:
I tried using intents, that didn't help, or maybe I just didn't use it right
you were told that if you're using v14 which you aren't, to come here
you need to enable the GUILD_MEMBERS intent, for further help with your code, just go to #djs-help-v14
Is there a question in there
@scarlet tangle thumbnail: {url: url}
will it be possible to get the banner of the GuildMember?
or Discord didn't tell anything about that
it's not possible through the api yet, that's for sure
okay thanks (also nice pp ._.)
Im pretty sure you can get the user banner
user yes
But idk if its implemented in djs yet
but not GuildMember
No
I can do some testing š¤
Still, im pretty sure you can get the banner
Yeah per-user banners are availables through the API and supported by discord.js
per-member banners are still experimentals AFAIK and will be available in the future
what did you understand by "GuildMember" ? ._.
My brain didnt work properly sry
no prob me too ._.
Is there like a change log for v13 to v14?
Check the pins
Alr ty
How you can put SelectMenu emojis
{ id: '' } for custom ones, { name: '' } for unicode
Any clue on these?
Those aren't merged yet afaik
whats changed

Imagine a setting where a channel is unreadable until the pins are pressed.
How to import MessageButton, it is not working, was it renamed or something
yes, it's in the guide https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html#before-you-start
ButtonComponent
ButtonComponent
thanks
Hello, I ran into the errors below when I was trying to build the app using newest version.
node_modules/discord.js/typings/index.d.ts:1422:42 - error TS2344: Type 'MappedInteractionTypes<Cached>[T]' does not satisfy the constraint 'MessageComponentInteraction<CacheType>'.
Type 'MessageComponentInteraction<If<Cached, "cached", CacheType>> | ButtonInteraction<If<Cached, "cached", CacheType>> | SelectMenuInteraction<...>' is not assignable to type 'MessageComponentInteraction<CacheType>'.
Type 'ButtonInteraction<If<Cached, "cached", CacheType>>' is not assignable to type 'MessageComponentInteraction<CacheType>'.
Types of property 'channel' are incompatible.
Type 'CacheTypeReducer<If<Cached, "cached", CacheType>, GuildTextBasedChannel, GuildTextBasedChannel, GuildTextBasedChannel, TextBasedChannel>' is not assignable to type 'GuildTextBasedChannel'.
Type 'GuildTextBasedChannel | ([If<Cached, "cached", CacheType>] extends ["raw"] ? GuildTextBasedChannel : [If<Cached, "cached", CacheType>] extends [...] ? GuildTextBasedChannel : TextBasedChannel)' is not assignable to type 'GuildTextBasedChannel'.
Type '[If<Cached, "cached", CacheType>] extends ["raw"] ? GuildTextBasedChannel : [If<Cached, "cached", CacheType>] extends [...] ? GuildTextBasedChannel : TextBasedChannel' is not assignable to type 'GuildTextBasedChannel'.
Type 'GuildTextBasedChannel | ([If<Cached, "cached", CacheType>] extends ["cached" | "raw"] ? GuildTextBasedChannel : TextBasedChannel)' is not assignable to type 'GuildTextBasedChannel'.
Type '[If<Cached, "cached", CacheType>] extends ["cached" | "raw"] ? GuildTextBasedChannel : TextBasedChannel' is not assignable to type 'GuildTextBasedChannel'.
Type 'DMChannel | PartialDMChannel | NewsChannel | TextChannel | ThreadChannel' is not assignable to type 'GuildTextBasedChannel'.
Type 'DMChannel' is not assignable to type 'GuildTextBasedChannel'.
Type 'DMChannel' is not assignable to type 'ThreadChannel'.
Type '[If<Cached, "cached", CacheType>] extends ["cached" | "raw"] ? GuildTextBasedChannel : TextBasedChannel' is not assignable to type 'ThreadChannel'.
Type 'DMChannel | PartialDMChannel | NewsChannel | TextChannel | ThreadChannel' is not assignable to type 'ThreadChannel'.
Type 'DMChannel' is missing the following properties from type 'ThreadChannel': archived, archivedAt, archiveTimestamp, _createdTimestamp, and 35 more.
Type '[If<Cached, "cached", CacheType>] extends ["raw"] ? GuildTextBasedChannel : [If<Cached, "cached", CacheType>] extends [...] ? GuildTextBasedChannel : TextBasedChannel' is not assignable to type 'ThreadChannel'.
Type 'GuildTextBasedChannel | ([If<Cached, "cached", CacheType>] extends ["cached" | "raw"] ? GuildTextBasedChannel : TextBasedChannel)' is not assignable to type 'ThreadChannel'.
Type 'NewsChannel' is not assignable to type 'ThreadChannel'.
Type 'CacheTypeReducer<If<Cached, "cached", CacheType>, GuildTextBasedChannel, GuildTextBasedChannel, GuildTextBasedChannel, TextBasedChannel>' is not assignable to type 'ThreadChannel'.
Type 'GuildTextBasedChannel | ([If<Cached, "cached", CacheType>] extends ["raw"] ? GuildTextBasedChannel : [If<Cached, "cached", CacheType>] extends [...] ? GuildTextBasedChannel : TextBasedChannel)' is not assignable to type 'ThreadChannel'.
Type 'NewsChannel' is missing the following properties from type 'ThreadChannel': archived, archivedAt, archiveTimestamp, _createdTimestamp, and 23 more.
1422 } & MessageComponentCollectorOptions<MappedInteractionTypes<Cached>[T]>;
ratio
Even after reinstalling?
Yes
I can't reproduce that
are you using the up to date version of tyescript?
that's still being discussed now afaik, whether or not the methods will take rest parameters or arrays or both
seems unlikely they'll support both
but it is a pretty easy change for you, if you're passing an array, just search all the addFields, and spread the array
no, a string
you know docs exist right, just select the builders docs
when constructing it with an APIEmbed, yes
how about you try?
or look at the docs, reply's embeds do take an array of APIEmbed s
okay, show your code and error
now it's Discord.Embed
yep
just to confirm, you are using v14, right?
Sure
doesn't seem v14 specific
<Guild>.channels.cache.find is still here
This error is not present on the stable version
when is this coming out
there's no eta as of now ig
eta: when it is ready
Discord.MessageEmbed()
@jovial steeple this is the v14 prep channel, it is Embed.
@lofty knoll presumably not very useful for this channel either
You can just use GatewayIntentBits.GuildMessages etc
The way the guide mentions
What did you do?
code and d.js version
assuming is dangerous, verification is good
also, d.js v14 is not a thing yet, commit hashes are also important since you're on dev
Timeout is in 13.6
sorry I didn't look at the category name
I am not able to see the github branch for the development version
There is no branch, its the main
they didn't move anywhere
I can still access Constants.Events.INTERACTION_CREATE as always
ah yeah, was recent
use Constants.WSEvents.INTERACTION_CREATE I guess
https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/index.js#L21
const { Events } = require("discord.js")
// Events.InteractionCreate
@meager crag are you... listening to raw WebSocket events?
Because looking at this
#djs-in-dev-version message
it seems you're not so yes there is a difference and yes the WebSocket ones are not what you're looking for (it won't work)
The one by GoldenAngel is the one you're looking for
In https://github.com/discordjs/discord.js/pull/7379 it was moved
Yes
If you switch to Constants.WSEvents.INTERACTION_CREATE, none of your events will fire lol
Yes those are for listening to raw data only
And they don't have discord.js defined events
This is the right one moving forwards
Is there a guide for V14? Or what is new? (or just docs) nvm found it
i love v14
where you got info about v14?

thx
I heard about a "modal" feature being in the works. What would it entail?
Popups like this one are modals. We don't have a lot of details so far, you'll be able to add text input fields to them and submit, which will trigger an interactionCreate event
Sweet! Is that available somewhere in the Discord api? I'd love to take it for a spin.
no
you can't test them right now, but there's a PR for djs
#7023 in discordjs/discord.js by suneettipirneni created <t:1637621711:R> (review required)
feat: Add Modal and Text Input Interactions
š„ npm i suneettipirneni/discord.js#feat/text-input-interactions
also this is the api notion: https://devsnek.notion.site/devsnek/Modal-aka-Form-Interactions-e839b3dd8c214eb08f950764a8328e36


