#djs-in-dev-version
35223 messages · Page 9 of 36
what color bug?
oh the resolveColor? use EmbedBuilder instead of Embed
if (!Object.hasOwn(given, key) || given[key] === undefined) {
^
TypeError: Object.hasOwn is not a function
const { Client } = require('discord.js');
const client = new Client({
intents: ["DirectMessageReactions", "DirectMessageTyping", "DirectMessages", "GuildBans", "GuildEmojisAndStickers", "GuildIntegrations", "GuildInvites", "GuildMembers", "GuildMessageReactions", "GuildMessageTyping", "GuildMessages", "GuildPresences", "GuildScheduledEvents", "GuildVoiceStates", "GuildWebhooks", "Guilds"],
allowedMentions: { parse: ['users', 'roles'], repliedUser: true }
});
update Node.js to v16.9.0 or newer
Can we update our v13 code to v14
Yes
throw new TypeError('INVALID_TYPE', 'roles', 'Role, Snowflake or Array or Collection of Roles or Snowflakes');
^
TypeError [INVALID_TYPE]: Supplied roles is not a Role, Snowflake or Array or Collection of Roles or Snowflakes.
at GuildMemberRoleManager.add (C:\Users\Administrator\Desktop\feijonts_botwljs-main\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:93:15)
at Client.<anonymous> (C:\Users\Administrator\Desktop\feijonts_botwljs-main\index.js:441:29)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[Symbol(code)]: 'INVALID_TYPE'
}
Supplied roles is not a Role, Snowflake or Array or Collection of Roles or Snowflakes.
index.js line 441
You need to supply one of these
role's value is undefined
do if (!role) return console.log('The role does not exist.')
We dont support v12
And this is @dev version support
Is this discord-buttons code?
index,js
in line 441?
@patent bridge #useful-servers, we dont support v12 nor third party lib
below line 439
How long does it take for the latest commits to be added in NPM?
Every 12 hours iirc
Hmm it's been 18 hours.
It's still on 2297c2b9479ace16f5f7155479605a4ac2718e3d
Although publish dev did run 
idk probably discord.js error, I use discord-modals and it used to work.
ModalBuilder
discord-modals is not made by discordjs
the problem is caused by it - most likely. - it stopped working after yesterdays merge
Then join their discord?
We do not provide any help with third party libraries like discord-modals.
the head developer literally tells me its a problem with discord.js every time I try to ask something lmfao
anyways, İdris I recall you sent me a modals tutorial. Do you still have it?
Idris, do you know about this?
it's still buged
nope sorry
oofie, so no way to create a modal atm with plain djs?
You can make modals by leveraging REST I believe.
thanks
ok
DiscordAPIError[50035]: Invalid Form Body
1.options[0].type[NUMBER_TYPE_COERCE]: Value "SUB_COMMAND" is not int.
use enums
The last try to publish the dev version was <t:1647432163:R>
https://github.com/discordjs/discord.js/actions/runs/1992586964
It's not on npm
how to set a default value in the TextInputBuilder
.setValue() afaik, .setPlaceholder() if you just want text that gets overwritten as soon as someone enters text
thankss!
sorry ping*
what went wrong?
Add text inputs to action rows and action rows to modal
okey, I did that and now I get this
@copper jetty - sorry for ping, can you check?
throw new RangeError('BITFIELD_INVALID', bit);
^
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: ADMINISTRATOR.
module.exports = {
name: 'verify',
description: 'verify',
permission: 'ADMINISTRATOR',
run: async (client, interaction, args) => {
they removed the '' stuff, just type 8 without' ' - or grab it
Use enums
like so: discord.PermissionFlagsBits.Administrator
@copper jetty any idea for this?
It looks like c is undefined for me
Use PermissionsBitField.Flags.Administrator
so nothing I can do? - idk what c is and never use it. I get the error as soon as the event runs and not after I try to do anything. I cant even log the intraction.
this.components = data.data.components?.map(c => createComponent(c)) ?? [];
^
TypeError: createComponent is not a function
const client = require('../../../index');
client.on('interactionCreate', interaction => {
if (!interaction.isModalSubmit()) return;
const favoriteColor = interaction.fields.getTextInputValue('favoriteColorInput');
const hobbies = interaction.fields.getTextInputValue('hobbiesInput');
console.log({ favoriteColor, hobbies });
});
Has pr
What's wrong?
const msg = await message.reply({embeds: [embed(mod)], components: [row]})
discordjs.guide results:
• Popular Topics: Implicit permissions
• Popular Topics: Channel overwrites
wait no, why're you showing us this code when clearly this is coming from another place 🤨
@vestal ibex #769862166131245066 add the scopes to your bot and reinvite it
you don't have to kick it, just use the link again
the bot can't see this channel
it needs VIEW_CHANNEL permission
Hmm..
Thats not command creating access error
yeah implicit permissions cover this
i for a second forgot djs now uses rest internally
Missing Access is not only for that yknow
yes i know, the stack showing rest threw me off
either way the guide i sent at the beginning for implicit permissions explains it
its ok ben. we forgive you
Oh, I realized my mistake. Thanks for the help.
And sorry to bother you. :")
I have a problem with my bot is that when i try to Ping it like this (image) it should respond with a embed and it worked fine befor but now it does not respond and i don't get any errors in the Console this is the code (image2) Discord.js version 14.0.0-dev.1647259751.2297c2b
Idk if its just that am missing something or like a intent that is missing
does the event fire?
i can check 2 secs
can I make a command invisible if a person does not have a permission?
no
atleast make it unavailable within the frontend?
discordjs.guide results:
• Interactions: Slash command permissions
• Interactions: Bulk update permissions
Yea it fires
read this and convert it to v14
thanks
log message.content with ping
Okay
this when i ping it
Tag suggestion from @copper jetty:
If you aren't getting any errors, try to place console.log checkpoints throughout your code to find out where execution stops.
• Once you do, log relevant values and if-conditions
• More sophisticated debugging methods are breakpoints and runtime inspections: learn more
can I log timeouts? and how. I cant seem to find an event for them
guildMemberUpdate event
type: 'MEMBER_TIMEOUT',
is this correct?
How do I set intents?
read pins
MemberTimeout
thankss
type: 'MemberTimeout',
I think im missing something with this
owh and it also returns an error
You need to use enums instead of string
can you tell me what I need to write after discord. to find the audit log actions
or what enum this would be
Import AuditLogEvent from discord-api-types/v10 and use AuditLogEvent.MemberTimeout
my code is like this, how would i get the url (or buffer) of the image?
Actually nvm, i don't see MemberTimeout audit log event in the docs so its probably MemberUpdate
TypeError: MessageSelectMenu is not a constructor
at Object.run (C:\Users\Lowe\Documents\Command maker\src\commands\start\command.js:13:22)
at Object.execute (C:\Users\Lowe\Documents\Command maker\src\events\interactionCreate.js:8:17)
at Client.<anonymous> (C:\Users\Lowe\Documents\Command maker\src\handlers\eventHandler.js:8:58)
at Client.emit (node:events:390:28)
at InteractionCreateAction.handle (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\actions\InteractionCreate.js:76:12)
at Object.module.exports [as INTERACTION_CREATE] (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketShard.onPacket (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:22)
at WebSocketShard.onMessage (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\WebSocketShard.js:304:10)
at WebSocket.onMessage (C:\Users\Lowe\Documents\Command maker\node_modules\ws\lib\event-target.js:199:18)
SelectMenuBuilder
Oh they changed it?
yes
Is it the for buttons?
yes
What's your discord.js and builders version
timelog.duration returns undefined for some reason
every other one works
you need discord.js dev version too I think
I told you earlier you can't resolve attachment option with v13
but there is no way I can get the link without being with the dev version?
maybe if I build the link using the id of the interaction and the image...
you will have to get raw command data but that isnt related to discord.js
how to get a duration of a timeout from the auditlog.
client.on("guildMemberUpdate", async(member) => {
const fetchedLogs = await member.guild.fetchAuditLogs({
limit: 1,
type: AuditLogEvent.MemberTimeout,
});
const timelog = fetchedLogs.entries.first();
let duration = timelog.duration```returns undefined.
@scarlet tangle
no it works
else then the duration everything else does.
can you just log it? ._.
- isn't there in the discord api doc ._.
owh yeah, it just returns the old and new dates. Any idea on how I can get a duration out of this?
How do I remove an old command from a server?
<CommandInteraction>.command.delete()
or <Guild>.commands.delete(id)
How do I get the id of a command?
Fetch all commands and console log it
I got the ID but I get the error Unknown application command
That means it got deleted if the id was correct
It still shows the command when I check the bot's commands in the server
then you passed wrong id into delete method
Is it not possible to use interaction.applicationId to get the id of the command?
Because when I'm trying to delete that nothing happens
<CommandInteraction>.commandId
Can't delete it...
TypeError: (intermediate value).setTitle is not a function
show your code
its just the code from the guide
it doesn't matter, show it regardless
const { ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const applicationQuestions = async (newchan, interaction, panelname) => {
if (panelname == "staffapptest") {
// Create our modal
const modal = new ModalBuilder()
.setCustomId('myModal')
.setTitle('My Modal');
// Add components to modal
// Let's create our text inputs
const favoriteColorInput = new TextInputBuilder()
.setCustomId('favoriteColorInput')
// The label is the prompt the user sees for this input
.setLabel("What's your favorite color?")
// Short means only a single line of text
.setStyle(TextInputStyle.Short);
const hobbiesInput = new TextInputBuilder()
.setCustomId('hobbiesInput')
.setLabel("What's your favorites hobbies?")
// Paragraph means multiple lines of text.
.setStyle(TextInputStyle.Paragraph);
// An action row only holds one text input,
// so we need one action row per text input.
const firstActionRow = new ActionRowBuilder().addComponents(favoriteColorInput);
const secondActionRow = new ActionRowBuilder().addComponents(hobbiesInput);
// Now we need to add our inputs into the modal
modal.addComponents(firstActionRow, secondActionRow);
// Show our modal
await interaction.showModal(modal);
}
}
module.exports = { applicationQuestions };
yea modals have titles? 😂 i didn't know that
oh its coming from this line
const newchanembed = new Discord.Embed()
.setTitle(opentitle)
use EmbedBuilder
k
no it's not RichEmbed 👀
you seem to have skimmed through the discussion
help
is discord.js@14.0.0-dev.1647259751.2297c2b on api v10??
TypeError: Cannot destructure property 'components' of 'undefined' as it is undefined.
const row = new Discord.ActionRow()
ActionRowBuilder
pretty sure now the guide mentions it
wait this was merged? https://github.com/discordjs/discord.js/pull/7477
all these changes are messing with me smh
You dont see the purple merged label?
yeah
No
oh well uhm, then how to get the api v10 version? i already tried to update from npm
Reinstall discord.js@dev
I think it will be in the next dev version release
npm install discord.js@dev
yarn remove discord.js
yarn add discord.js@dev
pnpm remove discord.js
pnpm install discord.js@dev```
the latest dev version has broke a lot of my things
fun
dev version yknow
btw is there a specific reason as to why you want v10?
such as?
embeds
buttons
be more specific
all im getting now is TypeError: Discord.MessageActionRow is not a constructor
ActionRowBuilder
ButtonBuilder
oh so the guide isnt updated
EmbedBuilder
nope
It is
nice 2 answers
i trust </> more
With all this new builder stuff, is djs builders expected to merge fully into djs?
Why doesnt this work? interaction.command.delete()
No @autumn forum
what?
what do you mean by merge fully into djs?
not an external package ig
builders were split from djs, why would it merge back in
what djs does now is use builders internally and it exports the builders with a slight change
it doesn't remove builders' standalone-ity?
fair enough, thanks for clarifying
why does this occur? ```const { Constants } = require("discord.js");
const mongo = require("../database/mongo");
module.exports = {
name: 'ready',
once: true,
async execute(client) {
const guild = client.guilds.cache.get("953624834330488843");
let commands;
if (guild) {
commands = guild.commands;
} else {
commands = client.application?.commands;
}
commands?.create({
name: 'help',
description: "Information about the bot and instructions of how to use it.",
});
commands?.create({
name: 'command',
description: "Manage server-sided commands.",
});
console.log(client.user.tag + " is now online!");
const mongo = require('../database/mongo.js');
await mongo().then(async (mongoose) => {
console.log("Connected to database.");
});
}
}
What's the issue?
It creates 2 help commands
You're only creating 0 or 1 help commands in the code you sent. It's not creating 2
Why are there 2 help commands then?
Your code creates a guild command if there's a guild or a global command if there's no guild. So if there's two, that means at one point, you couldn't find that guild, then at one point, you did find that guild
Can i delete one of the help commands?
If you want
How?
It just says Unknown application command when I try to delete one of them.
show your code for deleting it
and of course how you got the id
module.exports = {
name: 'interactionCreate',
async execute(interaction, client) {
if(!interaction.isCommand()) return;
console.log(interaction.commandId)
const { commandName, options } = interaction;
const command = client.commands.get(commandName);
command.run(client, interaction, options).catch(err => console.log(err))
}
}
and how are you deleting?
guild.commands.delete("953650800939372554")
are you sure this is the guild command's id and not the global one's?
I dont know the difference
, first time using slash commands
okay maybe this will help
one's specific to the guild and one's global
and if the command id belongs to a global guild, it won't really be deleteable on the the guild
also are you even using v14?
Yeah im using v14
then use isChatInputCommand() instead of just isCommand
read the guide, you're running v13 code
I think you still can use isCommand() in v14
whats a zoderror
it's an error
You passed array instead of rest parameters into addFields method
.addFields([
{ name: "Name", value: data.name },
//{ name: "Deaths", value: data.death_count },
{ name: "Total Kills", value: `${data.mob_kill_count + data.player_kill_count}`, inline: true },
{ name: "Last seen", value: "<t:" + Math.trunc(data.lastSeen / 1000) + ":R>", inline: true },
{ name: "Joined", value: "<t:" + Math.trunc(data.registered / 1000) + ":R>", inline: true },
{ name: "Mob Kills", value: `${data.mob_kill_count}`, inline: true },
{ name: "Player Kills", value: `${data.player_kill_count}`, inline: true },
{ name: "Location", value: `${data.geo_info[0].geolocation}`, inline: true },
])
so this has changed?
yes
I've only added commands to the guild I believe
const { Constants } = require("discord.js");
const mongo = require("../database/mongo");
module.exports = {
name: 'ready',
once: true,
async execute(client) {
const guild = client.guilds.cache.get("953624834330488843");
let commands;
if (guild) {
commands = guild.commands;
} else {
commands = client.application?.commands;
}
commands?.create({
name: 'help',
description: "Information about the bot and instructions of how to use it.",
});
commands?.create({
name: 'command',
description: "Manage server-sided commands.",
});
console.log(client.user.tag + " is now online!");
const mongo = require('../database/mongo.js');
await mongo().then(async (mongoose) => {
console.log("Connected to database.");
});
}
}
Documentation suggestion for @radiant lintel:
Rest parameters
The rest parameter syntax allows a function to accept an indefinite number of arguments as an array, providing a way to represent variadic functions in JavaScript.
do you have an example
remove the [ and ]
whats with all these changed in the v14
is it performance or something
consistency and future-proofing
https://github.com/discordjs/discord.js/discussions/7380 read this
why do i get this error when i submit a modal?```js
C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\structures\ModalSubmitInteraction.js:43
this.components = data.data.components?.map(c => createComponent(c)) ?? [];
^
TypeError: createComponent is not a function
at C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\structures\ModalSubmitInteraction.js:43:54
at Array.map (<anonymous>)
at new ModalSubmitInteraction (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\structures\ModalSubmitInteraction.js:43:45)
at InteractionCreateAction.handle (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\actions\InteractionCreate.js:69:25)
at Object.module.exports [as INTERACTION_CREATE] (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketShard.onPacket (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:22)
at WebSocketShard.onMessage (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\WebSocketShard.js:304:10)
at WebSocket.onMessage (C:\Users\Lowe\Documents\Command maker\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:390:28)
known bug
Is there a fix?
wait for the pr that fixes it to get merged and released
Yes I got this bug also.
I fixed it by myself 😁
How did you fix it?
by editing the code that is in the PR ig
For testing fixing.
I went into node_modules discord.js package.
Then is src/stuctures/ and ModalSubmitFieldsResolver.js.
Changed line 23
from: next.components.forEach(c => accumulator.set(c.customId, c));
to: next.components.forEach(c => accumulator.set(c.data.custom_id, c.data));
It is worst practise, but for testing feature it is fine.
then i get this error lol ```js
C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\structures\ModalSubmitInteraction.js:43
this.components = data.data.components?.map(c => createComponent(c)) ?? [];
^
TypeError: createComponent is not a function
at C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\structures\ModalSubmitInteraction.js:43:54
at Array.map (<anonymous>)
at new ModalSubmitInteraction (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\structures\ModalSubmitInteraction.js:43:45)
at InteractionCreateAction.handle (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\actions\InteractionCreate.js:69:25)
at Object.module.exports [as INTERACTION_CREATE] (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketShard.onPacket (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:22)
at WebSocketShard.onMessage (C:\Users\Lowe\Documents\Command maker\node_modules\discord.js\src\client\websocket\WebSocketShard.js:304:10)
at WebSocket.onMessage (C:\Users\Lowe\Documents\Command maker\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:390:28)
its a known error, theres a pr for it already
ok thanks
should snowflakes be stored in my db as a string or bigint
You can save it as you want, but discord.js works with a string ones.
in that case why does snowflake util use bigints? faster operations?
To work with a number to calculate timestamp, worker id, process id and increment
k
TypeError: (intermediate value).setStyle is not a function
at Object.run (D:\Bot\commands\Developer\eval.js:65:18)
at module.exports (D:\Bot\events\guild\messageCreate.js:199:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5) Promise {
<rejected> TypeError: (intermediate value).setStyle is not a function
at Object.run (D:\Bot\commands\Developer\eval.js:65:18)
at module.exports (D:\Bot\events\guild\messageCreate.js:199:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
}
help
code:
let button = new ButtonComponent()
.setStyle(ButtonStyle.Primary)
.setCustomId('131')
.setEmoji({ name: 'red1_lixeiraa', id: '911990320395337748', animated: false })
let rowButton = new ActionRow()
.addComponents(button)
Use ButtonBuilder, not component
Use ActionRowBuilder
Not ActionRow
Read the guide
Check the pins
why the latest dev version hasn't published on npm yet?
It's done on a periodic basis
seems like the publish dev script is broken again
but latest commit was made on 24hrs ago
ooooohh.... 💀
in this version we should use @discordjs/builders instead of exporting them directly from discord.js?
How do I use intents?
C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\src\Structures\Client.js:3
const intents = new Discord.Intents(32767);
^
TypeError: Discord.Intents is not a constructor
at Object.<anonymous> (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\src\Structures\Client.js:3:17)
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 Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object.<anonymous> (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\src\index.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
Read the pins
How do I import that?
You should know, it's just a changed name
What do I put for the name
Did u even read the pins??
Yes
I am supposed to import GatewayIntentBits
From discord-api-types
Idk how to do "from"
That's basic import syntax, if u are using commonjs, just require it
DUDE
What is the big deal with just telling me?
we don't spoonfeed here
Its not spoonfeeding
u can literally google "js import syntax" and get all ur answers
Google first.
Is it not a console thing?
yikes please learn JS
import GatewayIntentBits from "discord-api-types"?
it's a named export, not a default one
Wrong, it's not the default export, destructure it
import { GatewayIntentBits } from "discord-api-types"?
Yeah
But I can't import it outside a module
Then require it... this is not djs related
so
const api = require('discord-api-types")
const intents = new api.GatewayIntentBits(32767)
?
You can import from discord.js
node:internal/modules/cjs/loader:488
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord-api-types\package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:335:9)
at packageExportsResolve (node:internal/modules/esm/resolve:560:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object.<anonymous> (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\src\Structures\Client.js:3:13) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
you have to use versioned imports with dapi-types like 'discord-api-types/v10'
Just import from discord.js
I don't think you can still do that in v14
you can
and should
const Discord = require("discord.js");
const intents = new Discord.GatewayIntentBits(32767);
```?
No, that's enum
Discord.Intents(...)?
First of all you shouldn't use this number. Pick the intents you need and use only those
I think IntentsBitfield now
That worked
Not really though
C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\util\Util.js:333
if (!Object.hasOwn(given, key) || given[key] === undefined) {
^
TypeError: Object.hasOwn is not a function
at Function.mergeDefault (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\util\Util.js:333:19)
at new BaseClient (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\BaseClient.js:25:25)
at new Client (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\Client.js:42:5)
at new Client (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\src\Structures\Client.js:9:9)
at Object.<anonymous> (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\src\index.js:4:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
``` I have this error now
update nodejs to 16.9+
Node version?
Finally
Thank you
Is there a way to make modals like OG slash command style before the SlashCommandBuilders were made?
sure, you can pass objects to it, refer to the discord API docs for the structure
https://srcshare.io/?id=6232b0d62370930ba1a1a08b The modal shows up but I still get this error?
known bug
Also does the submit button not work unless you handle what happens when it gets submitted?
Hey, is there a page that shows new features with V14?
Pins
for some reason "discord.js": "^14.0.0-dev.1647259751.2297c2b" im stuck in this commit on d.js dev
is the build not yet done?
dev deploy script is probs broken again
publish dev on actions do work fine as far as I can see
I get this error on the newest version of discord.js@dev, what do I do?
install builders dev version
npm i discord.js@(what do i put here)
I said builders
npm i @discordjs/builders@dev
oh mb
How can I fix this?
Tried as Message, didnt work
you can use the interaction.inCachedGuild() type guard at the beginning
but could you try and log msg afterwards?
and this is your followUp message, correct? make sure it is
Yes
I logged msg
okay then so you should be fine 👍🏻
So I only add interaction.inCachedGuild() before sending the msg?
it's a type guard, have you not used Array.isArray(<thing>)?
I have, but not sure how to use interaction.inCachedGuild()
you return if it returns false
basically,
if the interaction wasn't sent from a cached guild, just return
what do I do with this error then?
wait I think I figured it out, sry
wait there is a way to edit ephemeral msgs right? cus when I try doing it it doesn't work and throw 3 unknown message error
editReply()
i don't know how you'd edit an ephemeral followup
editReply works, but it throws 3 unknown message errors wth
It only happens when I use an ephemeral interaction
and only in v14
.addChoice is removed at v14 and if yes, what should I use instead?
addChoices
so just s is added? i have seen someone saying its removed or smth.
pretty much yea, it's the same as addChoice but it supports multiple parameters
alr, thank you
btw where can i see v14 changes?
the pins
alr, reading rn
I am using the guildBanAdd emitter and it doesn't get fired idk why but the other events are working like ready message emitter and interaction and not guildBanAdd i tried to find any issue but couldn't find any can someone help me?
do you have the GuildBans intent enabled?
yes i do
uhh sorry my bad i just saw i had the intent commented out
Wait so now its addChoices("something", "something", "something") etc...?
yes
alr, ty
if something is a choice object ofc
How are we supposed to use .setColor with EmbedBuilder()?
https://discord.js.org/#/docs/discord.js/main/typedef/ColorResolvable
this is specifically the djs exported EmbedBuilder
and not the one on Builder
i believe that one only takes in a number
no, only decimal or rgb array
Oh so I need to find decimal for color want to use
I believe you can use an hex code too
Prepending 0x to it, like 0xff00ff
meh
Known issue that is fixed in https://github.com/discordjs/discord.js/pull/7649. Dunno when it’ll be merged tho 😦
ah thanks :D, do you know if i can install this this pr using npm (doubt its possible
)
No I don’t think so :(. You can manually make changes in your local node modules. That’s what I’ve done so I can keep developing
okay thank you 
@urban belfry hi in v14
MessageAttachment is not defined
Do not ping #rules 6
Define it
İs not a cunstoactor
#rules 4
It's been pending review for two days
Is there a way I can help push that PR over the finish line? Or is it just dependent on that dev to update the types?
Its blocking a signup feature I want to add to my community 😦
It seems that the PR is only left for review (as the comments are resolved) you really can't do much other than waiting for now

Is it possible to send a modal error? Or like the error it shows at the top with a custom message?
Ideally I want to validate a field on the server and show the user if their input is invalid with that message at the top of the modal, rather than as a text reply
Nope iirc
aw boo. That kind of sucks
I dont think so, it doesn't accept string
it's not a string, you pass the hex literal
setColor(0xff00ff)
how can I timeout a member? - for a specificf amount of time
Documentation suggestion for @scarlet tangle:
GuildMember#timeout()
Times this guild member out.
thanks
you should be able to pass hex strings now to setColor
Oh alr
How can I edit interaction from his response?
You can do Interaction.message.interaction but it's not gives you any useful options
what
i don't think you can edit interaction
You probably just want to use Interaction.update() if I get what you want
is there a way to add something else than a text component to a modal?
not yet afaik
ohk
MessageActionRow is now ActionRowBuilder?
yea
Thanks
for making one, yes
it is that
TypeError: (intermediate value).setDescription is not a function```
code:
```js
= new Discord.Embed().setDescription(```
EmbedBuilder
k
new issue: ZodError or something
think i figured it out
nvm
Or can check
Id the interaction is in dm
<Interaction>.inCachedGuild()
inGuild()
Or wehn some one use the interaction in dm how to know is in dm ?
it returns a boolean
if(!interaction.inGuild) return interaction.reply('you cant use in dm ')
???
it's a method, not property
Do I change any of this in v14?
yeah ComponentType.Button
yes, make sure ComponentType is imported
this is the correct one
Thanks
I keep getting this error when I try to send/update/edit an ephemeral interaction, what do I do?
you have to use Interaction#editReply (reply) or Interaction#webhook#editMessage (followUp) to edit ephemeral messages
Should i use Embed or UnsafeEmbed now?
EmbedBuilder
Oh, thanks
How can I specify a SelectMenu in a modal? I keep getting a type error
const fourthActionRow =
new ActionRowBuilder<SelectMenuBuilder>().addComponents(
new SelectMenuBuilder()
.setOptions(
{
label: `Yes`,
value: `true`,
},
{
label: `No`,
value: `false`,
}
)
.setCustomId(`signupModalTeam`)
);
modal.addComponents(fourthActionRow);
Error
Argument of type 'ActionRowBuilder<SelectMenuBuilder>' is not assignable to parameter of type 'ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>'.
Type 'ActionRowBuilder<SelectMenuBuilder>' is not assignable to type 'ActionRowBuilder<TextInputBuilder>'.
Types of property 'addComponents' are incompatible.
Type '(...components: SelectMenuBuilder[]) => ActionRowBuilder<SelectMenuBuilder>' is not assignable to type '(...components: TextInputBuilder[]) => ActionRowBuilder<TextInputBuilder>'.
Types of parameters 'components' and 'components' are incompatible.
Type 'TextInputBuilder' is missing the following properties from type 'SelectMenuBuilder': setMinValues, setMaxValues, setDisabled, options, and 2 more.
is this a discord.js limitation or discord API one?
that is a bizarre limitation
Its still shows the same ZodError, except Number recieved String. I even tried Util.resolveColor("RED"), but same
how to make this buttons
thx
What is the latest discord.js dev version is it still 97c2b??
14.0.0-dev.1647259751.2297c2b
So now SelectMenuComponent is renamed to SelectMenuBuilder?
To create them yes
Is that for all of them or there are exceptions
When creating components they're all WhateverBuilder now yeah
why new dev version isnt released yet? its been 4 days ~_~
What are the types of components for interaction modals?
I'm trying to find on that is good for stating a small sentence.
The one on the guide only shows a paragraph.
there are only 2 types, short and paragraph, use short then
Thank You.
const error = new Discord.Embed()
.setTitle('Error')
.setColor('ff5959');```
My embed isn't formatting. It simply returns `TypeError: (intermediate value).setTitle is not a function`. I haven't read anything that suggests a new function.
Ohhhhh
Oops
const button = new ButtonBuilder()
.setCustomId("modal")
.setLabel("Click to show Modal")
.setStyle(1),
actionRow = new ActionRow().addComponents(button);```
Line 10 is actionRow = new ActionRow()....
Ohh it is ActionRowBuilder
When will v14 realesed
you know this already
when it's ready
ok
why in this pull (https://github.com/discordjs/discord.js/pull/7686), put the old things back as the getters (title, description) if there is the appropriate Embed class that has those getters?

Because you cant get anything from it currently
you can by accessing data
then idk
ah, so what's the use?
Idk you can access data
Does Latest Discord.js@dev Require builder dev too??
Yes
Ahh Ok, thank you
But if they add getters you dont have to change your code
why the latest dev version hasn't published on npm yet?
Yes seems like an issue with the publish
Maybe its private
Private?
Private means it isnt public so only few peoples can use it
I know what private means I was more or less asking why it would be private.
what's that has to do with this?
the dev version is supposed to release every 12 hours, the last one was published 4 days ago
Yes, something went wrong
<Parameter>.guild.channels.cache.get(<Parameter>.id).delete('Channel Created | Not Whitelisted');
i am using the channelCreate emitter and i am deleting the channel that's getting created but when i passed in the delete function parameters reason it doesn't show the reason in the audit logs why tho?
It's a bug in discords end, not discord.js
oh ok thanks
on latest dev release
try to install @discordjs/builders@dev
ok also Embed is renamed to what?
to build an embed EmbedBuilder
So we cant use Embed on latest dev version?
no
not to build/set properties
hmm
why can't it open?
Because you dont have permissions to use this command
This a known issue or am I doing something incorrectly?
if (user instanceof GuildMember) {
let hasRole = user.roles.cache.has('938398877160206347');
console.log(hasRole);
}
Same thing happens when using cache.some(role => role.id == '938398877160206347');
enable guilds intent
Worked, cheers
The "Embed" class constructor is private and only accessible in the class declaration.ts(2673) WTF?
Library version: 14.0.0-dev.1647130097.549716e
EmbedBuilder
really?
Type 'EmbedBuilder' is not assignable to type 'APIEmbed | Embed'.
Type 'EmbedBuilder' is missing the following properties from type 'Embed': fields, title, description, url, and 5 more.
Ts-expect-error it for now it’s a bug
So how should I be?
put // @ts-expect-error above the line with the error
Is the TextInputs on modals fixed?
Hello when im trying to fetch audit log message delete
Always give me (is not int)
Show the full error and code
Hi guys, is it possible to use interaction#fetchReply() and use a reaction collector on a deferred ephemeral interaction reply?
you can't react to ephemeral messages, right? so no
My bad, I completely forgot about that.
Can I use interaction#followUp() to send this particular message non-ephemeral?
yea
Cool, thanks
Can someone look into why the latest pushes to main did not get published as dev release in NPM? (After a couple of days)
Is the embed colour bug fixed?
yes
It still isn't working for me...
show
let error = new Discord.EmbedBuilder()
.setTitle('Error')
.setColor('ff5959');```
it still doesn't take a ColorResolvable
Do '#ff5959' or 0xff5959
the second one
still isn't working
.setColor(0xff5959)
How can I use the main repo without having to use the npmjs release?
Yeah. Dev version not published yet.
yep
The dev version publish action is run, but it doesn't pass the condition.
@wicked nebula you could try and npm pack it yourself if you clone the repo. then npm i pathToTgz
My modal submits aren't working. My client isn't even receiving an event at all.
show how you did
Wdym? It just spits out an error from discord.js itself. There is no error from my code. If you must see my code though, js if (interaction.isModalSubmit()) { return console.log(interaction); };
Then show the error. #rules 4
And I think that error was fixed, but not in dev version yet
this.components = data.data.components?.map(c => createComponent(c)) ?? [];
TypeError: createComponent is not a function
I don't see how component creation could cause this because my modals are loading fine.
Ohhh
I guess I just have to wait 😕
yep
Well one of the factors in the condition is not met, so let's see what that is 
???
.addChannelTypes([ChannelType.GuildText])
wait this still takes an array and not a rest parameter
wait, no that's not right, the sources say it does i completely misread that due to your code being wrong
@scarlet tangle don't pass an array
oh
your original code was right, you should pass multiple parameters
addChannelTypes(GuildText, VoiceChannel)
```like so
oh okay
thank you
Why discordjs/builders is not part of the discord.js package and will it be on v14?
it's a dependency but can also be used without the core lib, therefore it's its own package
Okay, got it, thanks.
https://srcshare.io/?id=6235424a2370934091a1a0e7 Can someone help me?
known bug, there's already a pr to fix it
Kk
So just wait?
yes
Is there a way for me to submit bugs or look at bugs that were already submitted?
you can take a look at prs and/or issues, or ask in this channel
Is there any way to be notified when its fixed?
You could subscribe to the PR so GitHub would send you email notifications about it but that's it
TypeError: Cannot read properties of undefined (reading 'resolveColor')
Is this module bug?
Yes
Not modal, EmbedBuilder bug
btw you're supposed to use EmbedBuilder and not Embed
🥲
@velvet tendon
its known,
I hope this will be fixed in the future?
Yes
oh, ok. thx
🤨
Also known
Did you install the wrong version?
Fixed by reinstalling the library. thx
Anyway we can't use modals because the last update of dev version was
5 days ago and it doesn't includes fixes of PR #7649
Ahh
Oh well
"at dev" 🙃
gotta be patient
Hey guys, if I use interaction#followUp() and then use interaction#fetchReply(), will the fetched reply be the initial reply or the followUp message?
I'm having trouble reacting to a non-ephemeral followUp message after deferring the initial interaction reply with the ephemeral option.
Alternatively, is there a way to disable the ephemeral parameter before using interaction#editReply()?
it should fetch the initial reply
and if you make the initial reply ephemeral you cant change it in editReply
simply put, you can't just edit a message from ephemeral to non ephemeral and vice versa
That's what I had noticed, which is why I was hoping to do it with a followUp or update, would that be possible or should I send this particular message using the interaction#channel#send method?
I fixed it, I switched from reply deferral to direct replies because the command should never take longer than 3 seconds to return an initial response.
I get this error on every ephemeral interaction (I mean if I send them or edit them), only happens in dev version, anyone knows why?
You need to defer the reply when u recieve the interaction event
I think
i already do it
Bro do you mind telling me how to get full error sent? For me it only shows Missing Permissions, Unknown Message and stuff
Like how it shows under reason for you
<Error>.stack
Okay tysm :)
don’t defer
Can someone tell me what I'm doing wrong here?
create action row
and use ModalBuilder
hm I dont understand
instead of Modal, use ModalBuilder
Is there a way not to use discord builders
what do you want to do? pass raw objects? if it's typed, go right ahead
Guys, my friend has a bot on regular commands, he rewrote it to slash commands. It has 100+ servers. How can he make the bot register commands on the servers?
register it globally?
Shouldn't the bot be transferred to the server?
what
what do you mean by transferred?
reinvite on server
applications.commands scope, yes
you can't register on guilds without the scope either
register them globally
The bot does not have the right to create commands on the server, do you think global registration of commands will help solve the problem without reinviting to the server?
nothing will, if they don't have the scopes, they won't be registered on the guild, period
whether or not it's guild specific or global is irrelevant
if they don't have the scope, they need to reinvite
and note that by reinvite i mean just reuse the link, you don't have to kick, just use the link again
Too bad you can't do it yourself
of course not it's not your server, you can try to put that on your bot's about me or status
or if anyone tries to use a prefix command just tell them you switched or smth
hello
is there a way to
change playing a game of discord bot
in node js
im new to node js
can someone help pls :)
ClientUser#setPresence()
Sets the full presence of the client user.
👇 Is this error casue by discord.js?
/mnt/c/Users/Kay/Documents/KayBotTypeScript/node_modules/zod/lib/types.js:17
const error = new ZodError_1.ZodError(ctx.common.issues);
^
ZodError: [
{
"code": "invalid_union",
"unionErrors": [
{
"issues": [
{
"code": "invalid_type",
"expected": "number",
"received": "string",
"path": [],
"message": "Expected number, received string"
}
],
"name": "ZodError"
},
{
"issues": [
{
"code": "invalid_type",
"expected": "array",
"received": "string",
"path": [],
"message": "Expected array, received string"
}
],
"name": "ZodError"
}
],
"path": [],
"message": "Invalid input"
}
]
at handleResult (/mnt/c/Users/Kay/Documents/KayBotTypeScriptJDA/node_modules/zod/lib/types.js:17:23)
at ZodUnion.safeParse (/mnt/c/Users/Kay/Documents/KayBotTypeScriptJDA/node_modules/zod/lib/types.js:130:16)
at ZodUnion.parse (/mnt/c/Users/Kay/Documents/KayBotTypeScriptJDA/node_modules/zod/lib/types.js:109:29)
at EmbedBuilder.setColor (/mnt/c/Users/Kay/Documents/KayBotTypeScriptJDA/node_modules/@discordjs/builders/src/messages/embed/Embed.ts:50:40)
at Object.<anonymous> (/mnt/c/Users/Kay/Documents/KayBotTypeScriptJDA/src/Config.ts:18:45)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Module.m._compile (/root/.nvm/versions/node/v17.4.0/lib/node_modules/ts-node/src/index.ts:1455:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Object.require.extensions.<computed> [as .ts] (/root/.nvm/versions/node/v17.4.0/lib/node_modules/ts-node/src/index.ts:1458:12)
at Module.load (node:internal/modules/cjs/loader:975:32) {
issues: [
{
code: 'invalid_union',
unionErrors: [Array],
path: [],
message: 'Invalid input'
}
],
format: [Function (anonymous)],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)]
}
yeah builders
the bold makes it worse
but show me your EmbedBuilder.setColor
OK I changed it to code block
yeah pass 0xF4C7B4 instead of that string
OK I'll try it
Wow it works
But...... is this bug?
🤔
Because I watch index.d.ts and it written that I can use color string like “#F4C7B4”
Is there anyway to make a collector on a modal?
no it's a raw hexadecimal value
.addField() was removed in favour of .addFields()
no, if you find this confusing import Util and use Util.resolveColor("Color name")
so no add.Field() now?
no addField, yes
else
it accepts a rest parameter, so .addFields({}, {})
aah
didn't work
^
TypeError: Cannot read properties of null (reading 'setPresence')
at Object.<anonymous> (d:\Node JS\Dry memer\index.js:58:13)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
hello
is there a way to
change playing a game of discord bot
in node js
im new to node js
can someone help pls :)
do it in ready event
what is ready event?
(event) Client#ready
Emitted when the client becomes ready to start working.
Client.on(“ready” => {
// code here
})
```this collector does not run the end script.
DMChannel#createMessageCollector()
Creates a Message Collector.
it has examples
your implementation is completely wrong
owh lol, thanks
FirstMsg = channel.messages.cache.get("954764941372559361")
FirstMsg.edit({embeds: [emb]})``` there is probably something really wrong that I fail to see
the FirstMsg returns undefined
this channel is for the dev version of d.js, if you are on v13 ask in #djs-help-v14
yeah i am on the beta just asking here incase it was changed
Theres no message with this id in the cache
the message isn't cached, nothing was changed regarding that
there is tho
MessageManager#fetch()
Gets a message, or messages, from this channel. (more...)
use this method instead of relying on the cache
thanks
now apperiantly edit is not a function :/
Fetch returns a promise, resolve it
owh yeah
MessageManager#edit()
Edits a message, even if it's not cached.
if you only want to edit the message no need to fetch it
owh, thanks
let guild = client.guilds.cache.get("952936917132013568")
let channel = guild.channels.cache.get("954636030248644649")``` it worked on the ready event but since I need it to run every 10 seconds I moved it onto the index.js - seems to throw some errors
Are you trying to spam the API??
I woulden't say so, wdym by that?
I don't know why would you get a channel every 10 seconds... It looks like an API spam to me 😡
okey apperiantly I forgot a 0 on the interval so yes - owh and that too
thanks lol
owh - for some reason moving the get out of the function breaks the code
okey I put my function in another function and now it worksnvm
How is it api spam ...he is trying to get the channel from cache.
This isn't his entire code and he gets the channel to do something with it every 10 seconds
to update the embed which shows the uptime of a bot 😅
I mean... Yeah this is actually API spam to edit a message every 10seconds and I would descourage you from doing that
Ill add stuff like not running it if the data does not change and night time interval increase etc., for now im just tryna get the basics figured out.
Don't constantly edit messages, create a command that shows the uptime
probably a safer bet, imma use a web-api to recieve the data, round the numbers and compare. If they are similar then no updates, if not then it updates. Altho perhaps a button to trigger it wont be such a bad idea else then auto refreshing.
expected: 'string',
received: 'undefined'
where can I find v14 source code ?
<3
(lmao I thought this is v13)
You can select branches here
Hello, someone know if is there a way to do "forms" with discord.js?
Thx <3
why i can only add 5 text imput to discord modal thinks
Btw, what's the new way to create embeds?
I think its the same
Ask discord
Nah, tried MessageEmbed and there isnt a class like that
Its EmbedBuilder
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [],
"message": "Required"
}
]
*deleted messages* {
issues: [
{
code: 'invalid_type',
expected: 'string',
received: 'undefined',
path: [],
message: 'Required'
}
],
format: [Function (anonymous)],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)]
}```
You passed undefined instead of string somewhere
I dont understand why that error is confusing to people 
Because that can happen for required stuff
Like if you make a select menu without a placeholder which i believe is required then it'll throw that error
You never called setPlaceholder
That's why it's not easy to narrow down
Plain english errors are confusing to some people
You don't need to pass nothing to a method for it is what I'm saying
You can just not do anything and it'll tell you you passed undefined
Trust me, builder errors are trash right now and it's expected for users to not get the errors
well, maybe its gonna be better after the @sapphire/shapeshift pr gets merged
I didnt see it, when I looked at it second time I felt stupid
how do you wait for a modal submit without using the interactionCreate event?
Construct new InteractionCollector
what the
EmbedBuilder
<3
Is there a way to have an optional modal field?
no
you can set default value tho .setValue()
default value?
It will open with the text you passed in setValue method
Oh okay.
Last question guys, is there a function to return an error message to a user?
Catch the error and reply to interaction with error message
When is the modal submit event going to be fixed?
No, I mean like send a custom message in this kinda style
not possible
whats wrong with it
it doesn't work. it's an error with the actual library and not my code.
If only we knew the error
bruh it is on the pr...
What I meant is stating there's an error and not providing it is practically useless
How do you utilize the development package of DJS? I installed the development package using npm i discord.js --save-dev, but it doesn't appear in my package list.
read the pins
^
TypeError: Cannot read properties of undefined (reading 'cache')```
anyone has a fix?
mb. how does adding options work now? for deploying cmds i dont use json, rather slashcommandbuilder.
new SlashCommandBuilder().setName('waifu').setDescription('Dumb command that people like.').addStringOption(option => option.setName('type').setDescription('The type of waifu to display (OPTIONAL).'));
however the new dev build ig changes how options work which is a bit confusing
*ex cmd
it works the same as before
i mean the syntax is diff
is what i mean sry
deploying the cmd results in option.setName().setDescription().addChoice not being a functon
addChoices(), not addChoice
TypeError: option.setName(...).setDescription(...).addChoice is not a function
ah ic whoops. ty
is this in a default discord.js library?
no
@discordjs/builders
I'm attempting to use addChoices, but for some reason the following results in an error:
new SlashCommandBuilder().setName('ping').setDescription('test cmd').addStringOption(option => option.setName('option').setDescription('Optional option.').addChoices({ label: "Ping", value: "ping" }));
Error:
ZodError: [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
0,
"name"
],
"message": "Required"
}
]
Never mind, realized it's not label rather name.
How do I install @discordjs/builders?
nvm
I fixed it
node:events:504
throw er; // Unhandled 'error' event
^
TypeError: Discord.MessageEmbed is not a constructor
at C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\src\Events\interactionCreate.js:14:23
at Client.emit (node:events:526:28)
at InteractionCreateAction.handle (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\actions\InteractionCreate.js:76:12)
at Object.module.exports [as INTERACTION_CREATE] (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketShard.onPacket (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:22)
at WebSocketShard.onMessage (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\websocket\WebSocketShard.js:304:10)
at WebSocket.onMessage (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:526:28)
at Receiver.receiverOnMessage (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\ws\lib\websocket.js:1137:20)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:383:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21)
Can someone help me with this error?
node:events:504
throw er; // Unhandled 'error' event
^
TypeError [MODAL_SUBMIT_INTERACTION_FIELD_NOT_FOUND]: Required field with custom id "inputOne" not found.
at ModalSubmitFieldsResolver.getField (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\structures\ModalSubmitFieldsResolver.js:35:23)
at ModalSubmitFieldsResolver.getTextInputValue (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\structures\ModalSubmitFieldsResolver.js:45:24)
at C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\src\Events\interactionCreate.js:16:47
at Client.emit (node:events:526:28)
at InteractionCreateAction.handle (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\actions\InteractionCreate.js:76:12)
at Object.module.exports [as INTERACTION_CREATE] (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketShard.onPacket (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:22)
at WebSocketShard.onMessage (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\discord.js\src\client\websocket\WebSocketShard.js:304:10)
at WebSocket.onMessage (C:\Users\Ultimate Gamer\Desktop\DJSV14TESTING\node_modules\ws\lib\event-target.js:199:18)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:383:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21) {
[Symbol(code)]: 'MODAL_SUBMIT_INTERACTION_FIELD_NOT_FOUND'
}
``` Fixed it new error
Is there timeout support?
Getting the error invalid form of body and that the label and value fields are required even though I have it.
const selectMenu = new Discord.ActionRowBuilder()
.addComponents(
new Discord.SelectMenuBuilder()
.setCustomId("help-" + interaction.member.id)
.setPlaceholder('Select')
.addOptions([
{
label: 'smth',
description: 'A detailed description',
value: 'smth',
},
]),
);
DiscordAPIError[50035]: Invalid Form Body
data.components[0].components[0].options[0].label[BASE_TYPE_REQUIRED]: This field is required
data.components[0].components[0].options[0].value[BASE_TYPE_REQUIRED]: This field is required
addOptions takes rest parameters instead of an array in v14
Ah I see. Thanks!
On the website, it says setFooter takes only a FooterOptions object. However, they haven't added the link yet, so I'm not sure how to utilize setFooter.
I'm recieving this error for any button I try to create
addComponents takes rest parameters, not an array
🤡 Thks
How to make SelectMenu
Where error
setOptions takes rest parameters
No this[]?
no
What
It's a rest parameter
So you omit the square brackets
Rest parameters
The rest parameter syntax allows a function to accept an indefinite number of arguments as an array, providing a way to represent variadic functions in JavaScript.
so
known bug, there's already a pr to fix it
okay
which pr?
MessageAttachment is still called as MessageAttachment in V14 or its AttachmentBuilder or something?
its called Attachment
new Discord.Attachment()
new Attachment()
How to make emoji in menu
in a menu option?
Yes
emoji:{name:""}
No this ?
no
are you using builders?
Yes
okay
.setEmoji({
name: "emoji name or emoji",
id: "id of emoji"
})
if the emoji is default use
only name:
name: 😭
how do i add it to my bot?
you can't install prs anymore, just wait till it gets merged (and for it to be available in a dev version)
uh
okay
Oh alr
message.deleted property is removed in v14, so how to check if message is available for deleting?
C:\Users\Kay\Documents\KayBotTypeScriptJDA\node_modules\@discordjs\rest\src\lib\handlers\SequentialHandler.ts:488
throw new DiscordAPIError(data, 'code' in data ? data.code : data.error, res.status, method, url, requestData);
^
DiscordAPIError[50035]: Invalid Form Body
embeds[0].description[BASE_TYPE_REQUIRED]: This field is required
at C.runRequest (C:\Users\Kay\Documents\KayBotTypeScriptJDA\node_modules\@discordjs\rest\src\lib\handlers\SequentialHandler.ts:488:11)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async C.queueRequest (C:\Users\Kay\Documents\KayBotTypeScriptJDA\node_modules\@discordjs\rest\src\lib\handlers\SequentialHandler.ts:201:11)
at async MessageManager.edit (C:\Users\Kay\Documents\KayBotTypeScriptJDA\node_modules\discord.js\src\managers\MessageManager.js:133:15) {
rawError: {
code: 50035,
errors: { embeds: [Object] },
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'patch',
url: 'https://discord.com/api/v9/channels/647650604684148748/messages/954974830153855046',
requestBody: {
files: [],
json: {
content: '⏸️ 播放暫停',
tts: false,
nonce: undefined,
embeds: [Array],
components: [Array],
allowed_mentions: undefined,
flags: 0,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined
}
}
}
I remember that embed.description is not required, isn't it?
🤔
Code?
case "pause":
this.player.pause()
await btn.editReply({
content: ":pause_button: 播放暫停",
embeds: [embed],
components: [this.enablePauseActionRaw, this.enableVolumeRaw]
})
break;
It successfully edit the content
but my console output that error
Show me the embed bruh
Embed {
data: {
url: 'https://www.youtube.com/watch?v=OtEJ6LGCW-U',
type: 'rich',
title: '汪蘇瀧 - 有點甜(Official MV)',
thumbnail: {
width: 120,
url: 'https://i.ytimg.com/vi/OtEJ6LGCW-U/default.jpg',
proxy_url: 'https://images-ext-1.discordapp.net/external/R0gdWWBeNSel-r1eUaFPUZ-0boWNiie-77l4X7J-TU8/https/i.ytimg.com/vi/OtEJ6LGCW-U/default.jpg',
height: 90
},
fields: [ [Object] ],
color: 16041908,
author: {
proxy_icon_url: 'https://images-ext-1.discordapp.net/external/8DGlyA_TgJ52rblQTgQp4dsvD31YNOoRxtZwFi8EP-o/https/yt3.ggpht.com/ytc/AKedOLQ_E6p34tC-OLKoauI81NdB4r5XP56Kc00wmrgZ%3Ds48-c-k-c0x00ffffff-no-rj',
name: 'TheSilenceW',
icon_url: 'https://yt3.ggpht.com/ytc/AKedOLQ_E6p34tC-OLKoauI81NdB4r5XP56Kc00wmrgZ=s48-c-k-c0x00ffffff-no-rj'
}
}
}
this is what you get from logging embed?
then use embed.data
No. I meant send me the code y how you created it
const embed=this.player.infoMessage.embeds[0]
this isn't an issue with djs really, it's your own data and i've already told you, if that's what logs, then you need .data
I changed to const embed=this.player.infoMessage.embeds[0].data but it still output same error
Log this.player
And this.player.infoMessage:
<ref *1> Message {
channelId: '647650604684148748',
guildId: '647643447712415754',
id: '954981382264877096',
createdTimestamp: 1647755704228,
type: 0,
system: false,
content: '▶️ 開始播放',
author: ClientUser {
id: '784006509449314304',
bot: true,
system: false,
flags: UserFlagsBitField { bitfield: 0 },
username: 'Kay Discord JS Test',
discriminator: '2294',
avatar: null,
banner: undefined,
accentColor: undefined,
verified: true,
mfaEnabled: true
},
pinned: false,
tts: false,
nonce: null,
embeds: [ Embed { data: [Object] } ],
components: [
ActionRow { data: [Object], components: [Array] },
ActionRow { data: [Object], components: [Array] }
],
attachments: Collection(0) [Map] {},
stickers: Collection(0) [Map] {},
editedTimestamp: 1647755704637,
reactions: ReactionManager { message: [Circular *1] },
mentions: MessageMentions {
everyone: false,
users: Collection(0) [Map] {},
roles: Collection(0) [Map] {},
_members: null,
_channels: null,
crosspostedChannels: Collection(0) [Map] {},
repliedUser: null
},
webhookId: null,
groupActivityApplication: null,
applicationId: null,
activity: null,
flags: MessageFlagsBitField { bitfield: 0 },
reference: null,
interaction: null
}
Console log this.player.infoMessage.embeds
[
Embed {
data: {
url: 'https://www.youtube.com/watch?v=OtEJ6LGCW-U',
type: 'rich',
title: '汪蘇瀧 - 有點甜(Official MV)',
thumbnail: [Object],
fields: [Array],
color: 16041908,
author: [Object]
}
}
]
Okay now Console log this.player.infoMessage.embeds.Embed
its array lel
console.log(this.player.infoMessage.embeds[0]);
embeds - Array, Embed - name of class(?)
No really? 😱
ZodError: [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [],
"message": "Required"
}
]
so guess I am missing something which i should put into, but no idea what I am missing
found it, I should've used custom_id instead of customId
you can use the djs exported builders, i believe they use those cases there
yeah just checked out and it is. Just moved v13 to v14, Im looking the way which fits to me the best. Still these are very confusing to me, but i'll figure it out
--
I'm wondering will awaitModalSubmit() be a thing in the future, because the pr of v13 has one.. so?
or should I use InteractionCollector?
@worthy fog These
These is what output by console.log(this.player.infoMessage.embeds[0]);
Command Interactions don't have attachments support yet right?
{ name: 'file', type: undefined, value: '955011180173344868' } (This is what I get for the data with a type 11 command)
they support attachments ig,
<CommandInteraction>.options.getAttachment()
https://github.com/discordjs/discord.js/pull/7200 this is the pr, and merged at feb
Oh, imo options.get() would simplify it for most devs... let me look into it! Thanks!
ah yes, it'll change the return type which will mess it up... nvm that!
CommandInteractionOptionResolver#getAttachment()
Gets an attachment option.
@worthy fog Oh I finally know what happed and how to triggered
const embed = new EmbedBuilder()
.setTitle("Test")
.setColor(0xf4c7b4)
.addFields({ name: "長度", value: "05:40" });
const button = new ButtonBuilder()
.setCustomId("hello")
.setStyle(ButtonStyle.Primary)
.setLabel("Hi");
const actionraw: ActionRowBuilder<ButtonBuilder> =
new ActionRowBuilder().addComponents(button);
const messageSent = await message.channel.send({
embeds: [embed],
components: [actionraw],
});
const collector = messageSent.createMessageComponentCollector({
componentType: ComponentType.Button,
time: 30e3,
filter: (i) => i.member === message.member,
});
collector.on("collect", async (but) => {
await but.deferUpdate();
const embed2 = messageSent.embeds[0];
const newEmbed = new EmbedBuilder(embed2).toJSON();
await but.editReply({
content: "Hi",
embeds: [newEmbed],
components: [actionraw],
});
await message.channel.send("Finished");
});
on this line:
const newEmbed = new EmbedBuilder(embed2).toJSON();
if I put embed2 I'll get that error
if I put embed2.toJson() it work
no [0]
can test
because builders doesn't take an embed instance but APIEmbed in the constructor. You can use the static method EmbedBuilder.from(Embed)
Thanks
👍
What is Client's type? I don't want to set to any.
(This is TypeScript project)
The type is Client
Not a valid type.
Client does not include slashCommands property
You can't assign your own properties to client in typescript, you need to modify the class
Modify the class and then create the property
You can extend class
Or just modify original typings with declare module
is Modal for djs currently broken?
djs does not properly get the components, i wonder if there is pr to fix the problem
just extend the Client class
so the main branch of the repo's code is the white one, and I figured out the below one was a way to go.. I really don't understand what's happening.
the fields are grouped in a modal (i think) so that one just flats it out into a collection instead of a plain array.
umm.. okay?
so is there a pr to fix the code? since its not fixed on the main branch, im looking the pr which is open, and I could not find it.
or i am completely miscomprehending the situation, forgive me if it is
idk if there is one
👌 thanks for your answering
Hi, do someone know why when I'm trying to add commands to the guild only one is being added?
Routes.applicationGuildCommands('', ''),
{ body: [new SlashCommandBuilder()
.setName('')
.setDescription('')
.addNumberOption(option =>
option.setName('')
.setDescription('')
.setRequired(true))
]},
);```
because you pass only 1 command into body
I did the same code 3 times
You need to pass an array of commands to body. Or if you want to create a new command use post method of rest.
Have do i fix this?
To create an embed use EmbedBuilder
Oh has that been updated again
6 days still not published ;/

#7694 in discordjs/discord.js by vladfrangu opened <t:1647736267:R> (review required)
chore(ci): fix dev deploy workflow
📥 npm i discordjs/discord.js#ci/fix-autodeploy-misfortunes
@wicked nebula ^
Yea I saw it already
Hi how to join voice channel in v14
same process as v13, pins in #archive-voice
Modal components accepts only TextInputComponent?
Currently yes
api
Okay, thanks.
What do I add in .addComponents()
Action rows
Like this?
yes
Alright
where are the docs for the changes in v14
pins
ah
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/helpers/util' is not defined by "exports" in c:\Users\Bossy\Desktop\LightModeration\node_modules\zod\package.json imported from c:\Users\Bossy\Desktop\LightModeration\node_modules\zod\lib\ZodError.js
thats the full error?
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/helpers/util' is not defined by "exports" in c:\Users\Bossy\Desktop\LightModeration\node_modules\zod\package.json imported from c:\Users\Bossy\Desktop\LightModeration\node_modules\zod\lib\ZodError.js
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
at trySelf (node:internal/modules/cjs/loader:458:34)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:910:24)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (c:\Users\Bossy\Desktop\LightModeration\node_modules\zod\lib\ZodError.js:4:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}```
That seems an internal Zod error to me 🤔
Got it fixed. Reinstalled it.
But did the intents change?
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: DIRECT_MESSAGES.
DirectMessages
ah
Not in the types?
didn't get
Also the auto complete
DiscordAPIError[50035]: Invalid Form Body
data.components[0].components[BASE_TYPE_REQUIRED]: This field is required
You need to add an action row which contains your text inputs
ModalBuilder.addComponents(...ActionRowBuilder)
Ah.
ty
c:\Users\Bossy\Desktop\LightModeration\node_modules\discord.js\src\structures\ModalSubmitInteraction.js:43
this.components = data.data.components?.map(c => createComponent(c)) ?? [];
^
TypeError: createComponent is not a function
known bug
Any PRs for it?
👌
when will djs v14 release?
when its ready, there is no eta
When will the issue from https://github.com/discordjs/discord.js/pull/7649 be pushed to the main branch?
DiscordAPIError[50035]: Invalid Form Body type[BASE_TYPE_CHOICES]: Value must be one of (0, 2, 4, 6, 13, 14, 15).
when its ready
Should probably use one of those
what's the event name for guild prune?
is there a emitter for that?
no it just fires multiple guildMemberRemoves
hmm but if there is no member kicked in the prune 0 members causes it to not emit the guildMemberRemove
unlikely
there is no event for it
0 -> no one gets removed -> no member remove events
unsure what you expect atm
hmm why do you need this specifically?
Regardless not sure if this is within the channel topic
well i was tryna make a anti raid stuff so some guilds try to prune users they either choose a role which is active or a role without sufficient members in it and are active to stop them in the first try i was finding a answer for it the discord api itself doesn't has it aswell the op codes is there any other way?
uhh sorry
siris was right, ask on #djs-help-v14
my bad i thought all kinds of help in the djs 14 can be asked here
Well yes, but v14 also didn’t change any behavior for pruning
Hi! Anyone know why i got this error?
DiscordAPIError[50035]: Invalid Form Body
components[0].components[BASE_TYPE_REQUIRED]: This field is required
at C.runRequest (C:\Users\felal\Desktop\PRODEFIX\Discord\Bot-Slash-3.0\node_modules\@discordjs\rest\dist\index.js:7:589)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async C.queueRequest (C:\Users\felal\Desktop\PRODEFIX\Discord\Bot-Slash-3.0\node_modules\@discordjs\rest\dist\index.js:5:3049)
at async MessageManager.edit (C:\Users\felal\Desktop\PRODEFIX\Discord\Bot-Slash-3.0\node_modules\discord.js\src\managers\MessageManager.js:133:15) {
rawError: {
code: 50035,
errors: { components: [Object] },
message: 'Invalid Form Body'
}
}
Code:
client.utils.disableAllButtons = (c) => {
for (let x = 0; x < c.length; x++)
for (let y = 0; y < c[x].components.length; y++) c[x].components[y].data.disabled = true;
return c;
};
message.edit({ embeds: [emb], components: client.utils.disableAllButtons(message.components) });
sounds like an empty row
ah, nvm, no type on the row 
or no row 
can't you use curlys and make it less confusing? and a for of loop
Could use forEach instead
could you log the data first @weak ridge ? maybe help narrow it down
Data?
or unfurling the errors object, maybe 
the return value from that function
Ok
[
ActionRow {
data: { type: 1 },
components: [ [ButtonComponent], [ButtonComponent] ]
}
]
what specific version of djs is this?
can you unfurl the error?
?
.catch(e => console.log(e.rawError.errors.components["0"].components._errors));
// [{ code: 'BASE_TYPE_REQUIRED', message: 'This field is required' }]
read the docs for setColor, either pass a hex literal or whatever's mentioned on the docs
I Checked My Code From Github Repo, But Ots Not Working
Tag suggestion for @exotic oriole from @urban belfry:
To help you we need more information:
• What are you trying to do?
• What is your code?
• What errors and debug logs do you have?
I am Trying To Make A Bot From d.js documentation and checking all the codes at every point but my bot is not working, it is starting but the slash commands are not working
that's still not enough, what is not working specifically?
errors?
is it even v14?
Wut
Is there specific reason that ModalBuilder does not accept customId in data, while TextInputBuilder does?
are you importing them both from djs?
i think yes i am
I installed the development version of DJS, but upon starting up my bot I get the error Object.hasOwn is not a function at line 9 where I run const client = new Discord.Client({ ... });.
const Discord = require("discord.js");
const config = require("./config/config.json");
const client = new Discord.Client({
shards: "auto",
allowedMentions: {
parse: [],
repliedUser: true,
},
intents: [
Discord.GatewayIntentBits.GuildMembers,
Discord.GatewayIntentBits.Guilds,
Discord.GatewayIntentBits.GuildMessages,
Discord.GatewayIntentBits.GuildVoiceStates,
Discord.GatewayIntentBits.GuildMessageReactions,
],
presence: {
status: "dnd"
}
});
Error: https://sourceb.in/W1KMM6rIvo
This is weird cause I don't call require("util") in my main file. It's the basic command handler, requiring the packages colors, fs, and discord.js, etc. Nothing crazy. I uninstalled and reinstalled every single package I have as well as DJS. The command I ran to install the development version is npm i discord.js@dev.
the question originates from here, after ^, I found that TextInputBuilder accepts customId, which is kinda confusing.
do you have node js 16.9 +?
lemme check. i believe so
nah it's meant to of course
i'll check if it's fixed on github and if not make an issue, perhaps even a pr
whoops mb. i have 16.6.2 lol
?
the djs exported builders are meant to take in the cameCase properties
okay if then, not accepting customId is a problem, right?
thanks, ill check the repo
yeah i've seen it, it doesn't
well i'm going to 😴 now
i'll notify the maintainers/contribs, thanks
👌 thanks!
So how is it done in v14.0 with these SelectMenuBuilders because i cant reply with them as Components 0.o
??
why you can't reply with them as Components
i got it to work i didn't specify the type.
I just used ActionRowBuilder() instead of ActionRowBuilder<MessageActionRowComponentBuilder>()
now its all working, might even be a fix for ur problem ^^
So i need to use that ActionRowBuilder<MessageActionRowComponentBuilder>()?
Did the trick for me atleast
No, you only need to use types in typescript
i use typescript
but that error is coming from the compiled javascript
can anyone help?
Show it
I can't help you since the @discordjs/builders package compiled code is too complex.
wait hold on
i found the problem.
When the modals was release ?
When it's ready
month ago in API