#djs-in-dev-version
1 messages · Page 11 of 1
at Object.execute (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\events\bot\interactionCreate.js:39:25)
at Client.<anonymous> (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\index.js:147:48)```
You sure?
yes its saying 3 files
idk what tf im looking for tho
at Object.execute (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\commands\server\help.js:14:14)
message: 'Expected number, received string'
setColor takes a umber now
0x0068ff you can use that ig
does that mean you cant use random color
Documentation suggestion for @radiant lintel:
<:_:874573924988518500> (static) Util.resolveColor()
Resolves a ColorResolvable into a color number.
Does it matter whenever you use the EnumResolver method or the ButtonStyle class method to pass in a button style
i told you to use stack-trace-limit
node --stack-trace-limit=20 file
eb!eval client.guilds.cache.get('870712939559129199').leave()```
Why is this not working?
TypeError: Cannot read properties of undefined (reading 'leave')```
bad id
if the client isn't ready, how is the eval executing
v14????????????
read the entire thing...
v14 prep
djs-at-dev
ik i mean it will be out soon?
maybe, maybe not
still no eta
or rather, eta: when it's ready
whats GUILD_VOICE as an int
you're meant to use the ChannelType (s...? idk) enum there
ty
{ // Perm 1
id: interaction.guild.id,
deny: ['View_Channel', 'Send_Messages'],
},// Perm 1
{// Perm 2
id: interaction.user.id,
allow: ['View_Channel', 'Send_Messages'],
},// Perm 2
whys this invalid
its not in all caps
ViewChannel, SendMessages?
yes it was
these changes seem unecicary
how do i set an emoji in a button now
not even .setEmoji({ name: ':lock:' }) works
it's not supposed to
\🔒
hm
yes and see what you sent
This chamnnel been here a while
Oh
The dev version is released with new commits every 12h iirc
Oh thanks, I didn't know that
if (fields) embed.addFields(fields)
{
"code": "invalid_type",
"expected": "object",
"received": "array",
"path": [
0
],
"message": "Expected object, received array"
}```
Usually people ask questions
mine is why do i get that error
i think their needs to be a lot more depreciation messages instead of it just straight up not working
there could be some new deprecation notices for 13.7 but it's unnecessary for dev
if you want stability, you should stick to the stable releases
does the guide have modals?
not yet
are they even in discord js dev yet or still in PR stage

Then you know the answer
What's the difference between the Unsafe Embed builders, and the Safe ones?
or do they just not have validation?
usafe does no input validation
So while faster/same speed as before It could cause problems if you mess something up?
yes. builders was meant to always validate input, the unsafe versions are just for the performance kids
What?
I see. I mean the time difference isn't that big Anyways its not like its End all be all of embeds.
I am not a kid

Please move to #archive-offtopic or #official-shitposting
Please stop spam tagging me 👍.
Djs v14 again code 0_0
https://lunus.xyz/mppHBC.png
installing from the modals pr totally fails
could be me not understanding NPM however
Since the main branch is now a monorepo, you can't install it with npm like that anymore.
I have no idea how to install it myself 
you'll need to clone and build the entire thing then use yarn link or something
TypeError: Cannot read properties of undefined (reading 'map')
at new UnsafeSelectMenuComponent (/root/ObitoInteractions/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:5734)
at new SelectMenuComponent (/root/ObitoInteractions/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:3:6428)
at new SelectMenuComponent (/root/ObitoInteractions/node_modules/discord.js/src/structures/SelectMenuComponent.js:8:5)
at Object.execute (/root/ObitoInteractions/commands/context-menus/Social.js:84:5)
at Object.execute (/root/ObitoInteractions/events/interactionCreate.js:70:31)
at Client.<anonymous> (/root/ObitoInteractions/Structure/Client.js:47:37)
at Client.emit (node:events:390:28)
at InteractionCreateAction.handle (/root/ObitoInteractions/node_modules/discord.js/src/client/actions/InteractionCreate.js:72:12)
at Object.module.exports [as INTERACTION_CREATE] (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
the line 84 is new SelectMenuComponent()
update djs to the latest
did
anyone know?
I got the same error when doing this
okay back on pc
let me check the source
@tame gazelle could you show me what data is?
and what errors? the addOptions or the new SelectMenuOption?
the line 84 is new SelectMenuComponent()
stack trace here ^
could you try this instead?
addOptions(data.map({label, value} => ({label, value})) )
also show me the output from npm ls @discordjs/builders
didn't get this
okay no i'm brainfarting, i don't get what's going on
._.
@urban belfry do you want access to my guide PR branch?
no
thanks though :)
You sure? It’ll make any changes you want to make faster
i would, that's great but i'm busy sorry
Alright no worries
fine if I send it directly?
or you prefer a bin
yeah sure
anything but pastebin, sourcebin works
siris don't get me wrong, if i could, i would make the changes myself, i know my prs changed a lot
@tame gazelle only the part i need to reproduce the error
i'll assume it's from the const data to forEach
reproduced, let me check
.addOption not addOptions? idk, just taking a shot in the dark tbh
Documentation suggestion for @zenith vault:
<:_:874569335308431382> MessageSelectMenu#addOptions()
Adds options to the select menu.
Try
let mappedData = data.map((d) => new SelectMenuOption(d));
row.components[0].addOptions(...mappedData);
// or maybe you don't need to spread the array:
row.components[0].addOptions(mappedData);
there's something wrong
the source says it uses optional chaining but for some reason this code accessing undefined
same error for both
What if you just .addOptions the data directly? From the docs it actually might work
^
@urban belfry we’ll be sticking with objects only for emojis
okay then thanks for confirming
just calling new SelectMenuComponent() causes the error
for my problem I can't do anything?
we tried all solutions ._.
Did you import/require it? Its a dumb question and I'm sure you did, but its the only thing I can think of lol
no for some reason just creating a new SelectMenuComponent errors
As in, its an issue with DJS?
probably
Nice
Feel free to create an issue ticket for any bugs 🤗
okay @tame gazelle try installing builders and requiring SelectMenuComponent from that
thanks a lot 🙏
i'll see how i can fix this on djs
@velvet jasper sorry to bother but do you have any idea what this is doing?
class SelectMenuComponent extends BuildersSelectMenuComponent {
constructor(data) {
super(Components.transformJSON(data));
}
}
```?
It’s transforming any camel case json to snake case
well it's causing the error we're talking about
TypeError: Cannot read properties of undefined (reading 'map')
at null.UnsafeSelectMenuComponent (G:\Test\MasterBranch\node_modules\@discordjs\builders\src\components\selectMenu\UnsafeSelectMenu.ts:18:24)
at null.SelectMenuComponent (G:\Test\MasterBranch\node_modules\@discordjs\builders\src\components\selectMenu\SelectMenu.ts:14:8)
at new SelectMenuComponent (G:\Test\MasterBranch\node_modules\discord.js\src\structures\SelectMenuComponent.js:8:5)
at Object.<anonymous> (G:\Test\MasterBranch\src\teest.js:26:9)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
looks like they're using an outdated version of /builders
UnsafeSelectMenu.ts:18:24 is whitespace
SelectMenu.ts:14:8 is a method definition
no it's not, i did it myself
if i remove super(Components.transformJSON(data)); and just call super, it works
using djs, latest version
const {SelectMenuComponent} = require("discord.js")
console.log(new SelectMenuComponent())
```just this causes the error
that method doesn't even exist anymore
what method?
this is what djs does for some reason and this is causing the error
cannot replicate on the main branch
show your code and version
main branch, the code you sent here
replaced require('discord.js') with require('./packages/discord.js')
scratch that, can replicate now, but the error is slightly different
what is it?
i don't get why we need to call transformJSON here, builders already accepts what we input with djs
It doesn’t accept camelcase
oh and djs does
Yeah
i don't get why it'd cause the error still
well i'll look into it when i get back home in that case
ok, after properly setting up the repo (yarn, yarn build, then run the demo.js file) it works
so what, it's fixed on main just not pushed yet?
the error doesn't exactly make sense in the main branch as everything is using optional chaining, probably just a version mismatch on the dev release?
i guess so
exactly
i've read the compiled code, it's exactly the source just not using optional chaining
ah yes i see
it is using outdated code
try installing @discordjs/builders@dev
Why can you pass strings to allowedMentions.parse, but in all other places you need to pass a enum member?
Because the API expects strings there
It is not a numeric value and so an enum wouldnt make any sense
Any clue on this? New in v14
something that is an array of objects, the first items value property should have been a string and you passed a number to it
Which is weird because i haven't changed anything except updating the the version
actually looks like its coming from <Embed>.addFields
Embed fields must be strings
when this version release
Yes
u know when it release?
No
When its ready
o
how do you provide a hex code to setColor for embeds now?
Hex number literal
0xFFF
ohhh, im dumb. thanks!
can i ask a question here
If it’s related to v14 sure
ive got no idea what that is
but basically i tinkered around with discord js when i was much younger
Ok then probably the wrong place to ask
ok where can i ask
thanks
whats new in v14?
popup forms
are they pushed to v14 yet?
no
is it possible to get who created a channel in channelCreate event because I am having a hard time and there is no properties or method for that
No, fetch the audit logs
oh big brain
I did not thought that
yes the modals PR is open. 
it is since 4 months
what is the best way to handle multi player responses?
its been as a draf for ages
not d.js related #useful-servers
Guys, can i somehow dont reply to select menu but also dont give interaction failed?
Or i should just make this like /config chatguard ignoredchannels: channel1ID, channel2ID.... (typing all channels ids you want to be ignored in string)
collector?
Question: how build source to discordj.js dist ?
You don't?
was this changed in latest version,
await interaction.editReply({
embeds: [
{
title: "Help",
color: 0x5865f2,
description: "This is a sample description about help",
image: {
url: "https://i.imgur.com/AfFp7pu.png",
},
},
],
components: [
new ActionRow().addComponents([
new ButtonComponent()
.setStyle(ButtonStyle.Primary)
.setCustomId("fsdfds")
.setLabel("aa"),
]),
],
});
This results in TypeError: t.toJSON is not a function
oh it's not an array anymore. thanks
do I have to specify the component type?
Yes I guess
May I know why GuildChannelManager#create marked as deprecated?
iirc it's the arguments that are deprecated
it's a bug, only the creation of store channels is deprecated. I thought the typings issue was fixed in dev
Yep, the types are broken on latest stable
you can safely ignore it for now, unless you were to create store channels
(node:5840) DeprecationWarning: Passing strings for MessageEmbed#setAuthor is deprecated. Pass a sole object instead.
<MessageEmbed>.setFooter() and <MessageEmbed>.setAuthor() now each take an object:
- embed.setAuthor('This is an example text', 'https://exampleicon.com', 'https://websiteofauthor.com')
+ embed.setAuthor({ name: 'This is an example text', url: 'https://websiteofauthor.com', iconURL: 'https://exampleicon.com' })
- embed.setFooter('This is an example text', 'https://exampleicon.com')
+ embed.setFooter({ text: 'This is an example text', iconURL: 'https://exampleicon.com' })
tysm
am running a peace of code when the embed is done updating
this peace of code running successfuly , which mean the update process is also successed, but the image inside the embed is not changing ??? no errors have occured !!!!!!!!
Clear the attachments a file array
i attache a new image through the updating , so it'll overwrite the old one
piece*
🤓🤓🤓🤓
Kindly keep your comments to yourself
Are there any plans on only supporting ESM in the future?
And alienating a large portion of our users? No
Ah awesome. Got alienated by bunch of libs that's why I asked
we do support esm in node
Yeah yeah I know. Was curious if commonjs support gonna drop in the future or not
this is a bug, I'll submit a fix today
are you using exclusively builders?
what does your code look like?
the workaround for now is to not use json and use only builders
components: [new ActionRow().addComponents(button)]
hmm that should work
What is your dev version
how did you define Embed?
I mean, usually in the package.json is listed the specific version, not the tag so that you know what specific version are running
hello and normal that the latest version of v14 comes out the error:
components[1].components[0].type[BASE_TYPE_REQUIRED]: This field is required.
discovering that this error gave with the buttons if they are used so:
new ButtonComponent({
custom_id: "test",
style: 2,
label: "hello"
})
//or
new SelectMenuComponent()
.setCustomId("cat")
.setPlaceholder("Choose a category")
.addOptions(...options.map((option) => new SelectMenuOption(option));```
I believe that is pending a fix
so it's a momentary error, right?
Hopefully
😅
hey guys how do i work with SubCommandGroup?
I mean could be that it will happen with v15 idk
yes because discord.js will release v14 and then v15 on april 30th
Surprisingly we don't use version 14 yet about 1 second after its announcement
i meant will you lol
v9 is then just deprecated, not removed so a later release with v15 with v10 would be possible if the bot is not verified ^^, but i see it seems to be that you guys take questions to seriously
will api v10 be on djs v14?
lol ok everyone's asking the same question not just me
ok the answer is yes ig
yeah
Yep
pin this please or pin a diff one idc so not 300 people ask
Discord.js v14 will support/use api v10
#7464 in discordjs/discord.js by suneettipirneni opened <t:1644852531:R> (review required)
fix: use case converter for json component serialization
📥 npm i suneettipirneni/discord.js#fix/json-component-serialization
are PermissionBitField#Flags values PascalCased?
yes
no, you don't need to change anything, you'll just have to wait for that PR to be merged
I think this version: https://www.npmjs.com/package/discord.js/v/14.0.0-dev.1644710826.f495364
yeah every dev release is deprecated when a new one comes
it doesn't really matter
const fetchedLogs = await channel.guild.fetchAuditLogs({
limit: 1,
type: 'CHANNEL_CREATE',
});
has the type been PascalCased? also how to get the bigint of the type?
Type is PascalCased yes
why
am trying to upload my bot files to github repo
when i do so i get alerted from discord and they change my token
even tho i put my token within a .env file and ignore it with .gitignore
??
how is that djs related if you cant hide your token properly
{
name: 'Calculate',
type: 'MESSAGE'
},
i cant find Message in the ApplicationCommandOptionTypeEnumResolver, so wheres it?
Maybe it's not there because that type doesn't exist
so it just has to be Message?
Let me rephrase
That type doesn't exist
Here's a list of what you can choose
https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
that is a context menu object
New response: you're looking in the wrong place
It's not a command option type
ApplicationCommandType is what you're after, not ApplicationCommandOptionType
ooh ok thx
components[0].components[0].emoji[MODEL_TYPE_CONVERT]: Only dictionaries may be used in a ModelType
what is this?
It's an error from Discord
check the component you are trying to send
btw fixed that, i had to turn the emoji string into an object, but i have another problem
const e = {
description: 'whatever',
footer: {
text: `Footer`,
icon_url: message.author.displayAvatarURL()
}
}
footer is not showing at all, why?
Does anyone know if its possible to create a Modal collector?
like the same as a button/select menu collector
We’re thinking about adding something analogous to that
oh so its not added yet
can you show more code like the embed part
const e = {
author: {
name: message.author.tag,
icon_url: message.author.displayAvatarURL()
},
title: 'Uptime',
description: `I've been online, without disconnecting, since <t:${uptime}:R>, <t:${uptime}:F>`,
footer: {
text: 'Requested by ' + message.author.tag,
icon_url: message.author.displayAvatarURL()
},
timestamp: new Date(),
color: client.embColor
}
everything is showing but footer is not
i also noticed that with embed builder the footer is showing. but copying the embed object produced by the builder and using that to define the object of the embed fails to show the footer, so what?1
im getting this error
TypeError: Cannot read properties of undefined (reading 'name')
when running this code
https://paste.gg/p/anonymous/e6037652f7d04be2af379eda25e3d98e
full error?
TypeError: Cannot read properties of undefined (reading 'name')
at FormData._getContentDisposition (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\node_modules\form-data\lib\form_data.js:227:40)
at FormData._multiPartHeader (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\node_modules\form-data\lib\form_data.js:178:33)
at FormData.append (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\node_modules\form-data\lib\form_data.js:71:21)
at V.resolveRequest (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:3461)
at V.queueRequest (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:2608)
at Y.request (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:5510)
at Y.patch (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:5429)
at InteractionWebhook.editMessage (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\node_modules\discord.js\src\structures\Webhook.js:319:38)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ChatInputCommandInteraction.editReply (C:\Users\User\Documents\PlanetEarthMC\PEMC\PEMC Master BOT\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:140:21)
i think its to do with edit reply maybe
has editReply been changed in v14?
?
is there any enum resolver for the guild audit logs entry types?
is i put a string here it throws a discordapi errir
Known bug, see https://github.com/discordjs/discord.js/issues/7444
ty
There's already a PR linked btw so it'll probably be fixed soon
does anyone know?
Can i react to a slash command?
me: /test
bot: reacts 👀to /test
Slash commands don’t create a message until you reply
i see, thx
i've just migrated my bot over to d.js14 and i can't figure out why this is erroring
it was perfectly fine on 13 which is confusing me, am i using the wrong classes?
this is a bug currently that has a fix en route
oh alright, thanks
does anyone know???
does it throw an error ?
am trying to send mentions inside the embed title but it just displays the mention syntax, why ?
Because embed titles dont support rendering mentions
okey thanks
does fields support it ?
name no, value yes I think
yeah, value does
is it better to install all dev version for discord.js submodules?
like @discordjs/builders@dev etc
nothing, the footer is just not showing at all
in v13 it worked
i will retry later today then ill open a github issue ig
To confirm, v14 will use the discord API v10, and v13 willl not be backported to use the discord API v10?
v10 is available in the latest @discordjs/rest version?
if yes, is it better to put new REST({ version: '10' }) ?
Better than?
v10 didn't release yet, did it?
it's available but v9 is still the stable if I understand correctly
rest is literally just a way to send api requests
of course you can use it
yes but is it better to use v9 or no?
since v14 will use (or actually does, dunno) I would say yes but not sure
10 is more elegant than 9, I agree
are you people literally comparing numbers and saying which one looks better?
do you know the changes to the api?
yes
10 looks nicer indeed
and no for the 2nd question
no one cares if you approve, that's wrong, everything does not work, there are breaking changes
don't randomly switch just because a number looks nicer
but you didn't test everything because you possibly couldn't have
Read it again
but you didn't test everything because you possibly couldn't have
You can’t answer “yes” to that
Shitposting in help channels also makes you get nice mod actions 
Hey have modals been merged yet? Or are they usable in any way?

👍 👍
yes, they have.
At least CommandInteraction and every class that extends on that
Hello, did ActionRows change in some way in v14? I'm getting an Invalid Form Body error while trying to port an action row response containing a select menu when porting my code from v13
is the error of attatching files on edit fixed ?
no
Does .addComponents no longer exist on actionrows? I couldn't find it on the v13 -> v14 guide
Only stuff that changed is in there. It's a migration guide
it still exists
I'm getting (typescript)
it's a method no? ._.
?
it's a method not a property
show your code if you don't know what idris means
Well, my typescript says it isn't, are the types bugged or do I need to pass a generic or smth
new ActionRow().addComponents({ name: 'e', value: 'e' })```
I can't reproduce that, I get this error as expected
Try installing the dev release again?
There should be 1 new commit since that hash
Could be an installation issue
k
The only other explanation would be maybe you've imported "ActionRow" as something else that isn't an action row
14.0.0-dev.1644797187.0dfdb2c is the latest, there also doesn't seem to be a real current dev release? at least its all marked as deprecated versions 
https://imageing.eu/shared/HBGMcTh.png
Probably https://github.com/discordjs/discord.js/issues/7467 then
Yes
Nice embed
I'm totally testing this TypeScript issue in the discord.js codebase in a TypeScript file, btw
Does anyone know if there is a way to hide the modal after submitting without having to reply/deferReply a new message?
Acknowledging the modal is Discord's only way of knowing you replied to that interaction
So I would think not - there is no way to do that
Curious, what are you trying to do?
basically what i do is create a message first with a button, then after you click the button it opens up the modal.
Then what
I meant like, what is your use case where you don't want to reply when someone submits in your modal
i want it to hide then edit the original message with the submitted info
// ready
client.guilds.cache.forEach(guild => {
guild.invites.fetch().then(invites => this.client.invites.set(guild.id, invites)).catch((error: Error) => { return });
})
const invitesCache = client.invites.get(member.guild.id);
const guildInvites = await member.guild.invites.fetch();
client.invites.set(member.guild.id, guildInvites);
const usedInvite = guildInvites.find(invite => invitesCache.get(invite.code).uses < invite.uses);
returned undefined. Help me, pls
Are you even returning, there's no context to this
Give an ephemeral reply in that case
Random
i thought i could use deferUpdate() like with buttons/select menus but i get this error:
TypeError: interaction.deferUpdate is not a function
PascalCase ?
or Gold
check docs
couldnt find any changes in docs
cuz its not yet documented, it takes a number, use Util.resolveColor from djs
well it is documented, but not in the update guide
hex with 0x prefixed works too
I meant component type undefined
well, that take that reply in regards to your color problem 
yes thank you
#7431 in discordjs/discord.js by monbrey opened <t:1644395181:R> (review required)
feat(modals): modals, input text components and modal submits, v13 style
📥 npm i monbrey/discord.js#modals
#7023 in discordjs/discord.js by suneettipirneni opened <t:1637621711:R> (changes requested)
feat: Add Modals and Text Inputs
📥 npm i suneettipirneni/discord.js#feat/text-input-interactions
theres v14
You need to wait that that PR gets merged
Probably after requested changes are addressed
you can install the PRs from the commands above ^ @scarlet tangle
7431 - v13
7023 - v14
As you can see above there are already open PRs to add modals. Attachment option is already merged iirc
what will be modified? both are already released and now the pr's just need to be merged
at least the modals pr has examples in the pr description
what do you mean by official structures
if you want to know how it looks like on the api side, look at the discord api docs
there are pending prs, they may or may not change, this is why we're recommending you wait till they get merged
after modals get merged you should be able to use it installing the dev branch, on v13, when 13.7 comes out
at least when the dev ci isn't failing anymore 
when they're ready, they'll be merged
they will be released in v13.7
merged whenever they are ready to be merged
its not a v14 feature
when its merged and the dev version updated, yes
good for you I guess?
How long is v14 estamates to release?
at least 42 years
Epic
100 years of how many times people asked that question
shitposting can go somewhere else
the ETA is "when it's ready"
For the modal pr... is there documentation on how to use it?
There is on the pr
where
The PRs that arent merged yet?
is that v13?
no, bc this is a v14 channel
so where should I ask for v13 help with it?
probably nowhere since it's not merged yet, but you can try #djs-help-v14
Is the plan for it to get merged or wait for v14
both of the PRs will be merged at some point the v13 one isn't waiting for v14 to come out
kk thanks
Theres no documentation for something that isnt merged yet, correct
i was reading the guide but what do they mean by #isGroupDM when bots cannot join groups?
bots can create groups and add ppl via ouath2 iirc
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
const config = require(`./botconfig/config.json`);
const settings = require(`./botconfig/settings.json`);
client.on('ready', () => {
console.log(`Logged as ${client.user.tag}!`);
});
client.on('messageCreate', (message) => {
if(message.content === 'ping') {
message.reply('pong')
}
})
//Start the Bot
client.login(config.token);
why when i write ping nothing happens?
no errors
"discord.js": "^14.0.0-dev.1644969977.c1b27f8",
you need the GUILD_MESSAGES intent
thx
interaction.member.roles.highest.comparePositionTo(member.roles.highest) < 1
this only compare if the member is higher not equal right?
Negative number if this role's position is lower (other role's is higher), positive number if this one is higher (other's is lower), 0 if equal
so if I wanna check if the role equal or higher I have to do
interaction.member.roles.highest.comparePositionTo(member.roles.highest) < -1
no, > -1
note, it checks if interaction.member's highest role is higher or equal to the member's highest role
it was merged 3 days ago, but the dev ci was failing, thats why its just now
Ah alright.
keep chit chat out of support
Modals are supported in djs14 ?
is there a way to upload images to modals?
modals do not accept attachments
and how to upload attachments to slash commands?
you use the attachment option https://discord.js.org/#/docs/builders/main/class/SlashCommandAttachmentOption
PR's merged should be fixed in the next dev release
there's a PR about SelectMenuComponent?
wdym
does someone know why its saying that? :0
your bot never replied
I did
I doubt that
code?
@velvet jasper ^
:)
idk how to reply
<Interaction>.reply()
oh lol I tought its working with modal.send or smth ty
I'll just wait til its released
I think that's been fixed do you mind testing the latest dev release to verify
im using some npm package cuz idk how to install the dev version
sorry but we don't offer support for addons
You could however test the v13 one
I cannot test because of the component type error ._.
ok but im pretty sure it's fixed
when was it fixed tho
or what pr did it
cuz the latest dev release was 3 hours ago, #7464 (which I think is that pr) was merged 2 hours ago
I believe the getters PR, it uses options?.map which means the error in Ben's message should no longer be possible
oh, we talked about different things 🥶
were u talking about the component type errors?
they're using a third party package
idk but it's not worth using it bc djs will have it soon anways which means you'll have to rewrite
bc ur using a third-party package
I installed
that command doesn't work
you need to clone the repo and link it
can you send me the repo?
it's the base branch of the PR
also this code is wrong, please look at the example in the PR description
this?
https://github.com/suneettipirneni/discord.js.git thats the link if I clone the repo
yes
how do I specified the person who can see the message sent by my bot?
this is topic not related to v14, please use #djs-help-v14 or #archive-djs-help-v13
OK thanks
Cannot serialiaze component type
Whats this
can you provide the full error?
This one
components have to be in an action row
Alr its in?
for resume, the thing with calling SelectMenuComponent is fixed and the component type error will be in the next dev version?
how to install the dev version with modals? (and how to use modals?)
npm i discord.js@dev
It’s not out on dev
where I can download it?
You can’t; you’d have to clone the repo and manually link it. If you’re unsure on how to do that, then you’ll need to wait for it be merged
@scarlet tangle
v13 - npm i monbrey/discord.js#modals
v14 - npm i suneettipirneni/discord.js#feat/text-input-interactions
The install link for v14 won’t work
How would I pass a default emoji to a .setEmoji now that we can't pass strings
{ name: 'emoji' }
and I can normally use this?
a thx
const buttons = new ActionRow({
components: new ButtonComponent({
style: ButtonStyle.Primary,
label: 'Previous',
customId: 'previous'
}, new ButtonComponent({
style: ButtonStyle.Primary,
label: 'Next',
customId: 'next'
}))
});
const curPage = await message.channel.send({ embeds: [pages[page].setFooter({ text: `Page ${page + 1} / ${pages.length}` })], components: buttons });
Returns TypeError: data?.components?.map is not a function
components is an array
Ah
ok I installed it but the pr tut isnt working
How did u install it?
uhm yes?
is there a PR about <SelectMenuComponent>#addOptions() ?
but I can update to V14, right?
const buttons = new ActionRow({
type: ComponentType.ActionRow,
components: [new ButtonComponent({
type: ComponentType.Button,
style: ButtonStyle.Primary,
label: 'Previous',
customId: 'previous'
}), new ButtonComponent({
type: ComponentType.Button,
style: ButtonStyle.Primary,
label: 'Next',
customId: 'next'
})]
});
so should I install the V14 version?
@velvet jasper
Whatever version you’re running is the version you install. I’m not going to continue giving advice for using this, I’ve explained multiple times what to do. If you’re unsure how to follow those steps wait for the prs to be merged
You're not closing the first ButtonComponent correctly.
And instead got two ")" at the end of the array.
Fixed that but I still get the same error
Did you also fix the components in your send function?
Should be "components: [buttons]" instead of "components: buttons"
apparently that was no longer an array
huh it works
Note to self: dont use the search function for answers
xd
yeah
I tought its a function
thats my code btw
its showModal()
thanks man I'll try it 1 sec
H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\zod\lib\types.js:175
throw result.error;
^
ZodError: [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [],
"message": "Required"
}
]
at new ZodError (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\zod\lib\ZodError.js:80:28)
at handleResult (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\zod\lib\types.js:115:21)
at ZodString.ZodType.safeParse (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\zod\lib\types.js:191:16)
at ZodString.ZodType.parse (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\zod\lib\types.js:172:27)
at MixedClass.addChoice (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:10600)
at H:\IdrisGaming\Discord Bot\ObitoInteractions\commands\moderation\ban.js:22:14
at MixedClass._sharedAddOptionMethod (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:14694)
at MixedClass.addIntegerOption (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:14527)
at Object.<anonymous> (H:\IdrisGaming\Discord Bot\ObitoInteractions\commands\moderation\ban.js:18:10)
at Module._compile (node:internal/modules/cjs/loader:1103:14) {
issues: [
{
code: 'invalid_type',
expected: 'string',
received: 'undefined',
path: [],
message: 'Required'
}
],
format: [Function (anonymous)],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)],
flatten: [Function (anonymous)]
}
I'm using the dev version of builders
dunno if it's an issue or something changed
addChoice, they now take an object
what field is required?
wait what? what are you running? the modals pr didn't get merged yet, right?
Nope
u can install it with npm i github:monbrey/discord.js#modals (ig)
then why not bug the pr author for it 
They’re running v13 modals
does someone know why its showing that error?
thanks
hello, when i try to create an embed it gives me this error:
TypeError: Discord.MessageEmbed is not a constructor
Discord.Embed
Haha no, none of the addMultiples take areays now
Rest parameters
it is a constructor?
ok, thanks
btw adding select menu options will now accept objects instead of exclusively just classes
So both the class and the object?
Wait why?
Don't you have intellisense to help you
honestly one of the main reasons I use typescript is so I don't have to memorize specific props/combinations 
That's about the only reliable source now since the guides unfinished and the docs are wrong in places
i have a question, the number of characters is customizable?
Yes you can set min/max
Oh, amazing
On the other hand, can we use several options or not?
wdym by several options? Like several text inputs?
You can have up to 5 in a modal
Amazing! Thanks!
someone can help me with this error:
[
{
"code": "invalid_type",
"expected": "number",
"received": "string",
"path": [],
"message": "Expected number, received string"
}
]
You passed a string to something that expects a number
node --stack-trace-limit=20 fileName 
same
Go higher then
And do you know when it will be possible to include files in slash commands, or offer images as options?
Alright, you manage crazy anyway
node:events:504
throw er; // Unhandled 'error' event
^
ZodError: [
{
"code": "invalid_type",
"expected": "number",
"received": "string",
"path": [],
"message": "Expected number, received string"
}
]
No you should see the line in the error
What i sent you would give you a bigger stack
If not show me the output of node --enable-source-map filename or whatever it was
mhh, it is on:
.setColor("#000c4a")
setColor expects a number, use 0x000c4a instead
thanks a lot
what do you mean by "convert to it"? a hex string to a number? exchange # with 0x and drop the quotes
And last question, hope i'm not bothering you, do you think it will be possible to put an image type to a model?
Okay, thanks
Is it generally somewhat safe to use v14 yet? Or shall i wait longer to avoid major code breaks
Its never safe until it releases
Honesty I keep falling into the trap of thinking “hey we’ve made the major changes” and then continue to add a large breaking change so 
Ahhh, i get that, also thanks, ill give it some time before i start updating my code base
no
Spam…
<@&839912195994812420>
Ty
Has it been merged?
Attachment option yes (https://github.com/discordjs/discord.js/pull/7203)
It's in the Dev version probably
available in builders dev version
it does
Intellisense isnt documentation
It's probably erroring because you haven't passed any options to it properly
There's a line under that too
I don't know what it would be expecting though
What does it think the error on the addAttachmentOption brackets is
Hmmmm wtf argument is it expecting
And this is on latest commit?
its expecting the ... options for the option (name, description, etc.)
setRequired() is used on options and not on the command
This looks like a case of 
.setRequired() should be in .addAttachmentOption() no?
not outside
intellisense is telling them they're doing stuff wrong but apparently its not enough ¯_(ツ)_/¯
ok tbh i was thinking v14 is a joke like you are not going to launch it but not i think its real so just tell me what changes has to be made ?
read the pins
ok
TypeError: t.toJSON is not a function
at H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:6116
at Array.map (<anonymous>)
at SelectMenuComponent.toJSON (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:6107)
at SelectMenuComponent.toJSON (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:6510)
at H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:3616
at Array.map (<anonymous>)
at ActionRow.toJSON (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:3607)
at H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\src\structures\MessagePayload.js:135:30
at Array.map (<anonymous>)
at MessagePayload.resolveBody (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\src\structures\MessagePayload.js:134:49)
is there a PR for this?
Can you provide the code that causes this error?
also make sure you're using the up to date djs
<SelectMenuComponent>#addOptions({ label: 'string', value: 'string' })
make sure you're updated because now it supports objects
could you show the output from using node --enable-source-map fileName?
fileName should be the command file or the main file?
the main file
source-maps 
and now I run the command with the bad code?
yep
Yeah it doesn’t support objects yet
._.
it doesn't? oh i must have misread, i thought they already do
but it's the plan, right?
#7466 in discordjs/discord.js by suneettipirneni opened <t:1644883949:R> (approved)
feat: add missing v13 component methods
📥 npm i suneettipirneni/discord.js#feat/component-equality
It says that bc classes are technically objects
TypeError: t.toJSON is not a function
at H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:6116
at Array.map (<anonymous>)
at SelectMenuComponent.toJSON (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:6107)
at SelectMenuComponent.toJSON (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:6510)
at H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:3616
at Array.map (<anonymous>)
at ActionRow.toJSON (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:3:3607)
at H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\src\structures\MessagePayload.js:135:30
at Array.map (<anonymous>)
at MessagePayload.resolveBody (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\discord.js\src\structures\MessagePayload.js:134:49)
well yeah it doesn't support objects yet
you'll need to pass SelectMenuOption class instances
also is making zod errors more descriptive being worked on?
There are plans to replace Zod I believe
good morning, i'm trying to set up a simple discord bot at the moment, and this is my code so far: ```import { ApplicationId, BotToken, ClientId, GuildId, PublicKey } from '../config.json'
import { SlashCommandBuilder } from '@discordjs/builders'
import { REST } from '@discordjs/rest'
import { Routes } from 'discord-api-types/v9'
import { Client, Intents } from 'discord.js'
require('dotenv').config()
// Create a new client instance
const client = new Client({ intents: [Intents.FLAGS.GUILDS] })
const commands = [
new SlashCommandBuilder().setName('ping').setDescription('Replies with pong!'),
new SlashCommandBuilder().setName('server').setDescription('Replies with server info!'),
new SlashCommandBuilder().setName('user').setDescription('Replies with user info!'),
].map(c => c.toJSON())
const rest = new REST({ version: '9' }).setToken(BotToken)
rest.put(Routes.applicationGuildCommands(ClientId, GuildId), { body: commands })
.then(() => console.log('Successfully registered application commands.'))
.catch(console.error)
// Login to Discord with your client's token
client.login(BotToken)```
however, i am receiving the following error: S[50001]: Missing Access at Q.runRequest (C:\Users\shivn\Desktop\discord-bot\node_modules\@discordjs\rest\dist\index.js:7:581) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Q.queueRequest (C:\Users\shivn\Desktop\discord-bot\node_modules\@discordjs\rest\dist\index.js:5:2942) { rawError: { message: 'Missing Access', code: 50001 }, code: 50001, status: 403, method: 'put', url: 'https://discord.com/api/v9/applications/{APPLICATIONID}/guilds/{GUILDID}/commands', requestBody: { files: undefined, json: [ [Object], [Object], [Object] ] } }
this doesn't look like v14, if you're using v13, #djs-help-v14
if you are using v14, check the pins
ah okay
are modals done because the only conversation left in PR is outdated
and all checks passed
It’s not done until all reviewers approve it
the URL provided by message.attachments.first()?.url can be destroyed if the message get deleted
if I do new MessageAttachment(message.attachments.first()?.url) will it create a new attachment that will not get deleted if the message command is deleted?
Also I don't understand what is the "?" For
Optional chaining
Huh could you explain
<:_:818272565419573308> Optional chaining (?.)
The optional chaining operator (?.) enables you to read the value of a property located deep within a chain of connected objects without having to check that each reference in the chain is valid.
Hey guys so for the <Interaction>.awaitModalSubmit() collector is there a way to only collect the data from the specific message it was submitted from.
considering the method is called on an interaction, definitely
yeah making a message collector for this isn't bad either since modals can be spawned from them
I left a review comment anyhow on the 13 backport one
I get this error when trying to use the code example from the modal pr. Anyone knows whats wrong?
Well, did you import it?
its "SHORT" and "PARAGRAPH" on v13 not sure about v14
they have the syntax correct for v14
Oh ok i just thought maybe it could be the same for v14
const {
ActionRow,
TextInputComponent,
TextInputStyle,
Modal,
ModalActionRowComponent,
} = require('discord.js')
// Create the modal
const modal = new Modal()
.setTitle('My Awesome Form')
.setCustomId('AwesomeForm');
// Create text input fields
const haikuInputComponent = new TextInputComponent()
.setCustomId('haikuField')
.setLabel('Write down your favorite haiku')
.setStyle(TextInputStyle.Paragraph);
const rows = [haikuInputComponent].map((component) =>
new ActionRow.ModalActionRowComponent.addComponents(component)
);
// Add action rows to form
modal.addComponents(...rows);
await interaction.showModal(modal);
Yes its imported
you cloned a local copy of the repo right?
ah I cloud try this
that won't work in v14
i used npm i github:monbrey/discord.js#modals
oh ok then yeah it will work since it's v13
yeah thats for v13
yeah I am still on v13
the v14 PR docs aren't written for v13
oh
This channel is for v14 additionally :P
really?
yeah
ohhhh I am blind.. sorry 😅
does discord.js v14 dev works or not
Is there any date for stable version?
some bugs 'cuz still in dev
the URL provided by message.attachments.first()?.url can be destroyed if the message get deleted
if I do new MessageAttachment(message.attachments.first()?.url) will it create a new attachment that will not get deleted if the message command is deleted?
Noted!
nice answer
I don’t use prefix command anymore
and I have to wait some weeks that the URL get deleted ._.
for knowing
it doesn’t answer to my question ._.
how does that help
Well, it technically shoild work as a new attachment is created
what is this?

yeah I just checked it but what’s different?
Did you read it? 
the point is that no one has the answer
OK then
Yeah we dont do ETAs
Why
Can you be more specific? Changed how?
C:\Users\Administrator\Desktop****\Dev\Melon\server.js:16
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_INVITES, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_PRESENCES, Intents.FLAGS.GUILD_VOICE_STATES],
^
TypeError: Cannot read properties of undefined (reading 'FLAGS')
at Object.<anonymous> (C:\Users\Administrator\Desktop****\Dev\Melon\server.js:16:23)
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)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
Intents is now IntentsBitfield
So I have to write IntentsBitField.FLAGS.GUILDS ?
no IntentsBitField.Flags.Guilds, or alternatively Intents.Guilds
Oh, much simple
TypeError: Cannot read properties of undefined (reading 'Flags')
Weird
did u import it properly
Idk
Oh okay I forgor the uppercase
💀
node:events:368
throw er; // Unhandled 'error' event
^
ZodError: [
{
"code": "invalid_type",
"expected": "object",
"received": "array",
"path": [
0
],
"message": "Expected object, received array"
}
]
at new ZodError (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\zod\lib\ZodError.js:80:28)
at handleResult (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\zod\lib\types.js:115:21)
at ZodArray.ZodType.safeParse (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\zod\lib\types.js:191:16)
at ZodArray.ZodType.parse (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\zod\lib\types.js:172:27)
at MixedClass.addChoices (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\@discordjs\builders\dist\index.js:3:10853)
at C:\Users\Administrator\Desktop\Ryan\Dev\Melon\commands\activity.js:9:10
at MixedClass._sharedAddOptionMethod (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\@discordjs\builders\dist\index.js:3:14694)
at MixedClass.addStringOption (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\node_modules\@discordjs\builders\dist\index.js:3:14467)
at Object.<anonymous> (C:\Users\Administrator\Desktop\Ryan\Dev\Melon\commands\activity.js:6:6)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:251:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21) {
issues: [
{
code: 'invalid_type',
expected: 'object',
received: 'array',
path: [ 0 ],
message: 'Expected object, received array'
}
],
format: [Function (anonymous)],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)],
flatten: [Function (anonymous)]
}
const slashData = new SlashCommandBuilder()
.setName('activity')
.setDescription("Démarre une activité Discord en vocal !")
.addStringOption(option => option
.setName('activity')
.setDescription("Choisi l'activitée que tu veux lancer, tu dois être dans un vocal pour utiliser cette commande !")
.addChoices([
['Youtube Together', 'youtube'],
['Youtube Together (Dev)', 'youtubedev'],
['Word Snacks', 'wordsnack'],
['Awkword', 'awkword'],
['Betrayal.io', 'betrayal'],
['Chess', 'chess'],
['Chess (Dev)', 'chessdev'],
['Doodle Crew', 'doodlecrew'],
['Fishington', 'fishing'],
['Letter Tile', 'lettertile'],
['SpellCast', 'spellcast'],
['Poker Night', 'poker']
])
)
The error starts at .addChoices()
It expect an object but idk how to transpose the array to an object lol
choices accepts a rest array of choices:
.addChoices(
{label: '1', value: '1'},
{label: '2', value: '2'},
)
lmao
Fixed?
oh yeah, nvm u have to use the SelectMenuChoice for now
o,o
What ?
im fairly certain its not a bug
It's not nah
not it should, but if you do that rn it crashes bc it hasn't been updated to support that
i dont think siris understood what you were trying to say oqa[...]
MessageButton is not a constructor 😔
ButtonComponent
it's going to be exactly like it is now but you have the choice of using a class or an object
they omitted the rest of ur username
How I can add choices with iterators ?
add ... in the front
also you need to use the SelectMenuOption class
in the front of what ?
in front of any array you pass into .addChoices
In the addChoices function ?
yes
you need to map the array into an array of SelectMenuOption classes instead of array of arrays
I'm using an array with objects
yeah but that doesn't work as of right now
use the class instead of a plain object
no its my fault, i said option
@scarlet tangle you can actually use objects now the latest dev release includes support for it
oh wait nvm it doesn't have it, it just missed the deadline
wait maybe it did, idk you'll have to test
well it has the commit hash in the version so it did
it wont, you just have to use rest parameters
hello... I have the intents activated... can you help me?
when the
ignore
ye ik
I think you went to the wrong site, it’s discordjs.guide, not discordjs-guide
Ah ok
That doesn't exists
(My IDE do not reconize it)
just cuz your ide doesnt recognize it doesnt mean its non existent
Yeah that's annoying
npm i discord.js@dev
will that give the latset github version
instead of having a resolver for each enum, you can create a common enum resolver like
EnumResolver.resolveEnum("STRING_ENUM")```
const exampleEmbed = new Embed()
.setColor("#0099ff")
.setTitle("UTILY's Help Menu")
.setAuthor({
name: "somename",
iconURL:
"somelink",
url: "yetanotherlink",
})
.setDescription("A list of commands and their descriptions.")
.addFields(
{ name: "Categories:", value: "fun | info | mod" },
{ name: "\u200B", value: "\u200B" },
{ name: "fun", value: "count", inline: true },
{ name: "info", value: "help | ping", inline: true },
{ name: "mod", value: "purge", inline: false }
)
.addField("Example:", "`/helpfun categoryfun count`")
.setThumbnail(interaction.client.user.displayAvatarURL({ format: "png" }))
.setTimestamp()
.setFooter({
text: `REQUESTED BY ${interaction.member.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ format: "png" }),
});```
can someone please edit this one embed according to the norms then i will know the changes
use Util#resolveColor for embed color
and Embed#addfield only accepts options
Whats resolveColor?
And wdym by options in addfield?
why are you using addFields() and addField() in the same place
replace "#0099ff" with 0x0099ff (without quotes)
const { Util } = require('discord.js')
.setColor(Util.resolveColor('#0099ff'))
just use 0x0099ff instead of that
const { MessageEmbed} = require("discord.js"),
config = require("./../botconfig/config.json");
module.exports.send = async function(message, embed){
let newEmbed = new MessageEmbed()
.setFooter(config.footer)
.setColor(config.color)
embed = {... newEmbed, ... embed}
return message.channel.send({embeds: [embed]});
};
module.exports.usage = async function(message, data){
let cmd = data.cmd;
let usageDesc = await cmd.usage.join("\n").replace(/{prefix}/g, data.guild.prefix);
let newEmbed = new MessageEmbed()
.setFooter(config.footer)
.setColor("RED")
.setDescription("Missing arguments for command. Please provide the valid inputs.")
.addField("__Usage__", usageDesc);
return message.channel.send({embeds: [newEmbed]});
};
how can i repair it? TypeError: MessageEmbed is not a constructor
what's new in v14?
i was reading this two times and i didn t see this xD
version: 14.0.0-dev.1645142857.f7257f0
Has its usage changed?
https://lency.is-a.fail/5oooR47K9.png
Shoooooooooow codeeeeeeeeeeeeeeeeee
interaction.options.getNumber('amount');
Yea but what is the interaction
to fix inline contents
CommandInteraction
https://lency.is-a.fail/5ooqqVoYo.png
<:_:874573855715385394> ChatInputCommandInteraction (extends CommandInteraction)
Represents a command interaction.
Yes (: Chat input commands are for chat input commands. Command interactions are the base for context menu commands and chat input commands
please someone rectify my addfield() and addfields()
i saw cant figure out
and i am not telling like write my code, i just cant figure out so someone can help, if you cant please refrain
you have plenty of fields already, just move the one you have on addField() alone into the addFields above it
thanks will try
that's indirectly what i was saying here
ah missed it sorry
thanks buddy, i understood all changes in embeds (:
v14 is out already??? wut r the changes
read pins
@scarlet tangle
This error is occurring when I make my avatar context menu command.
Here's the code:
const {
Client,
ContextMenuCommandInteraction,
} = require('discord.js');
module.exports = {
name: 'Get Avatar',
type: 2,
/**
* @param {Client} client
* @param {ContextMenuCommandInteraction} interaction
*/
run: async (client, interaction) => {
let member = interaction.guild.members.cache
.get(interaction.targetId);
let embedAvatar = {
image: member.user.displayAvatarURL({
size: 4096,
format: 'png',
}),
};
await interaction.editReply({ embeds: [embedAvatar] });
},
};
discord.js: version 14.0.0-dev.1643889786.04502ce
let embedAvatar = {
image: {
url: member.user.displayAvatarURL({
size: 4096,
format: 'png',
}),
},
};
oh thanks
Is there anyway to work with modals in v14 ?
is there a thing like this:
member.bannableBy(member2)
and it checks if member2 can ban or not member
you can just do .setImage(att.url)
Tag suggestion for @scarlet tangle from @forest elm:
MessageEmbed#attachFiles has been removed. Files should be attached via the message option object instead:
const attachment = new MessageAttachment('./image.png', 'image1.png');
const embed = new MessageEmbed()
- .attachFiles([attachment])
.setTitle('Attachments')
.setImage(`attachment://${attachment.name}`);
- channel.send(embed)
+ channel.send({
+ embeds: [embed],
+ files: [attachment]
+ });
you could do that if the attachment was already uploaded, but this is not the case
e.g. if the attachment came from another message
is there a thing like this:
member.bannableBy(member2)
and it checks if member2 can ban or not member
no there is not
and is it technically possible to know if a member can ban another one or not?
sure, take a look at the code of e.g. GuildMember#bannable and adapt it for another user than your client
Please use #djs-help-v14 or #archive-djs-help-v13 this channel is for v14 questions only
oh sorry my bad.
Should i report typings errors after updating or should i just wait for a future merge? Just updated and getting 13 typings error from djs
Be more specific please
I'm asking if i should post this every time it happens when running npm update
Might be that one of the packages are outdated
Make sure all of the packages are up to date
That is not the question i asked but thanks anyway!
And I'm telling you that shouldn't happen and gave you a possible reason as to why
Most of the time, those are just not merged yet. This is why i'm asking if i should report them or just wait for them to be merged.
can you show your full code?
Is VIEW_CHANNEL bitfield renamed?
It’s PascalCase so it’s “ViewChannel”
await interaction.guild.channels.create('utily-logs', {
type: 'text',
permissionOverwrites: [
{
id: interaction.guild.id,
deny: ['VIEW_CHANNEL'],
},
{
id: interaction.user.id,
allow: ['VIEW_CHANNEL'],
},
],
}).catch(e =>{ return interaction.reply("An error ocurred:"+e)})```
I meant here
The channel type is GuildText now btw
k thanks
An error ocurred:RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: VIEW_CHANNEL.
what about perms?
It's ViewChannel
btw it says GuildText is not defined?
oo i fixed it, the type is BaseGuildTextChannel
Use ChannelTypes.GuildText
ok
embed.setFooter(`:thumbsup: ${memeUpvotes} :speech_balloon: ${memeNumComments}`);
why is this not working?
<MessageEmbed>.setFooter() and <MessageEmbed>.setAuthor() now each take an object:
- embed.setAuthor('This is an example text', 'https://exampleicon.com', 'https://websiteofauthor.com')
+ embed.setAuthor({ name: 'This is an example text', url: 'https://websiteofauthor.com', iconURL: 'https://exampleicon.com' })
- embed.setFooter('This is an example text', 'https://exampleicon.com')
+ embed.setFooter({ text: 'This is an example text', iconURL: 'https://exampleicon.com' })
@forest willow
thanks
Import "Permissions" from discord.js and change it to Permissions.ViewChannel
i fixed it already thanks for helping though
Oh no it's PermissionFlagsBits.ViewChannel
if (channel.type === "GuildText") this isnt working
Like channel.type === ChannelTypes.GuildText
That limits to any TextBasedChannel tho, not just TextChannel
channel.isText() is only for TextChannel and channel.isTextBased() is for any TextBasedChannel
Nice
Why does
GuildChannelManager.fetch``` return `Promise<NonThreadGuildBasedChannel | null>`?
I thought it'd throw an error if it couldn't find a channel
throws an error if forced to fetch (and doesn't exist)
oh wait you just said it, hmmm idk 
Yeah weird
wait no you didn't say it's a forced fetch, yeah it should throw an error if no channel was found but it's a forced fetch
A, so if I set force: true, it will error instead of returning null?
yeah
Ah ok thx
before when the user doesn't have any flags and we did user.flags.toArray() there was 'None' in the array
did you remove it definitively or it's a "bug" ?
I think that was removed.
👍
how do you now install d.js dev?
npm i discord.js@dev
how about with specific commit?
(client.channels.cache.get('id')).send(`message`);
Error:
(client.channels.cache.get('id')).send(`text`);
^
TypeError: Cannot read properties of undefined (reading 'send')
why you added brackets?
check versions on the npm page
The Dev version is updated every 12h (if the action doesn't fail at least) with new commits. You can see the commit hash in the last part of the version. If the newest version is broken you can install the (deprecated) old Dev version checking the version name at https://npmjs.com/package/discord.js?activeTab=versions -> show deprecated versions
do the MessageButton in v14 be required on discord builders?
and is now button component?
it wasnt working without braces
what is the difference if you import it from d.js?
sorry channel id was incorrect
did v14 change perm checks as well to not receive a string?
nope
then why?
even with the intents?
yes
I mean, the partials?
everything
They finally did it
you can't use strings for partials anymore
is there a list of breaking changes compiled right now?
check pins
sighs, as expected, major version bump takes a lot away from my sanity. thanks for the help though
When is Discord.js v14 coming out?
ETA: When its ready™️
I dont understand this error
DiscordAPIError[50035]: Invalid Form Body
embeds[0].description[BASE_TYPE_REQUIRED]: This field is required
at C.runRequest (D:\Dev Works\Chip\main\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:7:581)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async C.queueRequest (D:\Dev Works\Chip\main\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:5:3049)
at async TextChannel.send (D:\Dev Works\Chip\main\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:175:15)
at async NormalReplies.send (file:///D:/Dev%20Works/Chip/main/src/structures/NormalReplies.js:61:20)
at async Player.interactiveNowPlaying (file:///D:/Dev%20Works/Chip/main/src/music/Player.js:216:24)
at async Player.start (file:///D:/Dev%20Works/Chip/main/src/music/Events.js:9:13)
Base type required?
Looks like you sent an empty embed.
(That error is indeed not too good)
this is the embed data
[
{
"data":{
"author":{
"name":"Now Playing",
"url":{
},
"icon_url":"https://cdn.discordapp.com/avatars/325231623262044162/cf10d9dd76495b274cc3fae26bdda5d6.webp"
},
"description":"[Yagate Kimi Ni Naru - Hectopascal (ED)](https://soundcloud.com/isabella-strange/yagate-kimi-ni-naru-hectopascal-ed) [04:28]",
"color":16741120
}
}
]
clearly my description is not null so it should not throw
I don't recall embeds being nested under data, I'd suspect that being the culprit.
how did it get nested, though I'm using the dev version right now
How did you get that json?
stack trace
Can you show your code?
async send(color, input, buttons) {
// check if options is a string or message embed
let options;
if (typeof input === 'string') {
const components = [];
if (buttons?.length)
components.push(new ActionRow().addComponents(buttons));
const embed = new Embed()
.setColor(color)
.setAuthor({
name: formatText(input),
iconURL: this.interactable.interaction.user.displayAvatarURL()
});
options = {
embeds: [embed],
components
};
} else if (input instanceof Embed) {
const components = [];
if (buttons?.length)
components.push(new ActionRow().addComponents(buttons));
// color setter
if (!input.color) input.setColor(color);
if (input.author?.name) input.author.name = formatText(input.author.name);
options = {
embeds: [input],
components
};
}
// manual input
else
options = Object.assign({}, input);
// check if the message is replied or deffered before sending
if (this.interactable.interaction.replied)
return await this.interactable.interaction.followUp(options);
else if (this.interactable.interaction.deferred)
return await this.interactable.interaction.editReply(options);
else {
if (!this.interactable.repliable) return;
return await this.interactable.interaction.reply(options);
}
}
I also get
err: {
"type": "TypeError",
"message": "t.toJSON is not a function",
"stack":
TypeError: t.toJSON is not a function
at file:///D:/Dev%20Works/Chip/main/node_modules/@discordjs/builders/dist/index.mjs:3:3580
at Array.map (<anonymous>)
at T.toJSON (file:///D:/Dev%20Works/Chip/main/node_modules/@discordjs/builders/dist/index.mjs:3:3571)
at D:\Dev Works\Chip\main\node_modules\discord.js\src\structures\MessagePayload.js:135:30
at Array.map (<anonymous>)
at MessagePayload.resolveBody (D:\Dev Works\Chip\main\node_modules\discord.js\src\structures\MessagePayload.js:134:49)
at TextChannel.send (D:\Dev Works\Chip\main\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:171:61)
at NormalReplies.send (file:///D:/Dev%20Works/Chip/main/src/structures/NormalReplies.js:59:39)
at NormalReplies.normal (file:///D:/Dev%20Works/Chip/main/src/structures/NormalReplies.js:12:21)
at Player.interactiveNowPlaying (file:///D:/Dev%20Works/Chip/main/src/music/Player.js:216:43)
}
when adding buttons which I also don't understand since components should be an array with actionrow inside it doesnt it
Also just to verify are you on the latest dev version
{
"code": "invalid_type",
"expected": "object",
"received": "string",
"path": [
0
],
"message": "Expected object, received string"
}
]
at new ZodError (C:\Users\aleks\Desktop\Nodejs\v14\node_modules\zod\lib\ZodError.js:80:28)
at handleResult (C:\Users\aleks\Desktop\Nodejs\v14\node_modules\zod\lib\types.js:115:21)
at ZodArray.ZodType.safeParse (C:\Users\aleks\Desktop\Nodejs\v14\node_modules\zod\lib\types.js:191:16)
at ZodArray.ZodType.parse (C:\Users\aleks\Desktop\Nodejs\v14\node_modules\zod\lib\types.js:172:27)
at Embed.addFields (C:\Users\aleks\Desktop\Nodejs\v14\node_modules\@discordjs\builders\dist\index.js:1:6204)
at Embed.addField (C:\Users\aleks\Desktop\Nodejs\v14\node_modules\@discordjs\builders\dist\index.js:1:4695)
at Object.execute (C:\Users\aleks\Desktop\Nodejs\v14\commands\eval.js:33:14)
at Object.execute (C:\Users\aleks\Desktop\Nodejs\v14\events\messageCreate.js:16:21)
at Client.<anonymous> (C:\Users\aleks\Desktop\Nodejs\v14\index.js:40:44)
at Client.emit (node:events:390:28) {
issues: [
{
code: 'invalid_type',
expected: 'object',
received: 'string',
path: [Array],
message: 'Expected object, received string'
}
],
format: [Function (anonymous)],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)],
flatten: [Function (anonymous)]
}```
what this error means?
What the message says, stacktrace points to eval.js line 33.
line 33 addField in Embed
bruuuh
addfield usage changed?
It has indeed
hahaha thx
ó.O
yes, but why
where did you put that piece of code, and what intents are you using
go on, that wasn't the only thing i asked
I found a weird case, where in instanceof returns false on same instance of embed, (1st picture)
on the resolveBody of message payload (2nd picture)
which actually causes the issue in
#djs-in-dev-version message
show the embed you're creating