#djs-in-dev-version
1 messages · Page 10 of 1
the notion is public to anyone?
oh
a github pull request review, it means the devs need people to check, discuss whether the update is good
The GitHub is a monorepo of multiple packages
The discord.js package is just one of them
which files
For what
can you like... be a bit more specific
What are you trying to edit and why
We don't know what edits you're trying to make lol
You cant
Or I mean you can, but the API calls won't work
why do you want to edit that anyway 
That's not how that works
You don't just edit your node_modules with random un-merged code
Wait until it's merged into our @dev release, then it'll be ready for use
discord.js v12: So easy
discord.js v13: Huh??
discord.js v14: 

In discord.js v12, anything is easy, including playing music, building a moderating bot
v13 too
What is your definition of easy?
Like, in v12, joining vc only need to <VoiceChannel>.join()
the only thing that is annoying in v14 it’s enums but that’s life
But in v13... <VoiceChannel>.create connection(...); then we need to handel disconnect event
in v12 discord.js will do it for u
I mean I have to say the v12 to v13 upgrade was much more involved than v13 to v14
I hope v15 won't be crazy
I hope it will
v13 - v14 on my end was mostly
a) embed builders are pain
b) finding out where various enums reside
Since you are already talking about the different versions:
How do you decide when to release new major versions?
Like from 12 to 13 was quite obvious with the introduction of Interactions together with breaking changes.
v14 seems to be more around the overall project structure.
So the release of that version is tied to when all of that is finished.
But are there additional things you wait for? Like the new permission system (I could imagine that also being a breaking change) or the Modals?
How do you decide when a new major version is "ready to ship"?
breaking changes.
there is a lot of process
we introduce features as soon as possible (and they are tested and documented on the DAPI docs)
most features can be released in minor versions 13.x
bug fixes are released in patch versions 13.x.y
changes to the libraries structure or other breaking changes are released in major versions
when we determine a version has been tested sufficiently (actually been run on a bot for a bit and observed) we release a version if we do not expect any other changes in the next short timespan (to avoid releasing 13.x+1 shortly after 13.x)
this consideration becomes more elaborate for major versions, because shipping 14 very shortly after 13 is of course annoying for developers that want the new stuff but don't want breaking changes, which is understandable
major versions often have a certain theme around them, once that is completed the version can be shipped after being tested
for v14, so far, it's "things we implemented weirdly before and are a pain to maintain" as well as the switch to a monorepository merging the various projects (also for easier maintainability).
we expect some features to come to discord in not too much time from, which will be incorporated into v14 and shipped with it (as they may or may not also include breaking changes we are considering holding off the release until we get more clarity about the release schedule for these)
Thanks! I was specifically wondering about the "avoid releasing 13.x+1 shortly after 13.x"
Because I think the new permissions / slash command option types / modals wouldn't necessarily be breaking changes in itself, so I was curious if v14 was tied to these features.
But your explanation makes perfect sense to "wait" as they are assumed to be released soonish anyways
Those features will most likely be a part v14 only. This is because we only actively develop one branch at a time
Oh I thought as much. Wasn't expecting them to be released still in v13 just to be "fixed" for v14 again
hi how do i fix this
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
^
TypeError: Cannot read properties of undefined (reading 'FLAGS')```

but im using v14
@scarlet tangle i've already told you, the pins
it tells you what to change :\
yes it is
ah yes my eyes were bad sry
Removed user.presence with Discord JS v14?
that got already removed in v13, it's only on GuildMembers
So is it still possible to show?
presence was never on users. User#presence simply searched for a GuildMember associated with the User that had a presence
So we can't show
you can
how?
<GuildMember>.presence
can we get it from all servers?
wdym
How exactly do I define GuildMember?
what about using the code that User#presence used in v12?
I did not understand
loop through guilds and see if member presence is there
what
when its ready
What is the code that finds bots in Discord?
what
I want to pull the bots
I have no idea what you mean
Can you please explain the problem or problems you are facing in a more in-depth explanation or a possible scenario?
I want to get the number of bots I will print to the stats command (all servers)
I didn't say write, I said what was the receiving code?
that's not easily possible, you'd need to considerably bloat your memory and fetch members on all servers your bot is on , to then filter by member.user.bot
for member stats we usually recommend summing up Guild#memberCount over all guilds, which is the only approach that scales but comes with a few caveats, such as overlap and not being able to filter for non-bot/bot users
also consider that these are, at the end of the day, empty stats and just a weird flex
Is passing object literals to the components array in InteractionReplyOptions still allowed?
I'm using TS and get the following error when compiling:
Type '{ type: ComponentType.Button; custom_id: string; style: ButtonStyle.Primary; }' is missing the following properties from type 'ButtonComponent': setStyle, setURL, setCustomId, setEmoji, and 4 more.
node version: 16.13.2
djs version: 14.0.0-dev.1644235768.b936103
typescript version: 4.5.5
this is a bug it's going to be fixed soon
ok, thank you
Can I reply to a ephemeral message, (fetched) by without emphermeral?
You can't fetch ephemeral messages iirc
u cant
Oka
where is the documentation for discord.js v14 or is it on the guide?

well a friend sent me this actually https://deploy-preview-1011--discordjs-guide.netlify.app/ but i wanted to see if the docs are there
@fiery aurora https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html#common-client-initialization-changes there's a guide pinned
ahh thanks, didnt know this channel existed :p
oh i just observed v14 relies on enums now?
if you already observed it i'm not sure what you expect as an answer here
you have a point 
i believe only the updating to v14 part is being updated right now
lol
I have question.
In v14 we still need to use the discord-api-types/v9, @discordjs/rest, @discordjs/builders packages?
yes
Why did y'all change MessageEmbed to Embed?
check pins
Quick question, does <Interaction>#isCommand return true if the <Interaction> is what we previously knew as a <ContextMenuInteraction> in v14?
.isCommand() check if it's a slash command in v13
Yeah I think so, there's isChatInputCommand now to check if it's a slash command iirc
Okay need to get used to a context menu interaction being considered a "command" :/
It is a command technically
it's an Application Command
Yeah true that makes sense
i think it will work
if you read the guide
You might be inclined to use raw
numbers (most commonly referred to as magic numbers) instead of enum values. This is highly discouraged. Enums provide more readability and are more resistant to changes in the API. Magic numbers can obscure the meaning of your code in many ways, check out this blog post if you want more context on as to why they shouldn't be used.
yes
Permissions.FLAGS has it in docs I believe
*in the v13 doc
hi what is this channel for ?
As everything would indicate
For v14 discussions
The next version that's currently in development
is there any new thing ?
Yes, breaking changes
Read the pins
shit here we go again ;-;
Major versions will likely always include something that is breaking
litttt
I’m not sure if v13 is still getting updates since the migration to mono repo in v14
It probably isn't
v13-dev when
v14? i havent even updated to v13 in prod
does it mean that v14 will be released soon? ._.
'cuz in general new features are being added quickly
It'll arrive when we need to deliver a breaking change
Attachment for slash command is out now can we use it in V13 or we need to update dks version to v14 ?
Neither
We do not support features released 5 minutes ago
Please allow adequate time for discord.js development to actually happen
I know but i just want to know that it will add in v13 or not ?
Undecided
ok tnx
Hi, I've just seen this, any news on when it will be available with discordJS ? xd
no
I feel like there should be a pin for this lol
no u
Everyone's about to come asking when it's being released
oof xd
There is, in general lmao
Lol
I assume you guys didn't get early access or whatever
didn't knew it was that recent my bad
Iirc inputs were early access
POV: Angry Monbrey 😆
Right
We did
Early access is not sufficient to deliver before release, or 5 minutes after
Select menus too
Not yet
It’s planned in the api
My mistake
I just saw discussion in the developer discord and read "no buttons". Assumed that meant other things would be included
Do we have a PR merged/WIP for modals?
Not merged yet
do you have a link to the PR?
#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
ty!
when i install this i get
Error: Cannot find module '@discordjs/discord.js'
when i try and run my bot
Those npm install commands don’t work anymore, if you want to test them you’ll need to clone the repo and install locally
alright thank you
has anyone gotten the buttoncomponent working for modals
modals are not even released for djs. discord released them hours ago so you need to wait until its in djs
read my message above
yea, i was talking about raw api ;-;
maybe ask in another server
Modals dont support buttons
the doc said "component type between 1 and 5"
No
What are modals can anyone provide me a article?
Thanks
XD
are modals supported yet on the v14? will they ever be suppported on v13?
no, yes, or at least a maybe
Sure
By adding them yourself
Nothing to do with us
You can wait for us to release them
We're not going to support hacky workarounds
probably off topic but it's time to add 'ETA: When It's ready' to #769862166131245066 😂
Where's the repo/branch for v14
Just wait
Am I correct to assume that when this PR gets merged, modals will be available at-dev? https://github.com/discordjs/discord.js/pull/7431
there is a separate pr for v14
this is for 13.7
Oops, I thought this was 13 at-dev 😅
What is the changes of djs v14 dev
read pins
For v13?
this channel isn't for v13 to begin with, but the old source is in the stable branch of the repo
Oh ok but why don't you guys create a Dev or v14 branch that will contain the updated code incase there is some emergency where you need to immediately resort to something
It will be more organised and easier to manage

The main branch is exactly that
I don’t understand your question
are modals in dev version yet?
how do i install the pr?
this error is only when i add the /pull part
components: [{
type: 1,
components: [{
type: 4,
custom_id: 'actual_modal',
style: 1,
minLength: 1,
maxLength: 400,
placeholder: 'hello face',
required: true,
label: 'hello fave'
}]
}]```
getting
`Invalid Form Body
data.components[0].components[0]: The specified component type is invalid in this context`
what's wrong?
Documentation suggestion for @strange knoll:
<:_:874573940956217415> ComponentTypeEnumResolvable
A string that can be resolved to a ComponentType enum value. Here are the available types: (more...)
use enums
just as string?
not really recommended
Oh sorry it won’t work atm, the types needs another release
You can actually clone the PR and require the packages/discord.js folder
discord side or djs code side?
Djs
to install with modals do i just do npm i discord.js@dev?
what file is the check in?
?
no, not yet merged
ohk
in what file is component type check
so i clone this?
Multiple of them
Can’t remember off the top of my head
can u tell me em, ima try to edit in my node modules
You’ll have to look at the pr diff
k
dont see how to clone it? it only says gh pr checkout 7023 and when i run that it says ```
quadradical@pop-os:~/Code/QuadraticBot2.0 (copy)$ gh pr checkout 7023
GraphQL: Could not resolve to a PullRequest with the number of 7023. (repository.pullRequest)
Managed to clone but its just a new repo how do i upgrade just d.js?
i have absolutely no idea what you're even trying to achieve
Trying to upgrade to the djs pull request that has model support
and why don't you just do what the think you replied to said?
@dawn phoenix ^
Alright it’s not ready to test right now we’ll let you know when it is
Ok👍
since when?
since monorepo
:(
The modal PRs aren't ready to be used
Which is why not a single contributor has suggested you should use them and both PRs are marked as drafts afaik
ayo modals in dev?

v16.9 noice
Cannot read properties of undefined (reading 'FLAGS')
const bot = new Client({ intents: [
Intents.FLAGS.GUILDS,
] });
pins
?
read the channel pins
how to enable intents in 14.0.0-dev version

nooo, let them read 
._.
did they merge the pr
Which PR?
the modals pr ;-;
#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
Nope
tell me the eta
there is none
o
You can refer to #769862166131245066
you can install modal support from their branch (command is in bot's message)
doesn't work for v14 anymore, because of the monorepo setup
how do i do that ;-;
when will it be possible to put array in .addFields() ?
why? just spread it
didn't get
<:_:818272565419573308> Spread syntax (...)
Spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.
like now we can put multiple objects in .addFields() but soon we have to put an array of objects right?
and my bot has some issue with a command and I was wondering when will it be possible to put an array of objects
but soon we have to put an array of objects right?
thats what my pr would achieve, but doesn't look like thats getting anywhere anytime soon
I see
is this an error my side or..
reinstall and then reload the ts server
o
well, wouldn't make it "have" to 
or are you removing the ability to parse multiple objs
no, the pr would add the ability to use arrays
chewie's adding both
that situation is real uncertain, i can't tell what they'll end up on, one day it seems like they want arrays, one day it seems like they want both and then it seems like rest parameters
either way, wait a bit and in the end whatever happens
note that for making the change you can simply search and put them in [] or take out [] or use spread syntax ...
ZodError: [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
0,
"value"
],
"message": "Required"
}
]
at new ZodError (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\ZodError.js:80:28)
at handleResult (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\types.js:115:21)
at ZodArray.ZodType.safeParse (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\types.js:191:16)
at ZodArray.ZodType.parse (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\zod\lib\types.js:172:27)
at ge.addFields (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\discord.js\node_modules\@discordjs\builders\dist\index.js:1:5075)
at ge.addField (H:\IdrisGaming\Discord Bot\IdrisBotSC\node_modules\discord.js\node_modules\@discordjs\builders\dist\index.js:1:3803)
at Object.execute (H:\IdrisGaming\Discord Bot\IdrisBotSC\commands\utility\emoji.js:52:6)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.execute (H:\IdrisGaming\Discord Bot\IdrisBotSC\events\interactionCreate.js:44:17)
at async Client.<anonymous> (H:\IdrisGaming\Discord Bot\IdrisBotSC\Structure\Client.js:47:25) {
issues: [
{
code: 'invalid_type',
expected: 'string',
received: 'undefined',
path: [Array],
message: 'Required'
}
],
format: [Function (anonymous)],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)],
flatten: [Function (anonymous)]
}
.addField({ name: 'Animé', inline: emoji.animated ? 'Non.' : 'Oui.', inline: true })
- inline: emoji.animated ? 'Non.' : 'Oui.'
+ value: emoji.animated ? 'Non.' : 'Oui.'
``` ?
Djs v14 released?
no
i'm using axios/raw api to send modals, once i sumbit it, can i reply to it using interactionCreate event?
no, internally djs doesn't handle it yet
await axios({
method: 'POST',
url: `https://discord.com/api/interactions/${int.id}/${int.token}/callback`,
headers: {
Authorization: `Bot ${client.token}`,
},
data: {
type: 9,
data: {
title: 'My Cool Modal',
custom_id: 'cool_modal',
components: [
{
type: 1,
components: [
{
type: 4,
custom_id: 'my_modal',
label: 'my label',
style: 1,
min_length: 1,
max_length: 400,
placeholder: 'my placeholder',
required: true,
}
],
},
],
},
},
})```
↑↑ (int is interaction)
@strange knoll this is not support for hacky workarounds or raw API calls, please do not continue to discuss them here
Again, this is not hacky workaround support
Please use the PR or wait for it to be merged for proper use
TypeError: e.toJSON is not a function
at /root/IdrisBotSC/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:6370
at Array.map (<anonymous>)
at E.toJSON (/root/IdrisBotSC/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:6361)
at E.toJSON (/root/IdrisBotSC/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:6765)
at /root/IdrisBotSC/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:3459
at Array.map (<anonymous>)
at w.toJSON (/root/IdrisBotSC/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:3450)
at /root/IdrisBotSC/node_modules/discord.js/src/structures/MessagePayload.js:134:77
at Array.map (<anonymous>)
at MessagePayload.resolveBody (/root/IdrisBotSC/node_modules/discord.js/src/structures/MessagePayload.js:134:49)
anyone know where it could be from?
most probably a send or reply
what's row defined as?
let me check addOptions
ahhyessir, @tame gazelle can you try constructing SelectMenuOptions instead of passing raw objects?
didn't get
- {label: '', value: ''}
+ new SelectMenuOption({label: '', value: ''})
for all of them, yes, 
i kinda don't like this since it makes this so much more complicated
but yeah
oh without builders?
what
no i'm telling you to pass multiple SelectMenuOptions in addOptions instead of the raw objects
?
yes, try it
it works ._.
so
I have to do it for ALL options?
yeah
i hate it
but you can put them in an array and just map it
[{label, value}, {label, value}, {label, value}].map(v => new SelectMenuOption(v))
but why this doesn't work? ^
this doesn't work either?
no it doesn't
same problem
it returns the error
. - .
can you just remove the reply and first confirm if this is indeed the issue?
remove the component from the reply?
okay idris what are you saying? does this work?
this works ^
i have absolutely no idea
inb4 EmbedFieldOption
this doesn't work ^
yeah because it takes in SelectMenuOptions
the first clue i got was that it was calling toJSON internally, it's calling <SelectMenuOption>.toJSON() internally
it doesn't take just an object, it must be an instance
i mean.. this is the only way it works, right?
?
it's way too complicated just for something as small as select menu options
but no longer accepts the array object? ._.
currently it does not, no
whether it will in the future, we'll see after my pr gets merged 🤠
IntelliSence know what I put in it no?
that's wrong
?
thank you for information
you have to put in SelectMenuOption instances @tame gazelle
hope this clears it up
not an array, not just objects, class instances
the documentation is also wrong, it says it takes in an array
it's a rest parameter
i mean you can still do this
new SelectMenuComponent({options: ArrayOfRawOptions}).method
internally it does map it
public constructor(data?: APISelectMenuComponent) {
this.options = data?.options.map((option) => new SelectMenuOption(option)) ?? [];
```just like as i've said
but wait ts won't like that...
solved, thanks a lot 🙏
Hey I wanted to ask that should I enter discord.com on this or something else like api.discord.com?
not djs related, #useful-servers
No I mean that I want to include discord to it
and I said its not djs related, #useful-servers
What is the api website
bruh
that's super vague, what change
but <SelectMenuComponent>#addOptions() doesn't take an array
@hybrid zealot you don't make requests from discord's domain, that makes no sense.
yeah i never said it does
This is unintentional and will be fixed soon to accept objects and arrays of objects
both?
objects got it
Why is guild.channels.create() deprecated?
it's not, some types like store is deprecated
Yes
then how can I create a Text Channel?
GUILD_TEXT
can you confirm that we want to indeed use both arrays of x and a rest parameter of x on these methods?
because one day i'm hearing it's just rest parameters and then i hear something completely different
should i use this or keep on stable (v13)?
That's entirely up to you
We’re going to stick with rest parameters only
i mean, is this stable to release for public bot?
@dev is not a stable release, no
beacuse i saw that not everything done
ok
the stable release will be 14.0.0
ok thanks 🙂
hope that will be soon
because it's currently still being worked on?
stable <> breaks when trying to run it
those are two different things
"not stable" means that the API can change at any point and that bugs are a common sight while features are being ironed out
can you use it? yes
is the api finalized? no
can it have bugs? yes
can things change from one day to the other? yes
do you want to refactor a large code base that multiple thousands of people depend on? presumably not
i have a private channel , i send an invitation to a user to join me in this channel
but he can see nothing cause it's private
is there a way to know when the user hit the join button on the invitation or to know when he join the channel so i can give him permissions ?
invites lead to guilds and focus a channel, if private they see nothing
you don't get information on guildMemberAdd regarding the invite they used to join
the best approach is that you can try and keep the amount of uses each invite has and check which incremented roughly when that member joined
in the end you are working on a best-guess basis here
i come up with an idea which is by the time i send the invit i give the targetuser permissions , but is there a way to know when target user join the channel , i google it and all i have found is voiceStateUpdate ?
a voice channel? then yes
no it's a text channel
there is no "joining" in text channels
really ? but like i tried it and it worked , mean i send an invi and by clicking join button it redirect u to the target channel ?!!!!
by the way am new to discord.js
as said, invites lead to a guild, as a whole and put the channel the invite leads to into focus for the user
the event that emits is thus guildMemberAdd and does not give you any information about the focused channel or invite used to join
no, channel#members filters guild#members by people that can view the channel (in the case of text based channels and categories)
Hope discord will add support for these popups for mobile
Beacuse they still didnt added context menus
modals are already supported on ios, android is having some issues with the rollout, but will happen soon
what will be the added methods to djs14 ?
and they still didnt do context menus kek
kek
got you
guild members get you all members
channel members get you members with permission to view this channel
right ?
*cached members
but yes
Heads up for anyone wanting to test modals, the v14 pr is testable now
no thats not what I said, I said the PR for adding it is testable
exactly that; it's testable from that PR branch
lol
There is docs for modals?
no it didn't even get merged yet, pending pr
Okay thanks
<:_:874569322742308864> Guild#invites
A manager of the invites of this guild
Why this is a issue with djs v14?
you need to pass an object on setEmojis now, (unclear if this is final)
but the object has a name, an id and an animated property
so this will work? { name: ":gem:" }
it should yeah name : "💎"
ok thanks
for specifically slashies, isChatInputCommand
is command could be a context menu as well
it doesn't exist in the latest dev version
let me see, the docs say it does
yeah it exists
show me how you reached the conclusion
IntelliSence doesn't agree ._.
okay fine, show me what interaction is even
hover over it
output of npm ls discord.js
it most certainly exists, reload your ts server, reload vscode
ah yeah now it's fine
thanks
Btw, can modals have select menu input where there would be all text channels in server??
No, as of now, only text inputs are supported.
Sad
don't think that's ever going to be possible, to be fair
seeing that selects are restricted in terms of choices far stricter than the max amount of text channels possible
i suppose they could opt for a channel/role/mentionable etc. selection as they do with slash commands
selects having mentionables + channel options are planned for the future, unsure if they'll stick to it, dunno if they'll add it to modals either
https://github.com/discord/discord-api-docs/discussions/3581
Also autocompleted select menus are planned
can anyone send me the link of discord modal api docs?
<:_:876041770423701554> Discord Developer docs results:
• Change Log: Interaction Modals
• Overlay: Example: Activate Overlay Invite Modal
Thank you
Are there any existing guides for modals? Or they are yet to be released?
alr thanks
anyone know why it doesn't set the activity?
why do you need to change your activity any minute?
add a listener for rateLimit
i believe now it's client.rest.on
someone told me to not do it less than 1 minute
type needs to be of ActivityType afaik
still not
can't you just display the amount of cached users and guilds at once instead of switching over and over?
better to switch
client.on('rateLimited', (...) => { ... shouldn't work?
nah, it is rateLimited though, i did mess that up but the events are now emitted on client.rest
like this?
ya
it doesn't log anything
Is your function even being called?
which one?
The setInterval
Doesn't tell me if it gets called
looks like not
I put a console.log in it and it doesn't log it
nevermind ._.
it log it 1 minute after the bot goes online ._.
because thats how setInterval works?
I thought it run directly when the bot goes online
Well, then you don't need the setInterval lol
I do
const setActivity = () => {
// do stuff
return setActivity;
};
setInterval(setActivity(), 60_000);
you could do something like this if you dont want to repeat code
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\Users\User\Documents\Discord Bots\ApplicationTest\node_modules\discord-api-types\package.json
ah yes, thanks
its some strange changes
requiring more npm packages
how do i use modals
you can require ChannelType etc from discord.js
are upper cased strings like MANAGE_GUILD still valid in GuildMember.permissions#has in v14?
No you’ll need to use a pascal cased string
so only "ManageGuild"?
Yeah
ok thx
see pins/ #769862166131245066
When the pull requests are finished and merged into dev you can
The Discord API is public and usable
It's not in anything yet
Probably
GuildMessageReactions
Additionally ofc Guilds and GuildMessages
If the message isn't cached you'd want to enable the Message partial
<:_:862626783890636830> discordjs.guide results:
• Popular Topics: Partial Structures
• Popular Topics: Enabling Partials
This explains partials but is outdated a bit since it's not for v14
Check the pins to see how to use partials now
if (!Object.hasOwn(given, key) || given[key] === undefined) {
TypeError: Object.hasOwn is not a function
node: 17.5.0
I would Not recommended that
Just wait for the pr to be merged
what happened to Discord.MessageEmbed
moved to builders
so how can i use a embed?
also renamed to Embed instead of MessageEmbed
make sure to read the pins
Still re exported by djs
what the heck its zod
ZodError: [
{
"code": "invalid_type",
"expected": "object",
"received": "string",
"path": [
0
],
"message": "Expected object, received string"
}
]
A validation package
Show your code
const Discord = require("discord.js");
const Command = require('../../Utils/Command');
module.exports = class extends Command {
constructor(options) {
super(options);
this.name = "help";
this.aliases = [];
this.category = "Utility";
this.description = "Shows the command pannel";
this.usage = "commands"
}
async run(client, message, args) {
let moderation = Array.from(client.comandos.filter((command) => command.category === "Moderation").keys()).join(' | ')
let music = Array.from(client.comandos.filter((command) => command.category === "Music").keys()).join(' | ')
let utility = Array.from(client.comandos.filter((command) => command.category === "Utility").keys()).join(' | ')
const embed = new Discord.Embed()
.setTitle(`Bot Commands`)
.addField("**Comandos de Moderación:**", `${moderation}`)
.addField("**Comandos de Música:**", `${music}`)
.addField("**Comandos de Utilidad:**", `${utility}`)
.setColor("#36393F");
message.channel.send({ embeds: [embed] });
}
};
Sorry, im stupid, I dont understand what #addField and #addFields both accept an object or array of APIEmbedField(s) respectively. (add link to dapi site) means
whats dapi site
https://discord.com/developers/docs/resources/channel#embed-object here are the docs for the raw object, check what fields takes in
got it, this helped me a lot, tysm, very unnecessary changes but ok
Wdym? The docs on main are already up to date?
Is the transition from v13 to v14 going to be as dramatic as it was v12 to v13? Or is it mostly just stuff we will barely notice but that will improve performance but causes hardly any changes to our code?
The biggest change for most people is that enums are used instead of strings in many places
Many people will need do some kind of adjustments for that
But in terms of v12 to v13 it’s much smaller
Thanks :)
Will discord.js v14 depreciate message event?
the message create event will still fire, in the future you'll just need an intent to use it
So this means I need to add an intent in code after the update is released?
Whenever discord enforces it
k
You'll still receive messages, just with reduced fields, content wont be included without that intent
am logged in to discord with two different accounts opened in saparated windows
am trying to get all members but all i got is one member even tho i see the other account in 'onligne' section ,??????
what’s an APIMessage?
Raw API message object, not the djs class
What will v14 do that v13 can’t do?
We don't know
how do i make the new discord apps feature that happens when i right click a user
Those are context menu commands
there's a util method that converts color string to number right?
<:_:874569335308431382> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.
what would i change componentType: "SELECT_MENU" to?
H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\form-data\lib\form_data.js:227
} else if (options.filename || value.name || value.path) {
^
TypeError: Cannot read properties of undefined (reading 'name')
at FormData._getContentDisposition (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\form-data\lib\form_data.js:227:40)
at FormData._multiPartHeader (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\form-data\lib\form_data.js:178:33)
at FormData.append (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\form-data\lib\form_data.js:71:21)
at V.resolveRequest (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:3461)
at V.queueRequest (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:2608)
at Y.request (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:5510)
at Y.patch (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:5429)
at InteractionWebhook.editMessage (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\src\structures\Webhook.js:319:38)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ChatInputCommandInteraction.editReply (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:140:21)
anyone know why I have this error?
Expected number, received string
embed.setColor("75b424")
use Util.resolveColor()
wat
<:_:874569335308431382> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.
embed.setColor(require("util").resolveColor("75b424"))?
try it
okay
is there a way to make a modal?

modal submit*
require(...).resolveColor is not a function
Util not util
require('discord.js').Util.resolveColor(...)
still the same with this: interaction.editReply({ files: [{ name: 'cat.jpg', attachment: file }] });
ah right, me dumb 
Or you can just use 0x75b424
ah fixed
now it's erroring my fields:
embed.addField(`[:first_place:] ${obj.member} - ${obj.role}`, `${obj.info}: ${bot.formatNumber(obj.logs)}`)```
it takes an object like .addFields()
time to learn some regex
if anyone could help me out with regex i'd totally appreciate it.. idk if it's even possible with regex
interaction.editReply({ files: [{ name: 'cat.jpg', attachment: 'https:\/\/purr.objects-us-east-1.dream.io\/i\/EFtYj.jpg' }] });
and got the same error
That's literally what I said in the issue. Just install the latest stable /rest version with npm i @discordjs/rest@latest
I had
ahhhhh bruhh
I'm dumb
I thought it will solved it but it's the code that make the error
it's the latest
I just have to wait that the issue get fixed or I can do something? ._.
Reinstall djs
yes
Hey I keep getting this intent error. Any clues how to fix this? RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: GUILDS.
Guilds
no, its pascal case
oh
not just that, you need to use the enums, you cant just put an array of strings any more
you can for intents
ah, sorry
how do you send an embed?
that didn't change, <TextChannel>.send({ embeds: [embed1, embed2, embed3] })
hm
"Expected object, received array"
const initialMessage = await interaction.reply({ embeds: [embed], fetchReply: true, components: components(false) });
show the full error
did you use addFields() ?
addFields, addComponents, addOptions all take multiple objects and not an array anymore.
.addFields(
category.commands.map(cmd => {
return {
name: `\`/${cmd.name}\``,
value: cmd.description,
inline: true
};
})
);
yup, spread the returned array from .map()
<:_:818272565419573308> Spread syntax (...)
Spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.
thx
"GUILD_TEXT" is not int.
read the guide on how to pass intents now
i don't think it's an intent issue
use the enums
where's the list of enums?
sorry not intents, i meant the channel types 
probably in the guide
can't find them
its ChannelType
is it possible to know if we get rate limited or not?
like if some users are using my command for delete messages and the bot hit a rate limit
if a user execute the command again is it possible to check if we get rate limited or not?
client.rest has a rateLimited event you can listen to
.setColor(require("discord.js").Util.resolveColor("RED"))
Unable to convert color to a number.
Red
ohh
just use Colors.Red
but how do I do for check while executing the command?
like this event will only get fired when the bot will hit a rate limit
you can specify a reject on rate limit on your client options
Guys I am not able to find GatewayIntentBits in the docs
global.client = new Client({
intents: [
'GUILDS',
'GUILD_MEMBERS',
'GUILD_PRESENCES',
'GUILD_MESSAGES',
'GUILD_BANS',
'GUILD_EMOJIS_AND_STICKERS',
'GUILD_VOICE_STATES',
'DIRECT_MESSAGES'
],
partials: ['CHANNEL'],
rejectOnRateLimit: (rateLimitData) => { return rateLimitData.match(/\/guilds\/\d{17,}\/emojis/) }
});
has the required property changed at all in application command options?
ah now it'd be on options.rest
dont attach stuff to the global object 
and use RegExp.test()
and you don't need to use curlys and return on the arrow function, just remove the curlys
and those intents/partials arent valid in @dev
same intents as in v13 just in PascalCase
i believe it is just an example
but either way now it'd be on new Client({ rest: {rejectOnRateLimit}
a terrible one at that since its adding properties to the global object
so should i import it from discord.js or discord-api-types/v9. because one source said api types and other said discord.js
discord.js reexports the discord-api-types enums
do i need to use flags on gatewayintentbits
Uncaught Promise Error Call Stack: DiscordAPIError[50035]: Invalid Form Body
41.options[0].type[BASE_TYPE_REQUIRED]: This field is required
not really, discord.js depends on it. youll have it installed whether you use it yourself or not
for intents you can use strings
option 0 on command 41 has no type
42
41, we starting at 0 here, this is js jurisdiction
type: ApplicationCommandOptionType.Integer
but then why isnt it documented
we heavily recommend using enums: https://github.com/discordjs/discord.js/discussions/7380
is integer not an application command option type?
doubt it's that line then
the main doc is not completed yet
oh ok
discord-api-types doesn't have a website
I thought GatewayIntentBits was already a thing
it is, just not in the docs
no like options like this are there so you can add api-types to this
it wont go into that, itll have a separate website
it is
k
k?
what this does?
that specifically will reject on every ratelimit
basically you can specify the routes on which if you hit rate limit, it'll reject the promise with the data
ahhhhhh I think I get it now
so instead of listening to the event you can just catch the rejected promise and do what you want
well, i told you what the error means you said that it's not wrong
so "k" is all i can say, really
listening to the event wont do anything in regards to the promise
like
client.rest.on('rateLimited', (rateLimitData) => console.log(rateLimitData))
will display the route if I get rate limited?
well do you think you can help me find the issue?
i told you the issue
you say that's not it
so no, i guess i can't
among other things
look at the types. the documentation for it tells you what you get
but my initial question was how can I check if I get rate limited or not? (while executing a command)
you could also just forcefully hit a ratelimit (for educational purposes!!!) and see what gets logged, it's not particularly hard
i did do that, hold on let me see if i have the data
you listen to the event, store something else where, and in the command check if that elsewhere is something
what
pretty annoying way but thanks for explication
you specify how long you want to wait in https://discord.js.org/#/docs/discord.js/main/typedef/ClientOptions > rest
(rejectOnRateLimit can achieve that too, makes the returned promise reject when a limit is hit)
do not (!) use the ratelimit event to try and handle ratelimits yourself
thats the only way of achieving what you want ¯_(ツ)_/¯
client.rest.on('rateLimited', (rateLimitData) => console.log(rateLimitData));
if now I'm trying to hit a rate limit it will log the route?
don't you know the route?
no it wont log the route, it will reject the promise that hit the ratelimit (because a string is truthy)
just for example ._.
i forgot what we were dealing with here
if I'm trying to edit channel names, like 2 times every second
will I hit a rate limit?
why, probably yeah
testing this ^
you don't need to test, what do you wanna know?
just wanna see the output ._.
everything has a route, what are you even trying here
{
timeout: 3936,
limit: 5,
method: 'post',
path: '/channels/ID/messages',
route: '/channels/ID/messages',
global: false
}```
rejectOnRateLimit determines which routes should reject if a limit is hit (rejects the returned promise instead of waiting for an answer)
i will give you that code
no need
ok ¯_(ツ)_/¯
check if you have specified all options on the command you are working on
@noble kernel
you have commands that dont have type properties on some of the options
ah lemme see
yeah that's really confusing because all my options have options
and it all worked before i transferred to dev
discord disagrees
well how else can i isolate the issue
this seems to be a discord api update breaking the discord.js builder
they have updated it recently
all 3 of my bots using / commands wont register them
what's changed tho
new option
what new option
idk how it broke this but apprenelty it does
(file upload)
cannot reproduce
u need to import ApplicationCommandOptionType from discord.js
oh-
and then remove the quotes from there
Thanks!
const { ActivityType } = require("discord.js");
bot.user.setActivity("your messages", { type: ActivityType.Watching });
is this correct?
Have you tried it
is that all the code or is that properly in an event where bot is ready
it's in a ready event
const { Embed } = require('discord.js')
module.exports = {
name : "av",
description: "Displays avatar of a user",
run : async(client, message, args) => {
const target = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.member;
const embed = new Embed()
.setTitle(`**> AVATAR of ${target.user.tag}**`)
.setImage(`${target.user.displayAvatarURL({dynamic : true, size: 1024})}`)
.setColor('RANDOM')
.setFooter(`Requested by ${message.author.tag}`,`${message.author.displayAvatarURL({dynamic : true})}`)
.setTimestamp()
await message.channel.send({ embeds: [embed] });
}
}```
error
read the guide, now it takes in a number, you can also use Util.resolveColor
Documentation suggestion for @small mica:
<:_:874573924988518500> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.
Thanks!
PS C:\Users\adema\Desktop\bot-discord-js-v13-main> node .
Bot TESTES2 logado com sucesso em 1 servidores.
C:\Users\adema\Desktop\bot-discord-js-v13-main\src\structures\Client.js:23
this.guilds.cache.get('940700955538759730').commands.set(this.commands)
^
TypeError: Cannot read properties of undefined (reading 'commands')
at module.exports.registryCommands (C:\Users\adema\Desktop\bot-discord-js-v13-main\src\structures\Client.js:23:52)
at module.exports.run (C:\Users\adema\Desktop\bot-discord-js-v13-main\src\events\client\ready.js:12:21)
at module.exports.emit (node:events:520:28)
at WebSocketManager.triggerClientReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:17)
at WebSocketManager.checkShardsReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:367:10)
at WebSocketShard.<anonymous> (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:189:14)
at WebSocketShard.emit (node:events:520:28)
at WebSocketShard.checkReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:475:12)
at WebSocketShard.onPacket (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:16)
at WebSocketShard.onMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:520:28)
at Receiver.receiverOnMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\websocket.js:1137:20)
at Receiver.emit (node:events:520:28)
at Receiver.dataMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\receiver.js:528:14)
at Receiver.getData (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\receiver.js:446:17)
PS C:\Users\adema\Desktop\bot-discord-js-v13-main>
not just you still need to read the guide since your setFooter is wrong
Yeah Ik that I still dint change it
when setting permissions for slash commands, what's the type called for specifying role or user?
shouldn't it be this.client ? Or am I getting it wrong either that or probably Id is wrong ?
this.client where?
@noble kernel ApplicationCommandPermissionType.Role
?
I mean instead of this.guilds shouldn't it be this.client.guilds ? I am not sure how you have coded it , it's probably this or probably guild is not a valid guild because you are trying to access commands from undefined if you see the error
not really no, if that were the case it would just error before
@slim jolt show you're code you're probably accessing a guild before it gets cached
So, I'm just starting this bot journey, which code do you want to see?
I can't use hex for .setColor()?
You can you just need to hex literals they begin with 0x
the documentations for addFields is wrong, they take in multiple Field objects, not an array
so you can simply spread this ```js
.addFields(categories)
That is what I have
spread it, read what i said ...categories
<:_:818272565419573308> Spread syntax (...)
Spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.
Thanks that worked :)
you still need to fix your other fields
client.on("ready", () =>
client.user.setPresence({ activities: [{ name: `Phantom code me!`, type: "WATCHING" }], status: 'online' }),
)
Also this is not shown on my bot's status!
type should be switched to ActivityType.Watching or something similar, now you need to use the enums
Like this?
addField is now essentially just an alias for addFields
You have to pass in an object with a name and value instead of two parameters
👍
C:\Users\adema\Desktop\bot-discord-js-v13-main> node .
Bot TESTES2 logado com sucesso em 1 servidores.
C:\Users\adema\Desktop\bot-discord-js-v13-main\src\structures\Client.js:23
this.guilds.cache.get('838228145865490493').commands.set(this.commands)
^
TypeError: Cannot read properties of undefined (reading 'commands')
at module.exports.registryCommands (C:\Users\adema\Desktop\bot-discord-js-v13-main\src\structures\Client.js:23:52)
at module.exports.run (C:\Users\adema\Desktop\bot-discord-js-v13-main\src\events\client\ready.js:12:21)
at module.exports.emit (node:events:520:28)
at WebSocketManager.triggerClientReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:17)
at WebSocketManager.checkShardsReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:367:10)
at WebSocketShard.<anonymous> (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:189:14)
at WebSocketShard.emit (node:events:520:28)
at WebSocketShard.checkReady (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:475:12)
at WebSocketShard.onPacket (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:16)
at WebSocketShard.onMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:520:28)
at Receiver.receiverOnMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\websocket.js:1137:20)
at Receiver.emit (node:events:520:28)
at Receiver.dataMessage (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\receiver.js:528:15)
at Receiver.getData (C:\Users\adema\Desktop\bot-discord-js-v13-main\node_modules\ws\lib\receiver.js:446:17)
PS C:\Users\adema\Desktop\bot-discord-js-v13-main>
It stays on and then falls
does this support modals?
you didn’t define <Client>.commands
where?
in your code
@slim jolt if you’re not using v14 please use #djs-help-v14 #archive-djs-help-v13
which one to put?
are modals only for dev version?
lol
in v14 will we gain access to the those guildMember banners that have a separate banner as their guild banner and user banner?
No those are only available by manually fetching a member, it’s an API limitation not a discord.js limitation
ok thanks
i get that but its only available for the user object, there is no member.banner only user.banner
user.banner only shows the person's main banner and not their custom set one in the guild
im guessing the api doesnt have it under the members for fetching
A member's banner isn't available in the API (It's still a feature request on the discord-api-docs repo)
Hi
Don’t think so, why?
The message and interaction events are named “messageCreate” and “interactionCreate”
Have you tried select menus?
A reaction belongs to a message & a message belongs to a guild, that is how you get the guild anyhow
The process has not changed since version 13, there should be no trouble
Then what
yeah
your question isn't related to v14 please ask in #djs-help-v14 also reaction.message is Message so u can get guild and from guild u can get all the members
but nothing changed in v14 it's same as v13
it didn't
const embed = new Embed()
.setTitle(`${target.tag} BAKA...`)
.setImage(await anime.baka())
.setColor('#ff0000')
message.channel.send({ embeds: [embed]})```
Why doesn't hex colour work?
What all changes were made to fields?
.addField(
"**General : **",
`**❯ Client :** ${client.user.tag} (${client.user.id}),
**❯ Commands :** ${client.commands.size},
**❯ Servers :** ${client.guilds.cache.size},
**❯ Users :** ${client.guilds.cache
.reduce((a, b) => a + b.memberCount, 0)
.toLocaleString()},
**❯ Channels :** ${client.channels.cache.size.toLocaleString()},
**❯ Creation Date :** ${utc(client.user.createdTimestamp).format(
"Do MMMM YYYY HH:mm:ss"
)}
**❯ Node.js :** ${process.version}
**❯ Discord.js :** v${djsversion}
**>Up Since :** <t:${upvalue}:T>
\u200b`
)
.addField(
"**❯ CPU :**",
`**Cores : **${os.cpus().length}
**Model :** ${core.model}
** Speed :** ${core.speed}MHz`
) ```
This doesn't work
I dint understand the thing about fields in docs
Ok thanks Rin!
was .setThumbnail() changed too?
uh nvm
What all colours are available in Util.resolveColor?
If i try GREEN it shows cannot convert colour to number
If i put blue it shows black
const embed = new Embed()
.setTitle(`${target.tag} BAKA...`)
.setImage(await anime.baka())
.setColor(Util.resolveColor("GREEN"))
message.channel.send({ embeds: [embed]})```
It’s much easier if you use the enum. ie Colors.Green
Ok I'll try it out!
const colour = EnumResolvers.resolveColor()```
How do I use this?
Idk, I dint yet understand the enum stuff. Going thru docs for the 3rd time, but still dint get what an enum resolver is!
How do I use enum then for embed color?
Util.resolveColour doesn't seem to work properly! If I use GREEN, it shows cannot convert colour to a number
okay
Yup that works! Thanks Rin :)
I didn't understand Colors enum, so I will use the method you said!
TypeError: LimitedCollection.filterByLifetime is not a function
How to fix this?
anyone can help me?
iirc that's been moved to Sweepers
How am I supposed to send a button
that hasn't changed really
just that now MessageButton has been renamed to ButtonComponent
that's not even the right syntax
use the builders method instead of passing the values like that, like setCustomId
is there a way to disable writing ability in text channel ?
remove send_messages permission from everyone role
I added .setCustomId but still doesn't work. What am I doing wrong?
const { Message, Client, ButtonStyle, ActionRow, ButtonComponent, Embed } = require("discord.js");
module.exports = {
name: "button",
aliases: ['p'],
/**
*
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const row = new ActionRow()
.addComponents
(
new ButtonComponent().setLabel("Hello!").setStyle(ButtonStyle.Primary).setCustomId('1234'),
new ButtonComponent().setLabel("Hello!").setStyle(ButtonStyle.Danger).setCustomId('534534'),
new ButtonComponent().setLabel("Hello!").setStyle(ButtonStyle.Success).setCustomId('1123'),
new ButtonComponent().setLabel("Hello!").setStyle(ButtonStyle.Link).setURL("https://discord.com")
)
const embed = new Embed().setDescription("Hello! This is how you send buttons with \`v14!\`")
message.channel.send({embeds: [embed], attachments: [row]})
},
};
you meant to use components, not attachments
spread them or pass multiple objects
Wdym multiple objects?
talked about this before, instead of passing multiple raw objects pass new instances of SelectMenuOptions
now this may be fixed in the future to have the raw objects, however i don't see them dropping support for the class so you should be fine
const row = new ActionRow()
.addComponents
(
new SelectMenuComponent().setCustomId('Test')
.setPlaceholder('Choose an option')
)```
How do I use `SelectMenuOption`?
new SelectMenuOption().setLabel('a').setValue('a')
```and so on for all of them
okay ill try it out
yes, for now yes
.setPlaceholder is not a thing?
How do I set placeholder?
alternatively you can do this [obj, obj].map((o) => new SelectMenuOption(o) ) basically construct a new class instance with the values
.setPlaceholder? i haven't checked the docs though so idrk if i got the capitalizations right
Not possible
hm
For me it dint!
then update
you have to pass an emoji object containing a name id and animated property @scarlet tangle
and the setEmojis are still not confirmed to be an intended change
did you update? @small mica @scarlet tangle npm ls discord.js
doesn't work without the [] too!
pretty sure you can
ls?
I did npm i discord.js@dev
@small mica ls should you the version of djs you're using, i'm asking for that
You have clashing versions
none of you are using the latest
npm uni discord-together & npm i discord.js@dev
npm uninstall discord.js npm i discord.js@dev
Still same issue with dropdowns
const { Message, Client, ButtonStyle, ActionRow, ButtonComponent, Embed, Util, SelectMenuComponent, SelectMenuOption, SelectMenuInteraction } = require("discord.js");
module.exports = {
name: "dropdown",
aliases: ['p'],
/**
*
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const row = new ActionRow()
.addComponents
(
new SelectMenuOption().setLabel('a').setValue('a')
)
const embed = new Embed().setDescription("Hello! This is how you send buttons with \`v14!\`").setColor(Util.resolveColor("Random"))
message.channel.send({embeds: [embed], components: [row]})
},
};
My code
i just checked the source and confirmed 
you must pass a class instance
why are you passing a select menu option on a row?
you're supposed to pass the options to a select menu and the menu to the row
i knew i was you just confused me
my god
can you go back? to here?
and on addOptions, you pass multiple SelectMenuOptions
that's all
Sorry if I am being annoying but I still don't get this
addOptions(
new SelectMenuOption().setLabel('a').setValue('a'),
new SelectMenuOption().setLabel('a').setValue('a'),
new SelectMenuOption().setLabel('a').setValue('a')
)```
What is the list of ApplicationCommandOptionType?
type: ApplicationCommandOptionType.Member,```
Doesn't work
You should be using User
So member is no longer available?
I am brain ded rn sorry for troubling you.
what discordjs v14 add ?
would it be worth looking into the dev branch early on to make the necessary changes?
i would say.. no, a lot of the features aren't still finalized, the guide isn't done, apitypes aren't clickable on documentations
and the big features you'd want like attachment options and modals are coming in 13.7 as well #769862166131245066
i'd say.. wait a bit more
👍 thanks
is it stable to use DJS.v14 or not
no, it isn't stable
the modals were added in v13?
#769862166131245066 will be in 13.7
no, #769862166131245066 🐌
oh not yet if i understand
exactly
have modals been merged with dev?
no
is there an ETA?
<:_:874569335308431382> User#displayAvatarURL()
A link to the user's avatar if they have one. Otherwise a link to their default avatar will be returned.
if dynamic was set to true forceStatic would be false
format is now extension
is there something like this:
if (client.hasHitRateLimiteFor('BulkDeleteMessages') return console.log('I cannot bulk delete messages.')
no, but you can use rejectOnRateLimit (or similar) to not queue the request and reject it instead
nice thank you both
const {
Client,
Message,
Embed,
ActionRow,
ButtonComponent,
ButtonStyle,
Util,
ButtonInteraction,
} = require("discord.js");
const fetch = require("node-fetch");
module.exports = {
name: "meme",
description: "Get a random meme from reddit",
usage: "",
category: "fun",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args, color) => {
const row = new ActionRow().addComponents(
new ButtonComponent()
.setLabel("Reload")
.setStyle(ButtonStyle.Primary)
.setCustomId("MemeReload")
);
await fetch("http://meme-api.herokuapp.com/gimme/memes")
.then((response) => response.json())
.then(async (r) => {
const embed = new Embed()
.setImage(`${r.url}`)
.setTitle(`${r.title}`)
.setURL(`${r.postLink}`)
.setColor(Util.resolveColor("DarkPurple"));
const msg = await message.channel.send({ embeds: [embed], components: [row] });
const filter = (interaction) => {
if(interaction.user.id === message.author.id) return true;
};
const collector = message.channel.createMessageComponentCollector({
filter,
})
collector.on('end', (ButtonInteraction) => {
const id = ButtonInteraction.first().customId;
if(id === 'MemeReload') return msg.edit({embeds: [embed], components: [row]})
})
});
},
};
This is not editing the sent message
Even msg.update doesnt work
are the current typings wrong about setColor (they say only number) or is the preview guide wrong?
The preview guide is not fully edited.
Use Util.resolveColor() from djs
tyvm
anyone knows this?
the collector won't end without a time or max option
How do i use the .setEmoji() function from ButtonComponent and the .addComponents() function from ActionRow in this dev version?
you pass an object that has a name, id and animated property
const collector = msg.createMessageComponentCollector({
filter,
max: 20,
})```
Still doesn't update
.setEmoji('🔒') Isn't possible anymore?
Ahh oke thanks
TypeError: MessageActionRow is not a constructor
in dev version
And the .addComponents isn't a array anymore as input
ActionRow
Or am i seeing that wrong
read the guide, @radiant lintel it's ActionRow
yep it doesn't take an array anymore, it takes multiple parameters
I see, thanks
did you click the button 20 times within 3 seconds?
no?
well, you specified max as 20 and only respond to the first collected interaction
I should put the number of clicks in 3 seconds?
whats a ZodError
show your builders code and the error @radiant lintel
input validation error
@small mica use edit, not update
it doesnt say where tho
And has the param of the .setColor from the Embed class to be Util.resolveColor("Red") or is Colors.Red also acceptable?
i know it doesn't, just show the code you last edited
the latter works
i havent edited owt i am just updating to v14
when will they improve the errors smh :(
is this open sourced?
also show me the actual error first
whenever shapeshift is finished
i think its to do with button styles
yeah probably, change that, the guide explains this part
you can search and replace you know
but i need to add al the new requires to
as the guide says```js
const { EnumResolvers } = require('discord.js');
const enumValue = EnumResolvers.resolveButtonStyle('PRIMARY');
there
that you can do later on and it'll be relatively simpler
Where can i find the option APIEmbedField examples and how they look like?
try{
member.send({embeds: [ embed ]});
} catch(error) {
console.log(error);
}
}
what do i replace Permissions.FLAGS.EMBED_LINKS with
try{
member.send({embeds: [ embed ]});
} catch(error) {
console.log(error);
}
}
Read your error
yea i have but it dont work
you'll need to await the send to actually catch the error
holy crap thank you
PermissionsBitField.Flags.EmbedLinks
the guide mentions this 🙃
What do you guys prefer? As example at a embed color Colors.Red or Util.resolveColor("Red")
i replaced all my button styles with the .setStyle(Discord.EnumResolvers.resolveButtonStyle('PRIMARY')),
but im still getting the ZodError when running a slash command