#djs-in-dev-version

1 messages · Page 16 of 1

scarlet tangle
#

but my embed works it just sends to discord test embed and my help embed it sends 2 different embeds

const Discord = require('discord.js')
const { MessageEmbed } = require('discord.js');
const { EmbedBuilder } = require('discord.js');
module.exports = {
  data: {
    name: 'help',
     description: "help how to use this bot",
    },
    execute(message, args, Discord, client){
      const helpEmbed = new EmbedBuilder()
        .setColor(0x0099ff)
        .setTitle('Help')
        .setDescription('This command is help about this discord')
    .addFields(
        { name: 'Commands', value: '-help\n-about\n-roles' },
        { name: 'Admin Commands', value: '-kick\n-ban\n-purges' },
        { name: 'Owner Commands', value: '-nuke\n-killserver' },
    )
    .setTimestamp()

    message.channel.send({ embeds: [helpEmbed] });
  }   
}

Code ^^^^

oak raft
#

it aint a language

copper jetty
oak raft
#

it aint a language

wicked nebula
#

How to use the type ApplicationCommandOptionData? I used to have an array of it as options:

{ 
options: [{
        type: "SUB_COMMAND",
        name: "create",
        description: "Create sticky message in a channel",
        options: [{
            type: "CHANNEL",
            name: "channel",
            description: "Channel to create the sticky message in",
            required: true,
            channelTypes: ['GUILD_TEXT']
        }, {
            type: "STRING",
            name: "message",
            description: "What the sticky message will say",
            required: true
        }]
    },
    {
        type: "SUB_COMMAND",
        name: "remove",
        description: "Remove sticky message from discord",
        options: [{
            type: "STRING",
            name: "id",
            description: "ID of sticky message to remove",
            required: true
        }]
    }]
}

It returns a DiscordAPIError invalid form body now.

#

Here is the error:

DiscordAPIError[50035]: Invalid Form Body
1.options[0].options[0].type[NUMBER_TYPE_COERCE]: Value "CHANNEL" is not int.
1.options[0].type[NUMBER_TYPE_COERCE]: Value "SUB_COMMAND" is not int.
1.options[1].options[0].type[NUMBER_TYPE_COERCE]: Value "CHANNEL" is not int.
1.options[1].type[NUMBER_TYPE_COERCE]: Value "SUB_COMMAND" is not int.
1.options[2].type[NUMBER_TYPE_COERCE]: Value "SUB_COMMAND" is not int.
4.options[0].options[0].type[NUMBER_TYPE_COERCE]: Value "CHANNEL" is not int.
4.options[0].options[1].type[NUMBER_TYPE_COERCE]: Value "STRING" is not int.
4.options[0].type[NUMBER_TYPE_COERCE]: Value "SUB_COMMAND" is not int.
4.options[1].options[0].type[NUMBER_TYPE_COERCE]: Value "STRING" is not int.
4.options[1].type[NUMBER_TYPE_COERCE]: Value "SUB_COMMAND" is not int.
5.options[0].type[NUMBER_TYPE_COERCE]: Value "STRING" is not int.
5.options[1].type[NUMBER_TYPE_COERCE]: Value "BOOLEAN" is not int.
woeful pollen
#

replace the type with a number

copper jetty
#

use enums or numbers

wicked nebula
#

Ahh

dusty turret
#

how do i get the event when the submit button is clicked in a modal?
interactionCreate don't works

copper jetty
#

Listen to interactionCreate event or construct new InteractionCollector

scarlet tangle
woeful pollen
scarlet tangle
#

It only has to send 1 of the help I only used command 1 time

#

And yes ik there is a -nuke and -killserver

copper jetty
#

Check where in your code you send these embeds and remove it

scarlet tangle
woeful pollen
#

somewhere in your code ur sending the other embeds, or ur handling commands twice

scarlet tangle
#

No I am not it’s not saying kicked person 3 times

woeful pollen
#

I'm confused about what ur saying

copper jetty
copper jetty
scarlet tangle
woeful pollen
#

you regenerated the token, use the new token 🤨

lament wave
#

is v14 using api v10 now?

dull mulchBOT
wicked nebula
#

So does <Interaction>.showModal() not work with <Interaction>.deferReply()?

lament wave
woeful pollen
wicked nebula
#

Yikes, that sucks if you have a handler which defers every command.

fierce lantern
wicked nebula
copper jetty
wicked nebula
#

Which is what I'm doing now.

#

in my command handler, I slashed out my deferReply.

//interaction.deferReply({ ephemeral: (command.ephemeral ?? false) }).catch(console.error);
#

Oh I see

#

TypeScript compiler task crashed because WSL2 sucks.

woeful pollen
knotty plover
#

When you regen it, copy it

#

That's the only time you see it

dusty turret
woeful pollen
#

its known

wicked nebula
#

What version of @discordjs/builders do I install?

#

I believe I'm on an old version which does not support modals yet.

#

My version: @discordjs/builders@0.12.0

copper jetty
#

@discordjs/builders@dev

scarlet tangle
knotty plover
#

Yeah basically

#

Or a config file or whatever you use

wicked nebula
#

createComponent is supposed to be in discordjs/builders

#

(Doing some more tests)

#

Nope, it won't work confusedBecel

stoic hedge
#

Is this error TypeError: Cannot read properties of undefined (reading 'resolveColor') a bug in the latest @dev release?

outer bane
#

yes

dull mulchBOT
woeful pollen
#

@wicked nebula

wicked nebula
#

ahh

wicked nebula
outer bane
#

because it's a monorepo

wicked nebula
#

How do I add it then?

knotty plover
#

Don't, wait for it to merge

#

If the stuff we do merge has bugs you're at even more risk installing PRs

wicked nebula
#

That is true

scarlet tangle
#

V14 have a release date ?

cinder wraith
#

no

scarlet tangle
#

Estimated ?

cinder wraith
#

neither

scarlet tangle
#

Okip

scarlet tangle
#

Had a friend do it somehow, that's why I asked.

#

Was the pull request for the modal fix merged

jaunty vault
scarlet tangle
#

Alright, good to hear.

#

No cause then people will start surveying on like 100 messages and doing stuff like that

brisk glen
#

how long do dev package update after the last commits?

knotty plover
#

It updates every 12 hours regardless

fiery junco
knotty plover
#

I'm on holiday

fiery junco
#

oh ok

willow garnet
#

refer to rule 6 also

#

we don't cater to demands

velvet tendon
#

Hey guys, can someone tell me how to get the number of servers from the Discord API v9?

split fulcrum
#

client.guilds.cache.size???

velvet tendon
#

I need to display in the React project -__-

split fulcrum
#

How do you mean

velvet tendon
#

You need to display the number of bot servers on the site. The site is written in ReactJS.

split fulcrum
#

Well

#

It's js

#

So just get client

velvet tendon
#

Something tells me that the request is invalid :D
https://discord.com/api/v9/guilds/577193003630854156/users/577152902280249346/guilds

split fulcrum
#

Hmmm

velvet tendon
#

idk :D

willow garnet
#

the support channels are specifically for djs

#

please keep them on topic

split fulcrum
#

look at discord api docs

#

If you want to know

velvet tendon
#

this?

split fulcrum
#

Yes

velvet tendon
#

oh, ok, i'm try

split fulcrum
#

Let me give you the url wait

velvet tendon
#

but there is no given information here or I'm blind

velvet tendon
split fulcrum
#

This is what you are looking for

scarlet tangle
#

what's the difference between the types CommandInteraction and ChatInputCommandInteraction now? is it only the options not being present?

scarlet tangle
#

but the CommandInteraction type still does exists and it works for checking basic properties such as commandName

copper jetty
#

CommandInteraction can be context menus or slash command

scarlet tangle
#

oh i get it now thanks

civic topaz
#

can anyone help me

Only dictionaries may be used in a ModelType (Emoji)

I used:

//xxx
 { 
type: 2,
label: "Xxx",
custom_id: "sss",
style: ButtonStyle.Primary,
emoji: "<emoji_id>"
}
dark light
#

emoji needs to be an object

#

so emoji: { id: ... }

civic topaz
#

this is so annoying

fiery anvil
#

i'm trying to deploy my bot on linux and this happens

#

Never happened on windows

knotty plover
#

Different lib version probably, known issue on latest dev

round bear
#

Please don't tell me we're gonna get forced to switch to v14 like we were for v13?

fiery anvil
knotty plover
#

Not currently

#

Unless you go back and pin an old commit

#

Latest dev has this issue though

fiery anvil
#

got it thank u

knotty plover
#

And you were never forced from v12, you still won't be forced for another month and that's Discords doing, not ours

round bear
#

I had to rewrite my bot with over 100 commands into v13. Pain in the butt

fiery anvil
#

monbrey so is there an open issue on github with the embed color bug?

urban belfry
#

oh the resolveColor? use EmbedBuilder instead of Embed

proud stump
#
      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 } 
});
tame gazelle
earnest latch
#

Can we update our v13 code to v14

copper jetty
#

Yes

patent bridge
#

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'
}

tame gazelle
#

Supplied roles is not a Role, Snowflake or Array or Collection of Roles or Snowflakes.

#

index.js line 441

copper jetty
#

You need to supply one of these

patent bridge
tame gazelle
#

role's value is undefined

#

do if (!role) return console.log('The role does not exist.')

fluid bronze
#

We dont support v12

#

And this is @dev version support

copper jetty
patent bridge
fluid bronze
tame gazelle
wicked nebula
#

How long does it take for the latest commits to be added in NPM?

fluid bronze
#

Every 12 hours iirc

wicked nebula
#

Hmm it's been 18 hours.

#

It's still on 2297c2b9479ace16f5f7155479605a4ac2718e3d

#

Although publish dev did run waitWhat

scarlet tangle
#

idk probably discord.js error, I use discord-modals and it used to work.

tame gazelle
#

ModalBuilder

wicked nebula
#

discord-modals is not made by discordjs

scarlet tangle
wicked nebula
#

Then join their discord?

tame gazelle
scarlet tangle
#

anyways, İdris I recall you sent me a modals tutorial. Do you still have it?

wicked nebula
tame gazelle
scarlet tangle
#

oofie, so no way to create a modal atm with plain djs?

wicked nebula
#

You can make modals by leveraging REST I believe.

scarlet tangle
#

thanks

proud stump
#
DiscordAPIError[50035]: Invalid Form Body
1.options[0].type[NUMBER_TYPE_COERCE]: Value "SUB_COMMAND" is not int.
tame gazelle
#

use enums

rain bramble
scarlet tangle
#

how to set a default value in the TextInputBuilder

vague coyote
scarlet tangle
#

sorry ping*

#

what went wrong?

copper jetty
#

Add text inputs to action rows and action rows to modal

scarlet tangle
#

okey, I did that and now I get this

#

@copper jetty - sorry for ping, can you check?

proud stump
#
    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) => {
scarlet tangle
scarlet tangle
scarlet tangle
copper jetty
rain bramble
scarlet tangle
proud stump
#
    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 });
});
vestal ibex
#

What's wrong?

const msg = await message.reply({embeds: [embed(mod)], components: [row]})
plain roverBOT
urban belfry
#

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

copper jetty
#

the bot can't see this channel

#

it needs VIEW_CHANNEL permission

vestal ibex
#

Hmm..

rain bramble
urban belfry
#

yeah implicit permissions cover this
i for a second forgot djs now uses rest internally

tame gazelle
urban belfry
#

yes i know, the stack showing rest threw me off
either way the guide i sent at the beginning for implicit permissions explains it

copper jetty
#

its ok ben. we forgive you

vestal ibex
#

Oh, I realized my mistake. Thanks for the help.

And sorry to bother you. :")

split fulcrum
#

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

split fulcrum
#

i can check 2 secs

scarlet tangle
#

can I make a command invisible if a person does not have a permission?

copper jetty
#

no

scarlet tangle
#

atleast make it unavailable within the frontend?

plain roverBOT
split fulcrum
copper jetty
scarlet tangle
#

thanks

rain bramble
split fulcrum
#

Okay

split fulcrum
plain roverBOT
#

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

scarlet tangle
#

can I log timeouts? and how. I cant seem to find an event for them

copper jetty
#

guildMemberUpdate event

scarlet tangle
#

type: 'MEMBER_TIMEOUT',
is this correct?

tropic meteor
#

How do I set intents?

tame gazelle
#

read pins

tame gazelle
scarlet tangle
#

thankss

scarlet tangle
#

owh and it also returns an error

copper jetty
scarlet tangle
#

can you tell me what I need to write after discord. to find the audit log actions

scarlet tangle
copper jetty
#

Import AuditLogEvent from discord-api-types/v10 and use AuditLogEvent.MemberTimeout

keen pewter
#

my code is like this, how would i get the url (or buffer) of the image?

copper jetty
tropic meteor
#
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)
tropic meteor
#

Oh they changed it?

copper jetty
#

yes

tropic meteor
#

Is it the for buttons?

copper jetty
#

yes

copper jetty
scarlet tangle
#

timelog.duration returns undefined for some reason

scarlet tangle
tame gazelle
copper jetty
# keen pewter

I told you earlier you can't resolve attachment option with v13

keen pewter
#

maybe if I build the link using the id of the interaction and the image...

copper jetty
scarlet tangle
#

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.

tame gazelle
copper jetty
tame gazelle
#
  • isn't there in the discord api doc ._.
scarlet tangle
tropic meteor
#

How do I remove an old command from a server?

copper jetty
#

or <Guild>.commands.delete(id)

tropic meteor
copper jetty
#

Fetch all commands and console log it

tropic meteor
#

I got the ID but I get the error Unknown application command

copper jetty
#

That means it got deleted if the id was correct

tropic meteor
copper jetty
#

then you passed wrong id into delete method

tropic meteor
#

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

copper jetty
#

<CommandInteraction>.commandId

tropic meteor
radiant lintel
#

TypeError: (intermediate value).setTitle is not a function

urban belfry
#

it doesn't matter, show it regardless

radiant lintel
#
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 };
urban belfry
#

yea modals have titles? 😂 i didn't know that

radiant lintel
#

oh its coming from this line

#
        const newchanembed = new Discord.Embed()
            .setTitle(opentitle)
urban belfry
#

use EmbedBuilder

radiant lintel
#

k

urban belfry
#

no it's not RichEmbed 👀
you seem to have skimmed through the discussion

scarlet tangle
lament wave
#

is discord.js@14.0.0-dev.1647259751.2297c2b on api v10??

radiant lintel
#

TypeError: Cannot destructure property 'components' of 'undefined' as it is undefined.
const row = new Discord.ActionRow()

urban belfry
#

ActionRowBuilder
pretty sure now the guide mentions it

scarlet tangle
radiant lintel
#

all these changes are messing with me smh

copper jetty
scarlet tangle
#

yeah

copper jetty
lament wave
#

oh well uhm, then how to get the api v10 version? i already tried to update from npm

copper jetty
#

Reinstall discord.js@dev

tame gazelle
radiant lintel
#
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

tame gazelle
#

dev version yknow

urban belfry
radiant lintel
#

embeds

#

buttons

urban belfry
#

be more specific

radiant lintel
#

all im getting now is TypeError: Discord.MessageActionRow is not a constructor

tame gazelle
#

ActionRowBuilder

#

ButtonBuilder

radiant lintel
#

oh so the guide isnt updated

tame gazelle
#

EmbedBuilder

tame gazelle
copper jetty
radiant lintel
#

nice 2 answers

#

i trust </> more

autumn forum
#

With all this new builder stuff, is djs builders expected to merge fully into djs?

tropic meteor
#

Why doesnt this work? interaction.command.delete()

copper jetty
#

No @autumn forum

urban belfry
#

what do you mean by merge fully into djs?

tame gazelle
#

not an external package ig

urban belfry
#

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?

autumn forum
#

fair enough, thanks for clarifying

tropic meteor
#

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.");
    });
}

}

uncut kelp
#

What's the issue?

tropic meteor
#

It creates 2 help commands

uncut kelp
#

You're only creating 0 or 1 help commands in the code you sent. It's not creating 2

tropic meteor
#

Why are there 2 help commands then?

uncut kelp
#

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

tropic meteor
#

Can i delete one of the help commands?

uncut kelp
#

If you want

tropic meteor
#

How?

#

It just says Unknown application command when I try to delete one of them.

urban belfry
#

show your code for deleting it
and of course how you got the id

tropic meteor
#
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))
    }
}
urban belfry
#

and how are you deleting?

tropic meteor
#
guild.commands.delete("953650800939372554")
urban belfry
#

are you sure this is the guild command's id and not the global one's?

tropic meteor
#

I dont know the difference shrug, first time using slash commands

urban belfry
#

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?

tropic meteor
#

Yeah im using v14

urban belfry
#

then use isChatInputCommand() instead of just isCommand

#

read the guide, you're running v13 code

copper jetty
#

I think you still can use isCommand() in v14

radiant lintel
#

whats a zoderror

copper jetty
#

it's an error

radiant lintel
copper jetty
#

You passed array instead of rest parameters into addFields method

radiant lintel
#
                .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?

copper jetty
#

yes

tropic meteor
# urban belfry okay maybe this will help one's specific to the guild and one's global and if th...

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.");
        });
    }
}
plain roverBOT
#

Documentation suggestion for @radiant lintel:
<:_:818272565419573308> 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.

radiant lintel
#

do you have an example

copper jetty
#

remove the [ and ]

radiant lintel
#

whats with all these changed in the v14

#

is it performance or something

urban belfry
tropic meteor
#

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)

outer bane
#

known bug

tropic meteor
outer bane
#

wait for the pr that fixes it to get merged and released

mellow jasper
tropic meteor
tame gazelle
#

by editing the code that is in the PR ig

mellow jasper
# tropic meteor How did you fix it?

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.

tropic meteor
# mellow jasper For testing fixing. I went into `node_modules` discord.js package. Then is *src/...

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)

woeful pollen
#

its a known error, theres a pr for it already

tropic meteor
autumn forum
#

should snowflakes be stored in my db as a string or bigint

rain bramble
autumn forum
#

in that case why does snowflake util use bigints? faster operations?

rain bramble
autumn forum
#

k

halcyon swift
#
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) 
urban belfry
#

Read the guide
Check the pins

scarlet tangle
#

why the latest dev version hasn't published on npm yet?

idle galleon
#

It's done on a periodic basis

forest elm
scarlet tangle
#

but latest commit was made on 24hrs ago

scarlet tangle
scarlet tangle
#

in this version we should use @discordjs/builders instead of exporting them directly from discord.js?

snow estuary
#

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)
rain bramble
snow estuary
jaunty vault
snow estuary
jaunty vault
snow estuary
#

Yes

#

I am supposed to import GatewayIntentBits

jaunty vault
snow estuary
#

Idk how to do "from"

jaunty vault
snow estuary
#

What is the big deal with just telling me?

jaunty vault
snow estuary
#

Its not spoonfeeding

jaunty vault
snow estuary
#

Is it not a console thing?

young kindle
#

yikes please learn JS

snow estuary
#

import GatewayIntentBits from "discord-api-types"?

young kindle
#

it's a named export, not a default one

jaunty vault
snow estuary
#

import { GatewayIntentBits } from "discord-api-types"?

snow estuary
jaunty vault
snow estuary
#

so

#

const api = require('discord-api-types")
const intents = new api.GatewayIntentBits(32767)

#

?

rain bramble
snow estuary
#
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'
}
outer bane
#

you have to use versioned imports with dapi-types like 'discord-api-types/v10'

rain bramble
jaunty vault
outer bane
#

you can

#

and should

snow estuary
#
const Discord = require("discord.js");
const intents = new Discord.GatewayIntentBits(32767);
```?
snow estuary
outer bane
#

First of all you shouldn't use this number. Pick the intents you need and use only those

jaunty vault
snow estuary
#

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
outer bane
#

update nodejs to 16.9+

snow estuary
#

Finally

#

Thank you

#

Is there a way to make modals like OG slash command style before the SlashCommandBuilders were made?

outer bane
#

sure, you can pass objects to it, refer to the discord API docs for the structure

snow estuary
outer bane
#

known bug

snow estuary
#

Also does the submit button not work unless you handle what happens when it gets submitted?

faint crater
#

Hey, is there a page that shows new features with V14?

brisk glen
#

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?

lean junco
brisk glen
#

publish dev on actions do work fine as far as I can see

crude valley
#

I get this error on the newest version of discord.js@dev, what do I do?

tame gazelle
crude valley
tame gazelle
#

I said builders
npm i @discordjs/builders@dev

crude valley
#

oh mb

crude valley
#

How can I fix this?

#

Tried as Message, didnt work

urban belfry
#

but could you try and log msg afterwards?

urban belfry
#

and this is your followUp message, correct? make sure it is

crude valley
#

Yes

#

I logged msg

urban belfry
#

okay then so you should be fine 👍🏻

crude valley
#

So I only add interaction.inCachedGuild() before sending the msg?

urban belfry
#

it's a type guard, have you not used Array.isArray(<thing>)?

crude valley
#

I have, but not sure how to use interaction.inCachedGuild()

urban belfry
#

you return if it returns false
basically,

if the interaction wasn't sent from a cached guild, just return

crude valley
#

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

copper jetty
#

editReply()

urban belfry
#

i don't know how you'd edit an ephemeral followup

crude valley
#

editReply works, but it throws 3 unknown message errors wth

#

It only happens when I use an ephemeral interaction

#

and only in v14

silent marlin
#

.addChoice is removed at v14 and if yes, what should I use instead?

silent marlin
urban belfry
#

pretty much yea, it's the same as addChoice but it supports multiple parameters

silent marlin
#

btw where can i see v14 changes?

urban belfry
#

the pins

silent marlin
#

alr, reading rn

scarlet tangle
#

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?

urban belfry
scarlet tangle
#

uhh sorry my bad i just saw i had the intent commented out

silent marlin
urban belfry
#

yes

silent marlin
urban belfry
#

if something is a choice object ofc

hexed tapir
#

How are we supposed to use .setColor with EmbedBuilder()?

urban belfry
forest elm
#

no, only decimal or rgb array

hexed tapir
gloomy kayak
#

I believe you can use an hex code too

#

Prepending 0x to it, like 0xff00ff

scarlet tangle
lofty blaze
scarlet tangle
lofty blaze
scarlet tangle
#

okay thank you oo

scarlet tangle
#

@urban belfry hi in v14
MessageAttachment is not defined

scarlet tangle
rain bramble
vapid heath
lofty blaze
#

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 😦

scarlet tangle
lofty blaze
#

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

lofty blaze
#

aw boo. That kind of sucks

hexed tapir
urban belfry
scarlet tangle
#

how can I timeout a member? - for a specificf amount of time

plain roverBOT
#

Documentation suggestion for @scarlet tangle:
<:_:874573924988518500> GuildMember#timeout()
Times this guild member out.

scarlet tangle
#

thanks

velvet jasper
#

you should be able to pass hex strings now to setColor

somber mirage
#

How can I edit interaction from his response?

You can do Interaction.message.interaction but it's not gives you any useful options

copper jetty
vague coyote
burnt shore
#

is there a way to add something else than a text component to a modal?

urban belfry
#

not yet afaik

burnt shore
#

ohk

scarlet tangle
#

MessageActionRow is now ActionRowBuilder?

urban belfry
#

yea

scarlet tangle
#

Thanks

urban belfry
#

for making one, yes
it is that

jade shadow
#
TypeError: (intermediate value).setDescription is not a function```
code:
```js
= new Discord.Embed().setDescription(```
copper jetty
#

EmbedBuilder

jade shadow
#

k

#

new issue: ZodError or something

#

think i figured it out

#

nvm

scarlet tangle
#

Or can check

#

Id the interaction is in dm

copper jetty
#

<Interaction>.inCachedGuild()

forest elm
#

inGuild()

scarlet tangle
copper jetty
#

it returns a boolean

scarlet tangle
copper jetty
#

it's a method, not property

warm spade
#

Do I change any of this in v14?

velvet jasper
#

yeah ComponentType.Button

warm spade
#

already

velvet jasper
#

yes, make sure ComponentType is imported

warm spade
velvet jasper
warm spade
crude valley
#

I keep getting this error when I try to send/update/edit an ephemeral interaction, what do I do?

outer bane
#

you have to use Interaction#editReply (reply) or Interaction#webhook#editMessage (followUp) to edit ephemeral messages

shadow nacelle
#

Should i use Embed or UnsafeEmbed now?

copper jetty
#

EmbedBuilder

shadow nacelle
#

Oh, thanks

lofty blaze
#

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

hexed tapir
scarlet tangle
#

how to make this buttons

#

thx

split fulcrum
#

What is the latest discord.js dev version is it still 97c2b??

vague coyote
wanton path
#

So now SelectMenuComponent is renamed to SelectMenuBuilder?

knotty plover
#

To create them yes

wanton path
knotty plover
#

When creating components they're all WhateverBuilder now yeah

scarlet tangle
#

why new dev version isnt released yet? its been 4 days ~_~

river harbor
#

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.

vague coyote
#

there are only 2 types, short and paragraph, use short then

river harbor
#
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

wanton path
#
const button = new ButtonBuilder()
				.setCustomId("modal")
				.setLabel("Click to show Modal")
				.setStyle(1),
			actionRow = new ActionRow().addComponents(button);```
wanton path
#

Ohh it is ActionRowBuilder

forest tree
#

When will v14 realesed

urban belfry
#

you know this already
when it's ready

forest tree
#

ok

tall verge
copper jetty
outer bane
#

you can by accessing data

copper jetty
#

then idk

tall verge
copper jetty
molten briar
#

Does Latest Discord.js@dev Require builder dev too??

molten briar
copper jetty
proven mica
#

why the latest dev version hasn't published on npm yet?

wicked nebula
#

Yes seems like an issue with the publish

copper jetty
#

Maybe its private

wicked nebula
#

Private?

copper jetty
#

Private means it isnt public so only few peoples can use it

wicked nebula
#

I know what private means I was more or less asking why it would be private.

urban belfry
#

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

wicked nebula
#

Yes, something went wrong

scarlet tangle
#

<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?

scarlet tangle
small mica
#

on latest dev release

urban belfry
small mica
#

ok also Embed is renamed to what?

urban belfry
#

to build an embed EmbedBuilder

small mica
#

So we cant use Embed on latest dev version?

urban belfry
#

no

#

not to build/set properties

small mica
#

hmm

scarlet tangle
#

why can't it open?

copper jetty
#

Because you dont have permissions to use this command

mild elk
#

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');

gritty citrus
#

enable guilds intent

mild elk
#

Worked, cheers

velvet tendon
#

The "Embed" class constructor is private and only accessible in the class declaration.ts(2673) WTF?
Library version: 14.0.0-dev.1647130097.549716e

velvet tendon
#

really?

velvet tendon
# velvet jasper EmbedBuilder
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.
velvet jasper
#

Ts-expect-error it for now it’s a bug

velvet tendon
#

So how should I be?

velvet jasper
#

put // @ts-expect-error above the line with the error

tropic meteor
#

Is the TextInputs on modals fixed?

scarlet tangle
#

Hello when im trying to fetch audit log message delete

Always give me (is not int)

hardy wind
#

Hi guys, is it possible to use interaction#fetchReply() and use a reaction collector on a deferred ephemeral interaction reply?

urban belfry
hardy wind
#

Can I use interaction#followUp() to send this particular message non-ephemeral?

urban belfry
#

yea

hardy wind
wicked nebula
#

Can someone look into why the latest pushes to main did not get published as dev release in NPM? (After a couple of days)

river harbor
#

Is the embed colour bug fixed?

tame gazelle
#

yes

river harbor
tame gazelle
#

show

river harbor
# tame gazelle show
let error = new Discord.EmbedBuilder()
      .setTitle('Error')
      .setColor('ff5959');```
tame gazelle
#

it still doesn't take a ColorResolvable

rain bramble
tame gazelle
#

the second one

river harbor
#

still isn't working

tame gazelle
#

.setColor(0xff5959)

wicked nebula
#

How can I use the main repo without having to use the npmjs release?

rain bramble
tame gazelle
#

yep

rain bramble
#

The dev version publish action is run, but it doesn't pass the condition.

hushed wind
#

@wicked nebula you could try and npm pack it yourself if you clone the repo. then npm i pathToTgz

river harbor
#

My modal submits aren't working. My client isn't even receiving an event at all.

tame gazelle
#

show how you did

river harbor
# tame gazelle 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); };

rain bramble
#

And I think that error was fixed, but not in dev version yet

river harbor
#
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.

river harbor
#

Ohhh

#

I guess I just have to wait 😕

tame gazelle
#

yep

wicked nebula
#

Well one of the factors in the condition is not met, so let's see what that is weSmart

scarlet tangle
#
.addChannelTypes([ChannelType.GuildText])
urban belfry
#

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

scarlet tangle
#

oh

urban belfry
#

your original code was right, you should pass multiple parameters

addChannelTypes(GuildText, VoiceChannel)
```like so
scarlet tangle
#

oh okay

#

thank you

silent marlin
#

Why discordjs/builders is not part of the discord.js package and will it be on v14?

outer bane
#

it's a dependency but can also be used without the core lib, therefore it's its own package

snow estuary
outer bane
#

known bug, there's already a pr to fix it

snow estuary
#

Kk

#

So just wait?

outer bane
#

yes

snow estuary
#

Is there a way for me to submit bugs or look at bugs that were already submitted?

outer bane
#

you can take a look at prs and/or issues, or ask in this channel

snow estuary
scarlet tangle
cold lotus
#

TypeError: Cannot read properties of undefined (reading 'resolveColor')
Is this module bug?

urban belfry
velvet tendon
rain bramble
woeful pollen
#

its known,

velvet tendon
rain bramble
velvet tendon
#

oh, ok. thx

rain bramble
knotty plover
#

Did you install the wrong version?

velvet tendon
rain bramble
knotty plover
#

Ahh

#

Oh well

urban belfry
#

"at dev" 🙃
gotta be patient

hardy wind
#

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()?

urban belfry
#

it should fetch the initial reply

woeful pollen
#

and if you make the initial reply ephemeral you cant change it in editReply

urban belfry
#

simply put, you can't just edit a message from ephemeral to non ephemeral and vice versa

hardy wind
hardy wind
#

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.

crude valley
#

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?

supple quest
#

I think

crude valley
#

i already do it

small mica
#

Like how it shows under reason for you

crude valley
#

<Error>.stack

small mica
#

Okay tysm :)

crude valley
#

Can someone tell me what I'm doing wrong here?

scarlet tangle
#

create action row

tame gazelle
crude valley
#

hm I dont understand

urban belfry
#

instead of Modal, use ModalBuilder

crude valley
urban belfry
#

what do you want to do? pass raw objects? if it's typed, go right ahead

velvet tendon
#

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?

urban belfry
#

register it globally?

velvet tendon
#

Shouldn't the bot be transferred to the server?

urban belfry
#

what

#

what do you mean by transferred?

velvet tendon
#

reinvite on server

woeful pollen
#

applications.commands scope, yes

urban belfry
#

you can't register on guilds without the scope either
register them globally

velvet tendon
#

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?

urban belfry
#

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

velvet tendon
#

Too bad you can't do it yourself

urban belfry
#

of course not it's not your server, you can try to put that on your bot's about me or status

woeful pollen
#

or if anyone tries to use a prefix command just tell them you switched or smth

scarlet tangle
#

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 :)

plain roverBOT
ionic wren
#

👇 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)]
}
urban belfry
#

yeah builders

#

the bold makes it worse
but show me your EmbedBuilder.setColor

ionic wren
ionic wren
urban belfry
#

yeah pass 0xF4C7B4 instead of that string

ionic wren
#

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”

crude valley
#

Is there anyway to make a collector on a modal?

scarlet tangle
small mica
woeful pollen
#

.addField() was removed in favour of .addFields()

small mica
small mica
urban belfry
#

no addField, yes

stable mesa
#

else

small mica
#

is addFields() same? Never used it before

woeful pollen
#

it accepts a rest parameter, so .addFields({}, {})

small mica
#

aah

scarlet tangle
#
            ^

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 :)

woeful pollen
#

do it in ready event

scarlet tangle
#

what is ready event?

plain roverBOT
#

<:_:874569360642019349> (event) Client#ready
Emitted when the client becomes ready to start working.

tight bluff
#

Client.on(“ready” => {
// code here
})

scarlet tangle
#
```this collector does not run the end script.
plain roverBOT
urban belfry
#

it has examples
your implementation is completely wrong

scarlet tangle
#

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

outer bane
#

this channel is for the dev version of d.js, if you are on v13 ask in #djs-help-v14

scarlet tangle
#

yeah i am on the beta just asking here incase it was changed

copper jetty
outer bane
#

the message isn't cached, nothing was changed regarding that

scarlet tangle
plain roverBOT
outer bane
#

use this method instead of relying on the cache

scarlet tangle
#

thanks

#

now apperiantly edit is not a function :/

copper jetty
#

Fetch returns a promise, resolve it

scarlet tangle
#

owh yeah

plain roverBOT
outer bane
#

if you only want to edit the message no need to fetch it

scarlet tangle
#

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
copper jetty
scarlet tangle
copper jetty
#

I don't know why would you get a channel every 10 seconds... It looks like an API spam to me 😡

scarlet tangle
#

thanks lol

scarlet tangle
#

okey I put my function in another function and now it worksnvm

scarlet tangle
copper jetty
scarlet tangle
gloomy kayak
#

I mean... Yeah this is actually API spam to edit a message every 10seconds and I would descourage you from doing that

scarlet tangle
copper jetty
scarlet tangle
outer bane
#

expected: 'string',
received: 'undefined'

feral cobalt
#

where can I find v14 source code ?

feral cobalt
copper jetty
#

You can select branches here

scarlet tangle
#

Hello, someone know if is there a way to do "forms" with discord.js?

scarlet tangle
#

Thx <3

scarlet tangle
#

why i can only add 5 text imput to discord modal thinks

#

Btw, what's the new way to create embeds?

copper jetty
scarlet tangle
#

Nah, tried MessageEmbed and there isnt a class like that

copper jetty
#

Its EmbedBuilder

scarlet tangle
#
  {
    "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)]
}```
copper jetty
woeful pollen
#

I dont understand why that error is confusing to people meguFace

urban belfry
copper jetty
urban belfry
#

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

woeful pollen
#

well, maybe its gonna be better after the @sapphire/shapeshift pr gets merged

scarlet tangle
river harbor
#

how do you wait for a modal submit without using the interactionCreate event?

copper jetty
feral cobalt
#

what the

copper jetty
#

EmbedBuilder

feral cobalt
#

<3

river harbor
#

Is there a way to have an optional modal field?

copper jetty
#

no

#

you can set default value tho .setValue()

river harbor
#

default value?

copper jetty
#

It will open with the text you passed in setValue method

river harbor
#

Oh okay.

scarlet tangle
#

Last question guys, is there a function to return an error message to a user?

copper jetty
river harbor
#

When is the modal submit event going to be fixed?

scarlet tangle
copper jetty
river harbor
uncut kelp
#

If only we knew the error

river harbor
uncut kelp
#

What I meant is stating there's an error and not providing it is practically useless

zealous sierra
#

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.

scarlet tangle
#
                                ^

TypeError: Cannot read properties of undefined (reading 'cache')``` 

anyone has a fix?
zealous sierra
#

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

zealous sierra
#

i mean the syntax is diff

#

is what i mean sry

#

deploying the cmd results in option.setName().setDescription().addChoice not being a functon

copper jetty
#

addChoices(), not addChoice

zealous sierra
#
TypeError: option.setName(...).setDescription(...).addChoice is not a function
#

ah ic whoops. ty

scarlet tangle
copper jetty
zealous sierra
zealous sierra
#

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.

snow estuary
#

How do I install @discordjs/builders?

#

nvm

snow estuary
#
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
vagrant mortar
#

Is there timeout support?

zealous sierra
#

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
copper jetty
zealous sierra
#

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.

dark minnow
#

I'm recieving this error for any button I try to create

copper jetty
dark minnow
#

🤡 Thks

carmine bridge
#

How to make SelectMenu

carmine bridge
#

Where error

copper jetty
#

setOptions takes rest parameters

carmine bridge
#

No this[]?

copper jetty
#

no

carmine bridge
#

What

idle galleon
#

It's a rest parameter

#

So you omit the square brackets

plain roverBOT
#

<:_:818272565419573308> 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.

scarlet tangle
#

so

outer bane
#

known bug, there's already a pr to fix it

scarlet tangle
#

okay

scarlet tangle
copper jetty
hexed tapir
#

MessageAttachment is still called as MessageAttachment in V14 or its AttachmentBuilder or something?

scarlet tangle
#

new Discord.Attachment()
new Attachment()

carmine bridge
#

How to make emoji in menu

scarlet tangle
carmine bridge
#

Yes

#

emoji:{name:""}

#

No this ?

scarlet tangle
#

no

#

are you using builders?

carmine bridge
#

Yes

scarlet tangle
#

okay

#

.setEmoji({
name: "emoji name or emoji",
id: "id of emoji"
})

#

if the emoji is default use

#

only name:

#

name: 😭

scarlet tangle
austere grove
#

you can't install prs anymore, just wait till it gets merged (and for it to be available in a dev version)

scarlet tangle
#

uh

#

okay

hexed tapir
hexed tapir
#

message.deleted property is removed in v14, so how to check if message is available for deleting?

ionic wren
#
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?

#

🤔

worthy fog
#

Code?

ionic wren
#
       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

worthy fog
#

Show me the embed bruh

ionic wren
#
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'
    }
  }
}
urban belfry
worthy fog
#

No. I meant send me the code y how you created it

ionic wren
#

const embed=this.player.infoMessage.embeds[0]

urban belfry
#

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

ionic wren
#

I changed to const embed=this.player.infoMessage.embeds[0].data but it still output same error

worthy fog
#

Log this.player

ionic wren
#

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
}
worthy fog
#

Console log this.player.infoMessage.embeds

ionic wren
#
[
  Embed {
    data: {
      url: 'https://www.youtube.com/watch?v=OtEJ6LGCW-U',
      type: 'rich',
      title: '汪蘇瀧 - 有點甜(Official MV)',
      thumbnail: [Object],
      fields: [Array],
      color: 16041908,
      author: [Object]
    }
  }
]
worthy fog
#

Okay now Console log this.player.infoMessage.embeds.Embed

spare fiber
#

its array lel

orchid bluff
#

embeds - Array, Embed - name of class(?)

worthy fog
#

No really? 😱

tepid mauve
#
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

tepid mauve
urban belfry
tepid mauve
#

--
I'm wondering will awaitModalSubmit() be a thing in the future, because the pr of v13 has one.. so?

#

or should I use InteractionCollector?

ionic wren
lethal zephyr
#

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)

tepid mauve
lethal zephyr
plain roverBOT
ionic wren
#

@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");
        });
ionic wren
#

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

carmine bridge
#

no [0]

#

can test

outer bane
cold lotus
#

What is Client's type? I don't want to set to any.
(This is TypeScript project)

cold lotus
#

Not a valid type.

languid basin
#

Client does not include slashCommands property

copper jetty
brisk path
plush monolith
#

Or just modify original typings with declare module

tepid mauve
#

is Modal for djs currently broken?
djs does not properly get the components, i wonder if there is pr to fix the problem

brisk path
#

just extend the Client class