#djs-in-dev-version

35223 messages · Page 10 of 36

woeful pollen

modals are already in the dev branch so npm i discord.js@dev (with many other breaking changes)

lament wave

does discord.js@14.0.0-dev.1647259751.2297c2b use api v10?

outer bane

no, it's merged but not released yet

zealous sierra

Is message.awaitMessageComponent different in DJS v14?

copper jetty

no

velvet jasper

but it works exactly the same

gloomy barn

how use in v14 "ActionRow" --> components???

forest elm

its ActionRowBuilder

regal mason

What does this error means ?

zealous sierra

Interesting cause I can’t use collectors for select menus

velvet jasper

Can you show your code?

idle galleon

Either the client was destroyed or you manually edited the property

regal mason
idle galleon

How so?

Well, I mean that you tried to make an api call via d.js

Looks like a channel.send

regal mason

Ah yes I'm doing this kind of api calls

idle galleon

That's not d.js tho

Also not a channel.send

Stack doesn't include where it was called, unfortunately

regal mason

But, that's not d.js ?

idle galleon

No

Well, it is our packages (the discordjs org), but not the d.js package

regal mason

Ah yes okay

idle galleon

You can actually use the apiRequest event to track when an api request is made

stuck fiber

how would i get a commandinteraction's options? the options property is not in the docs for commandInteraction for main branch

copper jetty
idle galleon

Is it not in the dev version? blobsweats

stuck fiber

ohh okay, thanks

👍

idle galleon

Oh, right, dev uses the rest package

tepid gust

oof, so modals only support unicode emojis, and there's no emoji picker?

shadow nacelle

when V14 is planned to be released or there is not date yet?

copper jetty

when its ready to release

ripe scaffold
        const menuRow = new ActionRowBuilder({
            components: [selectMenu.toJSON()]
        });

is it intended that we have to call toJSON() on adding components to action rows now?

otherwise it throws this error: Type 'SelectMenuBuilder' is not assignable to type 'APIMessageActionRowComponent | APITextInputComponent'.

snow estuary

Are modals coming in 13.7 or 14?

river harbor

Ugh modal submitting still isn't fixed...

young kindle
knotty plover

Yeah, though more generically it should be something like MessageActionRowComponent or ModalActionRowComponent

I forget exactly unless that's changed

tepid mauve
civic topaz

When will discord.js v14 out?

silk topaz
civic topaz

...

廢話... I also k when it is ready...

silk topaz
scarlet tangle

v14 isnt official right?

vague coyote
coarse kayak
knotty plover

I mean it's official, as in its by the discord.js team

river harbor

Is this error a known issue? DiscordAPIError[50035]: Invalid Form Body components[0].components[0].options[0].label[BASE_TYPE_REQUIRED]: This field is required components[0].components[0].options[0].value[BASE_TYPE_REQUIRED]: This field is required

I get it while trying to make a select menu.

If there's a PR for it, lmk.

river harbor
vague coyote code?
const row = new Discord.ActionRowBuilder().addComponents(
    new Discord.SelectMenuBuilder()
      .setCustomId('menu')
      .setPlaceholder('Nothing Selected')
      .addOptions([
              {
                  label: 'Select me',
                  description: 'This is a description',
                  value: 'first_option',
               },
              {
                  label: 'You can select me too',
                  description: 'This is also a description',
                  value: 'second_option',
        },
          ]),
  );
  await interaction.editReply({ components: [row] });```
vague coyote

addOptions doesn't take an array

spread it or pass them individually .addOptions(option1, option2)

river harbor

oh..

vague coyote

I'm not talking about addOption

see my message again

river harbor

Oh. Anyways thanks for the help.

iron bobcat
regal mason

How can I send buffer to an interaction, I tried that but idk if the buffer isn't a real buffer or I did something wrong with the attachement

velvet tendon

TypeError [INVALID_TYPE]: Supplied channel is not a GuildChannelResolvable.

knotty plover

kinda explains itself

whatever you provided is not a channel

exotic flume

Hey guys its safe start use v14?

copper jetty

no

exotic flume

How mush more time to wait ?

tame gazelle

when it's released

copper jetty

many many time

i dont know how many

exotic flume

Xd i want use modls have other way ?

copper jetty

Just wait

exotic flume

Oki :)

copper jetty

you could install the dev branch but its unstable

exotic flume

I have big xommunity and bot cant stop work all time, maybe its better wait

vague coyote

the dev branch is not meant for production use at all

copper jetty

i use it for production

vague coyote

dont care + didn't ask + not relevant

copper jetty

I haven't encountered any error through this process fyi

undone yew

this is changed?

client.generateInvite({ scopes: ['bot', 'applications.commands'], permissions: ['ADMINISTRATOR'] })
urban belfry

and the scopes too, need to use the enums

undone yew
  • new PermissionsBitField()

this is req?

copper jetty

yes

undone yew
name: 'black-list',
      options: [
        {
          name: 'data',
          description: 'Lists the users in the blacklist.',
          type: 1,
          options: []
}]

Is this necessary to change?

and my bot Slash Commands not loading

undone yew

help?

yes

urban belfry

it's not finished yet so can't tell but read the guide (pins)

undone yew

and my bot is ready for v14

but where is slash commands 🤔

zealous sierra

When using collectors, I'm attempting to collect data from a select menu. In DJS v13 it works fine, but when using the development build the interaction just gets deferred with no errors.

    const filter = (async (i) => {
        if (i.customId.split("-")[1] != i.member.id) {
            await i.deferReply({ ephemeral: true });
            return await i.editReply("Only <@" + i.customId.split("-")[1] + "> can use this menu!") && false;
        }
        return await i.deferReply() || true;
    });

    message.awaitMessageComponent({ filter, componentType: 'SELECT_MENU', time: 60000 }).then(async (interaction) => {
    }).catch((err) => {
        return;
    });
scarlet tangle
``` the status here works but thats about all, did it change? - cant get the activity to work
outer bane

@zealous sierra @scarlet tangle you have to use enums instead of strings now, you can find the enum names in the docs for the method, they should all be re-exported from d.js

zealous sierra

ah ic. ty!

undone yew
zealous sierra

Thanks!

undone yew

;)

undone yew
scarlet tangle
steel lance

any info about APIApplicationCommandOptionChoice the documentation doesn't have info abt it

scarlet tangle
undone yew

How to fix?

wanton path
undone yew

@wanton path

wanton path

I don't know how your command handler works

scarlet tangle

İs that impposible to share screnn in v14 ?

copper jetty

yes

bots don't have screens

vague coyote

Yes, it is impossible.

undone yew

V14 (Dev) is can't load Slash Commands :/

scarlet tangle

@undone yew

you only showed the command itself, instead show the command registration code

undone yew

wait

ss or direct code file?

lofty blaze
urban belfry

we don't work on etas pal

outer bane

as always "no eta"

urban belfry

you know the drill, "when it's ready"

undone yew
outer bane

you should really use global commands

undone yew
outer bane

and group the permissions so you only do one request per guild

outer bane
scarlet tangle

Oh sorry for ping

vague coyote

Wdym how

Impossible means not possible

timid jasper
ancient fable

Hey there!
When a user responds to a model (by using the button "Send" button), I get this error (I'm using discord.js@dev):

/Users/max/Documents/Bot/eliott/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 /Users/max/Documents/Bot/eliott/node_modules/discord.js/src/structures/ModalSubmitInteraction.js:43:54
    at Array.map (<anonymous>)
    at new ModalSubmitInteraction (/Users/max/Documents/Bot/eliott/node_modules/discord.js/src/structures/ModalSubmitInteraction.js:43:45)
    at InteractionCreateAction.handle (/Users/max/Documents/Bot/eliott/node_modules/discord.js/src/client/actions/InteractionCreate.js:69:25)
    at Object.module.exports [as INTERACTION_CREATE] (/Users/max/Documents/Bot/eliott/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
    at WebSocketManager.handlePacket (/Users/max/Documents/Bot/eliott/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
    at WebSocketShard.onPacket (/Users/max/Documents/Bot/eliott/node_modules/discord.js/src/client/websocket/WebSocketShard.js:447:22)
    at WebSocketShard.onMessage (/Users/max/Documents/Bot/eliott/node_modules/discord.js/src/client/websocket/WebSocketShard.js:304:10)
    at WebSocket.onMessage (/Users/max/Documents/Bot/eliott/node_modules/ws/lib/event-target.js:199:18)
    at WebSocket.emit (node:events:526:28)

Node.js v17.5.0

Does someone have an idea? Thx

outer bane

known bug

ancient fable

Is there a way to fix it rn?

outer bane

by not using modals

ancient fable

:/

and isn't there a way if I want to use them? ^^

outer bane

that's internal

ancient fable

ok ty

ancient fable
wanton path

You use ModalBuilder right?

outer bane

it's an internal error, nothing to do with userland code

using builders or not won't affect it

wanton path

Alr

scarlet tangle

What is the permission to ping all like KICK_MEMBERS

outer bane

PermissionFlagsBits.MentionEveryone

scarlet tangle
outer bane PermissionFlagsBits.MentionEveryone

so like this

if(!message.member.permissions.has(PermissionFlagsBits.MentionEveryone)) return message.reply("You can't mention Everyone")
        if(!message.guild.me.permissions.has(PermissionFlagsBits.MentionEveryone)) return message.reply("I can't mention Everyone")
outer bane

seems fine

scarlet tangle

What’s in for this update?

Error

C:\Users\ander\Documents\GitHub\RedLands-Discord-Bot\commands\pingall.js:7
        if(!message.member.permissions.has(PermissionFlagsBits.MentionEveryone)) return message.reply("You can't mention Everyone")
                                           ^

ReferenceError: PermissionFlagsBits is not defined
    at Object.execute (C:\Users\ander\Documents\GitHub\RedLands-Discord-Bot\commands\pingall.js:7:44)    at Client.<anonymous> (C:\Users\ander\Documents\GitHub\RedLands-Discord-Bot\index.js:53:37)      
    at Client.emit (node:events:520:28)
    at MessageCreateAction.handle (C:\Users\ander\Documents\GitHub\RedLands-Discord-Bot\node_modules\discord.js\src\client\actions\MessageCreate.js:23:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\ander\Documents\GitHub\RedLands-Discord-Bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\ander\Documents\GitHub\RedLands-Discord-Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
    at WebSocketShard.onPacket (C:\Users\ander\Documents\GitHub\RedLands-Discord-Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:22)
    at WebSocketShard.onMessage (C:\Users\ander\Documents\GitHub\RedLands-Discord-Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:304:10)
    at WebSocket.onMessage (C:\Users\ander\Documents\GitHub\RedLands-Discord-Bot\node_modules\ws\lib\event-target.js:199:18)
    at WebSocket.emit (node:events:520:28)

You know you don’t have to show the whole error stack

code

module.exports = {
    data: {
        name: "kick",
        description: "this command kick a person!",
    },
    execute(message, args){
        if(!message.member.permissions.has(PermissionFlagsBits.MentionEveryone)) return message.reply("You can't mention Everyone")
        if(!message.guild.me.permissions.has(PermissionFlagsBits.MentionEveryone)) return message.reply("I can't mention Everyone")
        
        message.reply("||@everyone|| you all just got pinged by me")
    }
}
scarlet tangle

I guess it’s fine. Just don’t need to know your file structure

outer bane

you obviously have to import it, it's re-exported in d.js from dapi-types

gritty citrus

showing thr ehole error stack is recommended here

scarlet tangle
outer bane

PermissionFlagsBits

scarlet tangle

from what?

outer bane

or PermissionsBitField and access Flags

from d.js

scarlet tangle
outer bane

discord.js

scarlet tangle

error

if(!message.member.permissions.has(PermissionFlagsBits.MentionEveryone)) return message.reply("You can't mention Everyone")
                                           ^

ReferenceError: PermissionFlagsBits is not defined

Your variable is not defined.

const { PermissionsBitField } = require('discord.js');
module.exports = {
    data: {
        name: "pingall",
        description: "this command pings all!",
    },
    execute(message, args){
        if(!message.member.permissions.has(PermissionFlagsBits.MentionEveryone)) return message.reply("You can't mention Everyone")
        if(!message.guild.me.permissions.has(PermissionFlagsBits.MentionEveryone)) return message.reply("I can't mention Everyone")
        
        message.reply("||@everyone|| you all just got pinged by me")
    }
}

code

outer bane

I'd advise you to brush up on your js in #resources before trying a dev release

scarlet tangle

works now

thanks! 👍

scarlet tangle
outer bane I'd advise you to brush up on your js in <#729580210634358804> before trying a d...

It’s not that he/she is bad at JS, it’s just a silly mistake people make, use the wrong variable. Even senior devs make that mistake, maybe they just debug first or use some common sense I guess :)
But redirecting him/her to another server just waste’s time, and has nothing to do with JS knowledge. We can help the person as much as anyone else can.
Note to @scarlet tangle: if you see * is not defined, just think about it logically. The variable was not defined. May be a scoping issue, may be you just making a simple typo

scarlet tangle

help please

i am trying to use APIButtonComponent but it will only let me use ButtonComponentData

narrow lagoon

what node version is required for v14

copper jetty

16.9

narrow lagoon

ty

scarlet tangle
native marsh

Code: ```js
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

Error: `Cannot read properties of undefined (reading 'FLAGS')`
native marsh

Nvm, i got fixed.

fading skiff

can someone help me?

copper jetty

And ask in discord-modals support server if you use it

marsh matrix

Is there any difference in function between these 2?
const { ApplicationCommandType, ApplicationCommandOptionType } = require('discord.js');
const { ApplicationCommandType, ApplicationCommandOptionType } = require('discord-api-types/(9/10)');
A bit confused

fierce lantern

could be wrong but i think they are the same, djs imports it from discord-api-types and exports it

copper jetty

they are the same why would they name different things the same

marsh matrix

I don't mean specifically the imports, more the difference (likely none) between importing from "discord.js" and "discord-api-types"

edgy jolt

I keep getting an ActionRowBuilder is not defined error. I'm on the latest discord.js@dev and @discordjs/builders. Any known work arounds?

copper jetty

Import it from discord.js

edgy jolt

Using const { ActionRowBuilder } = require("discord.js");?

copper jetty

yes

edgy jolt

That's how I'm importing it. Still getting the not defined error

plain roverBOT

ReferenceError: "x" is not defined: learn more
TypeError: Cannot read properties of undefined/null (reading "x"): learn more

dark minnow

It is normal to an button be caught by the collector and the interactionCreate event?

outer bane

a collector is just a (temporary) wrapper around the client event, you will always get all interactions in interactionCreate

ivory halo

How old are you, I am 36 years old

green geyser

Hey, I saw this PR addressed in this channel already but didn't see any help with installing it https://github.com/discordjs/discord.js/pull/7649 (the one that fixes modal input). I've tried several ways of pulling it to no avail. Even though this PR is likely to merge soon, I'd like to know how i'd install it myself for any future needs (of installing a PR). How would you do it?

Please ping me for anything

latent lion

Help, why does this error show?

latent lion
idle galleon

image is supposed to be an object

Most likely image: { url: "…" }

latent lion
idle galleon

What does it return then?

latent lion

This works

river harbor

I'm recieving an internal error from discord.js while using an interaction collector. It gets triggered whenever I interact with a select menu for a second time.return options.fetchReply ? this.fetchReply() : undefined; ^ TypeError: Cannot read properties of undefined (reading 'fetchReply')

viscid jasper

Are the docs for v13 valid in v14?

river harbor

Check pins.

urban belfry
river harbor

it has nothing to do with my code

woeful pollen

internal errors r most of the time because of the developer

river harbor

then why does it not provide a location of error on my code?

urban belfry

a big reason for internal errors is you passing the wrong type of data kappapuff

woeful pollen

can you just show the code

river harbor

well here's my code: js const collector = new Discord.InteractionCollector(interaction.client, { componentType: 3 }); collector.on('collect', async collected => { await interaction.editReply({ embeds: [embed] }); await collected.update(); });

urban belfry

see that, update is called without anything

woeful pollen

shouldnt you be using .createMessageComponentCollector instead of using new InteractionCollector

river harbor

what am i supposed to pass with update()?

river harbor
woeful pollen

it's the same as editing the original message, so interaction.update({ embeds: [embed] })

river harbor

it's updating a select menu interaction?

urban belfry
woeful pollen
river harbor
woeful pollen

what

river harbor

such as new EmbedBuilder() instead of new MessageEmbed()

woeful pollen

that shouldnt affect collectors

river harbor

no but its collecting an interaction

and it works just fine anyway

woeful pollen

did you try using .createMessageComponentCollector() to come up with this conclusion

river harbor
woeful pollen

not a big deal, just trying to understand why it wont work. it's a valid function so it should work

river harbor

well i'm not concerned because my way works just fine

woeful pollen

alright then

regal mason

Is this way of registering slash commands is working ? (Because it do not work, without returning an error)

regal mason
woeful pollen

await the request to see if it errors

copper jetty
regal mason
woeful pollen
regal mason
regal mason
brave mulch

setTimeout

For 1 minute

Then run the function

copper jetty
scarlet tangle

.setChoices("bitcoin", "ethereum", "doge", "shiba", "bat")isnt this how to define choices in a commandbuilder in v14

urban belfry
zealous sierra

oops wrong channel

river harbor

Is there a way to install a PR from the djs repo instead of the actual dev package?

vague coyote

you would have to clone the repo and install it manually

river harbor

oh... anyways i guess i just need to wait for modals to be fixed then

zealous sierra

I've been messing around with select menus since this doesn't seem to work:

let options = res.map(({text,url}) => ({label: text, value: url}));

const selectMenu = new Discord.ActionRowBuilder()
  .addComponents(
    new Discord.SelectMenuBuilder()
      .setCustomId("website")
      .setPlaceholder('Select')
      .addOptions(options),
);

(#djs-help-v14 message)

So I copied from the DJS Guide and fixed MessageActionRow and MessageSelectMenu to the new v14 settings, but I get the error that label and value is a required field:

const selectMenu = new Discord.ActionRowBuilder()
  .addComponents(
    new Discord.SelectMenuBuilder()
      .setCustomId('select')
      .setPlaceholder('Nothing selected')
      .setMinValues(2)
      .setMaxValues(3)
      .addOptions([
        {
          label: 'Select me',
          description: 'This is a description',
          value: 'first_option',
        },
      ]),
);
copper jetty
zealous sierra
scarlet tangle

are select menus available now for modals on v14?

tame gazelle

only text inputs

scarlet tangle

do we know when its meant to be released on v14?

tame gazelle

already released

scarlet tangle

no, when select menus on modals is released

tame gazelle

ask Discord

scarlet tangle

discords api allows it

tame gazelle

where?
send a link

scarlet tangle

in the modal table it states components "array of components" as its all the variations

vestal ibex

Hi!
Why is the bot not responding to messages in dm ?
messageCreate event does not react.
Partials Channel and Intent DirectMessages are enabled.

uncut kelp

Maybe your assumptions are wrong

vestal ibex

I.e?

forest elm

@vestal ibex show your code

works on my end

vestal ibex
outer bane

you have to use the Partials enum

vestal ibex

It is necessary?

outer bane

yes

vestal ibex

Okay, thx!

outer bane

I mean you can also use magic numbers

forest elm

the intents work because theyre a bitfield, partials only have the enum

outer bane

but especially for partials that is not a good practise

vestal ibex
thorny shuttle
woven grove

Kinda

thorny shuttle

Btw will it be possible to setup Rich presence on bot acc?

forest elm

no

celest plover

Whats this?
TypeError: createComponent is not a function

Happens when I run a modal

outer bane

known internal bug

celest plover
outer bane

of course

celest plover

this already have a pr?

forest elm
celest plover
forest elm

not easily

celest plover
knotty plover

Yes, it's a monorepo which makes installing individual PRs difficult

scarlet tangle

wh-

warm spade

I do not know why my slash are not updating, what I am doing is starting to pass everything to v14 and then also improve and change certain messages but it is not updated, the previous slash and its messages remain and does not let me continue developing so if I change any string option it appears after null

copper jetty
bronze plover

Will modals be in a subver of 13?

quaint zenith

modals are in the dev version; discord.js@dev
im not sure if they are currently working atm

bronze plover

i mean like will it be v14 only or will a version of v13 support it

outer bane
quaint zenith

i didnt realize this was the dev channel lol

but yeah he said this:

so djs v13.7

proven forge

where can i see the names of the new permissions

knotty plover

Docs for the main branch

proven forge

ok

nocturne kayak

what did i do wrong here?

knotty plover

What does the error say?

nocturne kayak

quite a long error

   Type 'TextInputStyle' is not assignable to type 'ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger'.

and

    Type 'ActionRowBuilder<MessageActionRowComponentBuilder | TextInputBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRow<...> | (Required<...> & ActionRowData<...>)'..```
my action row was pretty much empty
knotty plover

Ahh you're using TS

You need to specify the type of builder going in the action row

ActionRowBuilder<ButtonBuilder> for example

nocturne kayak

ah that was it thank you

wicked nebula

I installed the fix-regressions PR on my local clone of DJS, how can I install it in my project without having to replace all import .. from 'discord.js'

Found it

carmine bridge

Why the status not work

This function not work

brisk path

you need to provide the name i think

wait never mind

Any errors?

carmine bridge

No error

brisk path

and are you calling the function?

carmine bridge

Have

brisk path

and where are you calling the function?

carmine bridge

V13.6 work

I upgrade v14

brisk path

i see

carmine bridge
brisk path

String doesn't work anymore

carmine bridge

How change

copper jetty

Use ActivityType enum

tame gazelle

playing is the default activity no?

brisk path

i think

not sure though

carmine bridge

What is Playing number

tame gazelle
carmine bridge

This ?

copper jetty

Yes

carmine bridge

Ok work,thx

split fulcrum

what does it mean?

jaunty vault
split fulcrum

But i'm not accessing anything?

jaunty vault
split fulcrum

Thats not the bot

thats pm2

pm2 is a Hosting thingy

that runs the bots and that

It does not manage anything on the Discord.js

knotty plover

What Node version are you running?

This might be a djs bug, seems related to a recent change

split fulcrum
knotty plover

Seems to be a bug, use previous version

split fulcrum

17.7.2?

It still shows this errors

uncut kelp

Use a previous version of discord.js*

That's a bug in discord.js's development version

split fulcrum

Found the problem in GuildAuditLogs.js line 61, 62 just had to remove does lines

uncut kelp

That won't solve the issue, now it's not exported

Just revert to an earlier version

scarlet tangle
     const test = prise.roles.cache.find(ro => ro.id === role.id);	
     test.edit({
       
        permissions: [{
        SEND_MESSAGE: false,  
             
         
          } ]
         
          })
   })
DiscordAPIError[50046]: Invalid Asset
    at C.runRequest (F:\Rolex\node_modules\@discordjs\rest\dist\index.js:7:581)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C.queueRequest (F:\Rolex\node_modules\@discordjs\rest\dist\index.js:5:3049)
    at async GuildStickerManager.create (F:\Rolex\node_modules\discord.js\src\managers\GuildStickerManager.js:67:21) {
  rawError: { message: 'Invalid Asset', code: 50046 },
  code: 50046,
  status: 400,
  method: 'post',
  url: 'https://discord.com/api/v9/guilds/864853109519024128/stickers',
  requestBody: {
    files: [ [Object] ],
    json: { name: 'sussy', tags: 'headstone', description: 'good bro' }
  }
} Promise {
  <rejected> DiscordAPIError[50046]: Invalid Asset
      at C.runRequest (F:\Rolex\node_modules\@discordjs\rest\dist\index.js:7:581)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async C.queueRequest (F:\Rolex\node_modules\@discordjs\rest\dist\index.js:5:3049)
      at async GuildStickerManager.create (F:\Rolex\node_modules\discord.js\src\managers\GuildStickerManager.js:67:21) {
    rawError: { message: 'Invalid Asset', code: 50046 },
    code: 50046,
    status: 400,
    method: 'post',
    url: 'https://discord.com/api/v9/guilds/864853109519024128/stickers',
    requestBody: { files: [Array], json: [Object] }
  }
}
``` i was tryna create a sticker and idk why but this keeps coming up even tho the asset is valid i am using the asset 🪦 as per the example does anyone know whats causing this error?
split fulcrum

Do you have the GuildEmojisAndStickers Intent?

split fulcrum

weird

scarlet tangle

cuz well i am not sure what to do at this point

even the given example doesn't work

split fulcrum

idk

Maybe bug or something not sure

scarlet tangle

i'll try to use the discord api for now if you can find the solution please let me know

woeful pollen

iirc stickers only accept png, apng and lottie

split fulcrum

^^^^

scarlet tangle
woeful pollen

no

scarlet tangle

let me try

scarlet tangle

DiscordAPIError[50046]: Invalid Asset

umbral mango
umbral mango

ah, should have checked PRs first

thank you

vague coyote
vast mirage

how can i access modal docs

wraith oyster

Will input boxes be added in v14?

tame gazelle

already added

wraith oyster

wow

how can i access document?

umbral mango
vast mirage
umbral mango

does someone know the latest working commit? Otherwise i will go to sleep and hope for a better tomorrowkekWleave

sage verge

Is there already a way to get the attachment Interaction Option?

sage verge

nvm found it in the docs

scarlet tangle

ReferenceError: Cannot access 'GuildAuditLogsEntry' before initialization

whats this

copper jetty

it looks like reference error to me

scarlet tangle
copper jetty
scarlet tangle
copper jetty

Pass valid bitfield flag or number into permissions option array

scarlet tangle
scarlet tangle
scarlet tangle

i mean whats this error?

outer bane

it's an internal bug

there's already a pr to fix it

scarlet tangle
hushed wind
scarlet tangle
woeful pollen
exotic wind

Is there message.deleted, if not, how to check?

urban belfry
outer bane

there is not, you have to keep track of it yourself

or catch and check the error code, depending on what you want to do you (e.g. delete the message) can already ignore it

hazy light

Hey, I want to check if someone is kickable, after fetch him (and check if I have a complete GuildMember) I do member.kickable and got this

    at GuildMemberRoleManager.get cache [as cache] (D:\clc_backup\Code\sommet-bot-v3\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:37:101)
    at GuildMemberRoleManager.get highest [as highest] (D:\clc_backup\Code\sommet-bot-v3\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:79:17)
    at GuildMember.get manageable [as manageable] (D:\clc_backup\Code\sommet-bot-v3\node_modules\discord.js\src\structures\GuildMember.js:243:32)
    at GuildMember.get kickable [as kickable] (D:\clc_backup\Code\sommet-bot-v3\node_modules\discord.js\src\structures\GuildMember.js:253:17)

Seems like the member is not in the cache but I fetched him a few seconds before

(The member is stored in a this in class. The fetch in a different function than where i check if he is kickable)

outer bane

do you have the Guilds intent?

hazy light

I have guildmessages and guildmembers

outer bane

you need Guilds as well for d.js to work properly

the issue is because roles are not cached and there is no internal check for this case

hazy light

Oh yes it work lol thanks for the answer

scarlet tangle

guys im trying to check if message exists but I cannot do it in this version of discordjs, can someone help?

woeful pollen

what error are you facing

wicked nebula

Hmm I can not get a local package of DJS working, in my package.json yarn added the following:

"dependencies": {
    "@discordjs/builders": "D:\\dev\\Discord.JS\\packages\\builders",
    "@discordjs/rest": "D:\\dev\\Discord.JS\\packages\\rest\\",
    "discord.js": "D:\\dev\\Discord.JS\\packages\\discord.js\\",
}

When I try to start the bot I get the following error: Exception has occurred: ReferenceError: Cannot access 'GuildAuditLogsEntry' before initialization

woeful pollen

known error

dull mulchBOT
velvet jasper

the next dev release will fix this

split fulcrum

That's a discord js bug just revert to older djs version

wicked nebula

Yes however the error does not occur when installing it from npmjs 😂

I'll locally install that PR.

velvet jasper
scarlet tangle

.addChoice('Channel')),

@urban belfry

urban belfry

yeah no choices must have values and show me the version of builders you're using

wicked nebula

Does the MessageOptions interface also take EmbedBuilder?

(Because right now I either ts-expect-error or .data it)

scarlet tangle
urban belfry

the version

scarlet tangle

^0.12.0

outer bane
wicked nebula

Should I just add | EmbedBuilder as a quick fix for now?

outer bane

the proper type would be JSONEncodable<APIEmbed> | APIEmbed

urban belfry
wicked nebula

Ahh I see

There is different interfaces

outer bane

yes, it hasn't been changed in edit options

wicked nebula

That was the issue indeed

Is a PR open for it?

outer bane

yes

wicked nebula

Alright

warm spade

How do I remove all slashes in Discord from my bot?

vague coyote

its basically the same way, except if you wanna remove them you pass an empty array

inner breach

umm hello, why i get this error after update the package and start the bot? pepeSadHug

inner breach
uncut kelp

Update

inner breach

it works, thank you _NC_Yeyeyeyeyyeey

sweet grove

Will v14 include support for the recently announced slash command localization?

frozen warren

anyone know what's going on?

river harbor
frozen warren

found it out though! it's because ApplicationCommandData is a union and description doesn't exist on all the potential types

river harbor

okay thats nice

frozen warren
river harbor okay thats nice

just as a little off-topic heads-up! make sure these have the cursor: pointer; property applied so it's clear to the user they're clickable! 🙂

river harbor

i'll configure my css now

copper jetty

and change size when hovering it or add shadow

velvet jasper
river harbor
velvet jasper

Key word “until then” all I’m saying is let’s stay on topic here and try not to drift off

carmine bridge

This is new version ?

uncut kelp

That is new version

carmine bridge

Ok

uncut kelp

@scarlet tangle

Yes

?

Use words dude

Have you tried uninstalling the module and installing it again

carmine bridge

this is ok?

hexed tapir
carmine bridge

because slash no

carmine bridge

this ok

slash not have

crude valley

I get this error whenever im trying to run my bot, what do I do?

velvet jasper

EmbedBuilder

open solar

I'm using the Modals Branch in #769862166131245066 and I'm getting an error I'm not sure how to fix.

import { MessageActionRow, Modal, TextInputComponent } from "discord.js"

const modal = new Modal().setCustomId("myModal").setTitle("My Modal")
        const favoriteColorInput = new TextInputComponent()
            .setCustomId("favoriteColorInput")
            .setLabel("What's your favorite color?")
            .setStyle("SHORT")
        const hobbiesInput = new TextInputComponent()
            .setCustomId("hobbiesInput")
            .setLabel("What's your favorites hobbies?")
            .setStyle("PARAGRAPH")

        const firstActionRow = new MessageActionRow().addComponents(favoriteColorInput)
        const secondActionRow = new MessageActionRow().addComponents(hobbiesInput)
        modal.addComponents(firstActionRow, secondActionRow)

        await interaction.showModal(modal)

It says I need a TextInputComponent instead of a MessageActionRowComponent when trying to add the Action rows to the modal, but it seems like that's what I'm using?

carmine bridge

no MessageActionRow()

crude valley
carmine bridge

const actionRow = new ActionRowBuilder();

open solar
velvet jasper
crude valley

ops

I dont have that sweat_smile_AE

velvet jasper

Just npm i @discordjs/builders@dev

carmine bridge

no error

no slash

open solar

This confuses me even more, because it does use a TextInputComponent

but it seems to think I'm not

open solar
idle galleon

Did you add it to ur path?

There was a checkmark for it if you used the installer

Ur environment path

If you used the installer, there was a checkbox to add it to ur $PATH

carmine bridge

why this no function

urban belfry
carmine bridge

djs : "discord.js": "^14.0.0-dev.1648166883.cedd053",

interactionCreate

urban belfry

not good enough, log interaction and show it to me

carmine bridge

wait

  type: 2,
  id: '956794512246734929',
  applicationId: '947344436973699104',
  channelId: '956551274369777704',
  guildId: '945198619278082080',
  user: User {
    id: '868822847869571083',
    bot: false,
    system: false,
    flags: UserFlagsBitField { bitfield: 128 },
    username: '神魂火SpiritFire',
    discriminator: '3164',
    avatar: 'faf37f36c9f8fdfd75a8fa929cc46dd9',
    banner: undefined,
    accentColor: undefined
  },
  member: GuildMember {
    guild: Guild {
      id: '945198619278082080',
      name: 'IMSC DSC SECRET SERVER & Dev chat by KLAE',
      icon: 'ecc8891e0ef2b13a742be183e41f3f72',
      features: [Array],
      commands: [GuildApplicationCommandManager],
      members: [GuildMemberManager],
      channels: [GuildChannelManager],
      bans: [GuildBanManager],
      roles: [RoleManager],
      presences: PresenceManager {},
      voiceStates: [VoiceStateManager],
      stageInstances: [StageInstanceManager],
      invites: [GuildInviteManager],
      scheduledEvents: [GuildScheduledEventManager],
      available: true,
      shardId: 0,
      splash: null,
      banner: null,
      description: null,
      verificationLevel: 2,
      vanityURLCode: null,
      nsfwLevel: 0,
      premiumSubscriptionCount: 0,
      discoverySplash: null,
      memberCount: 21,
      large: false,
      premiumProgressBarEnabled: false,
      applicationId: null,
      afkTimeout: 300,
      afkChannelId: null,
      systemChannelId: '945242729313607700',
      premiumTier: 0,
      explicitContentFilter: 2,
      mfaLevel: 1,
      joinedTimestamp: 1647308970092,
      defaultMessageNotifications: 0,
      systemChannelFlags: [SystemChannelFlagsBitField],
      maximumMembers: 500000,
      maximumPresences: null,
      approximateMemberCount: null,
      approximatePresenceCount: null,
      vanityURLUses: null,
      rulesChannelId: '945201696508903454',
      publicUpdatesChannelId: '945201696508903455',
      preferredLocale: 'en-US',
      ownerId: '811036647037993012',
      emojis: [GuildEmojiManager],
      stickers: [GuildStickerManager]
    },
    joinedTimestamp: 1647243816979,
    premiumSinceTimestamp: null,
    nickname: null,
    pending: false,
    communicationDisabledUntilTimestamp: null,
    _roles: [
      '950383090457538560',
      '945200515401277490',
      '950193800385556522'
    ],
    user: User {
      id: '868822847869571083',
      bot: false,
      system: false,
      flags: [UserFlagsBitField],
      username: '神魂火SpiritFire',
      discriminator: '3164',
      avatar: 'faf37f36c9f8fdfd75a8fa929cc46dd9',
      banner: undefined,
      accentColor: undefined
    },
    avatar: null
  },
  version: 1,
  memberPermissions: PermissionsBitField { bitfield: 2199023255551n },
  locale: 'zh-TW',
  guildLocale: 'en-US',
  commandId: '956769810488909834',
  commandName: 'ping',
  commandType: 1,
  deferred: false,
  replied: false,
  ephemeral: null,
  webhook: InteractionWebhook { id: '947344436973699104' },
  options: CommandInteractionOptionResolver {
    _group: null,
    _subcommand: null,
    _hoistedOptions: []
  }
}```

this?

@urban belfry

?

carmine bridge

ok wait

ChatInputCommandInteraction

give this

idle galleon

What's that other error in white?

carmine bridge
idle galleon

Is the bot even ready?

Those error only happen when ur deploying application commands

carmine bridge

can slash ,but have this error

idle galleon

Why are the application commands being deployed/created when an interaction is received?

carmine bridge

idk

idle galleon

Can you show ur interactionCreate event?

carmine bridge

ok

  const discord = require("discord.js")
  const { OwnerID } = require('../../botconfig/config.json')
 if (!interaction.isChatInputCommand()) return;
  console.log(interaction.constructor.name)
 const command = client.slash.get(interaction.commandName);
  
 if (!command) return interaction.reply({ content: 'an Erorr' });

  if (command.ownerOnly) {
    if (!interaction.member.id == OwnerID) {
      return interaction.reply('Command under developement!')
    }
  }

  if (command.userPerms) {
    if (!client.guilds.cache.get(interaction.guild.id).members.cache.get(interaction.member.id).permissions.has(command.userPerms || [])) {
      if (command.noUserPermsMessage) {
        return interaction.reply(command.noUserPermsMessage)
      } else if (!command.noUserPermsMessage) {
        return interaction.reply(`你需要以下 \`${command.userPerms}\`的權限`)
      }
    }
  }

  if (command.botPerms) {
    if (!client.guilds.cache.get(interaction.guild.id).members.cache.get(client.user.id).permissions.has(command.botPerms || [])) {
      if (command.noBotPermsMessage) {
        return interaction.reply(command.noBotPermsMessage)
      } else if (!command.noBotPermsMessage) {
        return interaction.reply(`我需要\`${command.userPerms}\`這些權限`)
      }
    }
  }

  const args = [];

  for (let option of interaction.options.data) {
    if (option.type === 'SUB_COMMAND') {
      if (option.name) args.push(option.name);
      option.options ?.forEach(x => {
        if (x.value) args.push(x.value);
      });
    } else if (option.value) args.push(option.value);
  }

  try {

    command.run(client, interaction, args)
  } catch (e) {
    interaction.reply({ content: e.message });
  };
}```
idle galleon

That console.log wouldn't have ran if the if statement failed

carmine bridge

is that ok?

brazen grove

can someone tell me

idle galleon

That means the error may of not occurred there

Or that event failed when it ran a second time

Move the console.log above the if statement

brazen grove

i need to create mod bot

carmine bridge
carmine bridge

this

idle galleon

That would indeed be an issue

Can't have parameters being swapped

carmine bridge

this is bug?

idle galleon

Yes, it would be a bug in ur code

spice dagger

Hello i need help, i got the error
TypeError: createComponent is not a function
when i submit a modal

My discord.js version is 14.0.0-dev.1648166883.cedd053

nvm fixed

dapper forum

Is there an ETA for v13.7?

vague coyote

yes, when its ready

dapper forum

I need modals + attachments for slash commands

what should I do to work around it not being released?

vague coyote

use the dev version

dapper forum

isn't that v14?

vague coyote

yes, you can also install the github branch tho

dapper forum

you can't?
because of the new monorepo structure?

vague coyote

that doesn't affect the v13 branch tho

dapper forum

oh yeah, didn't think of that! thanks

coarse flame

Why an v13.6.0?

I'm try npm i discord.js@dev

but discord.js version is 13.6.0

I did it already.

vague coyote

npm remove discord.js
npm ls discord.js
npm i discord.js@dev
npm ls discord.js

coarse flame

Thank you!

umbral mango

Mhm, trying to show a Modal, which results in a TypeError: registerModal.showModal is not a function error.

  const registerModal = new ModalBuilder()
    .setCustomId('registerModal')
    .setTitle('Registration');

  const registerInput = new TextInputBuilder()
    .setCustomId('Name')
    .setLabel("Who are you?")
    .setStyle(TextInputStyle.Short);

  const firstActionRow = new ActionRowBuilder().addComponents(registerInput);
  registerModal.addComponents(firstActionRow);

  await registerModal.showModal(registerModal);

Code is ripped from the guide, so maybe something changed in between which i dont see?

vague coyote

you call showModal() on the interaction, not on the modalbuilder

umbral mango

oh wow, sorry.

looks like i didn't follow the guide closely enough. Modal is shown now.
Interestingly sending it crashes the bot though.

/home/mark/discord-bots/packages/discordbot-master/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 /home/mark/discord-bots/packages/discordbot-master/node_modules/discord.js/src/structures/ModalSubmitInteraction.js:43:54
    at Array.map (<anonymous>)
    at new ModalSubmitInteraction (/home/mark/discord-bots/packages/discordbot-master/node_modules/discord.js/src/structures/ModalSubmitInteraction.js:43:45)
    at InteractionCreateAction.handle (/home/mark/discord-bots/packages/discordbot-master/node_modules/discord.js/src/client/actions/InteractionCreate.js:69:25)
    at Object.module.exports [as INTERACTION_CREATE] (/home/mark/discord-bots/packages/discordbot-master/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
    at WebSocketManager.handlePacket (/home/mark/discord-bots/packages/discordbot-master/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
    at WebSocketShard.onPacket (/home/mark/discord-bots/packages/discordbot-master/node_modules/discord.js/src/client/websocket/WebSocketShard.js:447:22)
    at WebSocketShard.onMessage (/home/mark/discord-bots/packages/discordbot-master/node_modules/discord.js/src/client/websocket/WebSocketShard.js:304:10)
    at WebSocket.onMessage (/home/mark/discord-bots/packages/discordbot-master/node_modules/ws/lib/event-target.js:199:18)
    at WebSocket.emit (node:events:526:28)

Looks like it directly crashes when the event is received hmmspec

copper jetty

Its a bug

umbral mango
copper jetty

You can downgrade

umbral mango
velvet jasper
umbral mango
velvet jasper

Oh wait nvm that’s a fix coming in a PR

random belfry

help me

forest elm

discord.js doesnt export client, you probably wanted to use new Client()
you're assigning client to itself

umbral mango
forest elm

yeah, but you named your client instance discordjs this time, not client

seems like you're lacking javascript knowledge #resources

random belfry

one more error

=)))

nocturne kayak
random belfry

I'm new coder

vague coyote

Doesnt matter, this channel is for the dev version of djs, not for basic djs issues

nocturne kayak

can i ask what's the pr for fixing "createComponent is not a function" bug?

forest elm
umbral mango
forest elm

you'd probably have to clone the repo manually and use yarn link or yarn pack

umbral mango

mhm. I'll just wait a bit longer harold

PR already has 1 approval, so it cant take that long harold
COPIUM

nocturne kayak

yeah mmLol

vague coyote

still have to wait for the dev release mmLol

umbral mango

soon_tm

small mica

What is it changed to?

small mica

ah now its everything builder I see. Thanks

regal mason

Is this possible to send localized application commands with djs v14 ?

vague coyote
regal mason

pr ?

vague coyote

pull request on github

granite brook

Hello! How i can fix it?

jaunty vault
granite brook

oh. This is very bad...

jaunty vault
copper jetty

Its fixable just edit the source code

stuck solstice

You can fix it in source yourself or wait for PR merge

nocturne kayak

is there any workaround for this while waiting for pr merge?

flat tulip
uncut kelp

Some great dev help right there

uncut kelp
rugged flicker

quick question, is it possible to make a bot that pins a message if it has enough reactions (starboard but for pins)

oh

i'm new where should i ask

ok

scarlet tangle
if (i.values[0] === "jpg") {
                        ctx.interaction.editReply({
                            embeds: [{
                                author: {
                                    name: user?.tag,
                                    icon_url: user?.displayAvatarURL({
                                        dynamic: true
                                    })
                                },
                                description: `${user?.avatar.startsWith("a_") ? `[\`PNG\`](${user?.displayAvatarURL({ format: "png" })}) | [\`JPG\`](${user?.displayAvatarURL({ format: "jpg" })}) | [\`WEBP\`](${user?.displayAvatarURL({ format: "webp" })}) | [\`GIF\`](${user?.displayAvatarURL({ format: "gif" })})` : `[\`PNG\`](${user?.displayAvatarURL({ format: "png" })}) | [\`JPG\`](${user?.displayAvatarURL({ format: "jpg" })}) | [\`WEBP\`](${user?.displayAvatarURL({ format: "webp" })})`}`,
                                image: {
                                    url: user?.displayAvatarURL({
                                        format: "jpg",
                                        size: 1024
                                    })
                                },
                                footer: {
                                    text: `Requested by ${user?.tag}`,
                                    icon_url: user?.displayAvatarURL({
                                        dynamic: true
                                    })
                                },
                                color: 0x2F3136
                            }]
                        })
                    }
``` does anyone know this issue i edited the embed from the avatar dynamic to format jpg but it stills shows the gif format any idea why?
white nebula
scarlet tangle
scarlet tangle
mighty nacelle

how can i use slash command localications in discord.js?

forest elm
mighty nacelle
wicked nebula

Finally got @dev with Rodry's types/fix-regressions PR working on my test bot locally

I believe that yarn v1 was actually causing the problem in some way

Did not really change anything other than yarn version 🤷

wicked nebula

Yes why would I lie about that?

forest elm

no

pr wasnt merged

wicked nebula

You would need to locally clone discord.js repo and add the PR yourself.

wicked nebula

Is there any PR open that fixes the issue where I have to add as ActionRowBuilder<MessageActionRowComponentBuilder> to every ActionRowBuilder?

copper jetty

i dont think thats an issue

wicked nebula

Should it not automatically detect that type?

Ah I see, because the modal interface is different from the other components it does not do that anymore.

scarlet tangle

Yes

river harbor

Why is my bot not connecting? My code: await client.login(process.env.token);

There are no errors at all. It's just not connecting.

plain roverBOT

Tag suggestion for @river harbor:
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.

client
    .on("debug", console.log)
    .on("warn", console.log)

• Note: if you initialize your Client as bot or other identifiers you need to use these instead of client
• If the output is too long to post consider using a bin instead: gist | hasteb.in | sourceb.in | hastebin

river harbor

@scarlet tangle Still nothing.

river harbor

node index.js

copper jetty

is your main file named index.js?

river harbor
scarlet tangle

Try logging something I guess

Or show more of your code

river harbor

It's working.

I just logged "cheese" and it worked.

I've also reinstalled all my packages.

somber mirage

How can I set color with hex?

vagrant mortar
carmine bridge

why the edit not work

civic topaz

anyone here

carmine bridge

not toJSON is not work

civic topaz

same problem with me

carmine bridge

and have toJSON not work

nocturne kayak

why would it not work
can you show your error

carmine bridge

not error

civic topaz
latent lion

How do you add choices?

There isn't a option type 'Choice'

nocturne kayak

ofc there isnt

latent lion

then what

nocturne kayak

specify choices: [] property

latent lion
nocturne kayak

add choices to your option obj?

latent lion

Like ```js
type: [
{
name: 'choice1',
//other stuff
}
]

nocturne kayak

also its type is ApplicationCommandOptionChoice

latent lion

Ok

?

nocturne kayak

no, it isnt a type

latent lion

Can you show me an example?

nocturne kayak
{
    name: "name",
    description: "description",
    type: ApplicationCommandOptionType.String,
    // Choices are only available on string option type
    choices: [
        {
            name: "Im what will be displayed to the user",
            value: "im what the bot will receive",
        },
        {...}
    ],
};
latent lion

Alright thanks

velvet jasper
latent lion

Hmm

flat tulip

Did Permissions bitfield changed in discord.js v14?

if(!message.member.permissions.has("ADMINISTRATOR")) {
}

I got an error: RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: ADMINISTRATOR. [Symbol(code)]: 'BITFIELD_INVALID'

Ok

tame gazelle

and no need to use enums for permissions

flat tulip

oh sure

I already used resolver

I saw docs and most things changed to: First letter upper case, other lower case

scarlet tangle
uncut kelp

Sure

Ignore that, was wrong

scarlet tangle

ok

uncut kelp

It's not a status, it's a HTTP interaction bot

woeful pollen

right, apologies

scarlet tangle
uncut kelp

What does that mean

scarlet tangle

https interactions endpoint only allows the bot to receive interaction based events thats what i know if i am wrong may correct me aswell

uncut kelp

Yes. They're not in the server

It's not "blocked", they just don't get them

scarlet tangle

hmm so there isn't really another way for me to do it?

uncut kelp

No

scarlet tangle

alright thanks

scarlet tangle
uncut kelp No

btw for the <User>.displayAvatarURL() function imageurl options "extension" aint working any idea why and extremely sorry for the ping

tame gazelle
scarlet tangle
scarlet tangle

@tame gazelleuh you there?

tame gazelle
scarlet tangle

its actually converting the extension for non animated pfps but not for animated

ones

uncut kelp
scarlet tangle

yet even when i used extension it doesn't change the gif extension to png or any other

undone yew

ButtonComponent is renamed to ButtonComponentBuilder ?

tame gazelle

ButtonBuilder

undone yew

ok thx

nocturne kayak

is there a way to create a modal collector? or i'll have to make a modal handler on my own?

plain roverBOT

Documentation suggestion for @nocturne kayak:
_ InteractionCollector (extends Collector)
Collects interactions. Will automatically stop if the message (Client#event:messageDelete messageDelete or Client#event:messageDeleteBulk messageDeleteBulk), channel (Client#event:channelDelete channelDelete), or guild (Client#event:guildDelete guildDelete) is deleted. (more...)

undone yew

How to use generateInvite() ?

plain roverBOT

Documentation suggestion for @undone yew:
_ Client#user
User that the client is logged in as

fresh prawn

createComponent is not a function still not fixed?

woeful pollen

update djs

fresh prawn

I did, npm i discord.js@dev

woeful pollen

nvm it wasnt fixed yet

dull mulchBOT
fresh prawn

I just get an error when i try to :p

small mica

GUILD_TEXT is now Channel.isText right?

white nebula
small mica

ohok

tame gazelle
small mica
tame gazelle

await the create

it returns a Promise

small mica
tame gazelle

e is an Invite object

not a string

nocturne kayak

there's user and member prop when i try to log raw data of ModalSubmitInteraction
why is it not present yet in its structure?
nvm

small mica
plain roverBOT

Documentation suggestion for @small mica:
_ Invite (extends Base)
Represents an invitation to a guild channel.

ionic wren
ZodError: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [],
    "message": "Required"
  }
]

🤔

        const putInSelect: APISelectMenuOption[] = data.map(
            (element, index) => ({
                label: element.title.slice(0, 25),
                description: element.description.slice(0, 50),
                value: index.toString(),
            }),
        );

        const select = new SelectMenuBuilder()
            .setMinValues(1)
            .setMaxValues(1)
            .setPlaceholder("請選擇App")
            .addOptions(
                { label: "取消", description: "取消查詢", value: "-1" },
                ...putInSelect,
            );

any field or select menu property is required and I forgot to assign value to it?

mighty nacelle
split fulcrum

Ehm what? v14.0.0-dev.1648166883.cedd053

sterile vortex

Hi, I just updated discord.js@dev and i have this error on every embed ^^'
Version : discord.js@14.0.0-dev.1648166883.cedd053

import { Embed } from 'discord.js';
const embed = new Embed() // Error : Constructor of class 'Embed' is private and only accessible within the class declaration.

Does anyone know how to fix this?

copper jetty

You can't construct new Embed thats what EmbedBuilder is for

split fulcrum

Wait they changed Embed() to EmbedBuilder()? now

copper jetty

yes

sterile vortex

Are you sure? I can only do .setColor on the builer

split fulcrum

Ehmmm

copper jetty

im sure

sterile vortex

It's not logical, they wouldn't have made any changes on the fields if they don't want to use .addFields

🤔

It doesn't seem right

idle galleon

Prob have to call toJSON on it

sterile vortex

I can't

I have only .setColor()

split fulcrum

wait will EmbedBuilder().setColor() and all that work?

copper jetty
split fulcrum

or

sterile vortex
split fulcrum

Got it working again weird that they changed the Embed() to EmbedBuilder()

split fulcrum

JS

sterile vortex

Okay

Not working in Typescript 😢

radiant gate
const {
  Client,
  GatewayIntentBits,
  Colors,
  ButtonBuilder,
  ButtonStyle,
  EmbedBuilder,
  ActionRowBuilder,
} = require("discord.js");

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.MessageContent,
  ],
});

const { token } = require("./config.json");

client.on("ready", async () => {
  console.log(`bot is on ${client.user.tag}`);
});

client.on("messageCreate", async (message) => {
  if (!message.guild || message.author.bot) return;
  let prefix = "!";
  let args = message.content.slice(prefix.length).trim().split(/ +/);
  let cmd = args.shift()?.toLowerCase();

  switch (cmd) {
    case "test":
      {
        let embed = new EmbedBuilder()
          .setColor(Colors.Blurple)
          .setDescription(`>>> HI How are you`);

        let buttons = new ActionRowBuilder().addComponents([
          new ButtonBuilder()
            .setCustomId("1")
            .setLabel("GREEN")
            .setStyle(ButtonStyle.Success),
          new ButtonBuilder()
            .setCustomId("2")
            .setLabel("RED")
            .setStyle(ButtonStyle.Danger),
        ]);
        message.reply({ embeds: [embed], components: [buttons] }).catch(e => console.log(e.message))
      }
      break;

    default:
      break;
  }
});

client.login(token);

this code is correct ?

copper jetty
split fulcrum

Is the ButtonComponent the new ComponentType??

A lot have changed so idk what to change to get everything to work

copper jetty

Its Button

split fulcrum

Wait so AddCompenets is ButtonComponent?? or

sterile vortex
radiant gate

TypeError: t.toJSON is not a function
    at /media/techboy/20121DFB121DD69E/Programing/coding/My_Code/YOUTUBE TUTORIALS/dicordjsv14/node_modules/@discordjs/builders/dist/index.js:3:4258
    at Array.map (<anonymous>)
    at ActionRowBuilder.toJSON (/media/techboy/20121DFB121DD69E/Programing/coding/My_Code/YOUTUBE TUTORIALS/dicordjsv14/node_modules/@discordjs/builders/dist/index.js:3:4249)
    at /media/techboy/20121DFB121DD69E/Programing/coding/My_Code/YOUTUBE TUTORIALS/dicordjsv14/node_modules/discord.js/src/structures/MessagePayload.js:135:30
    at Array.map (<anonymous>)
    at MessagePayload.resolveBody (/media/techboy/20121DFB121DD69E/Programing/coding/My_Code/YOUTUBE TUTORIALS/dicordjsv14/node_modules/discord.js/src/structures/MessagePayload.js:134:49)
    at TextChannel.send (/media/techboy/20121DFB121DD69E/Programing/coding/My_Code/YOUTUBE TUTORIALS/dicordjsv14/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:169:32)
    at Message.reply (/media/techboy/20121DFB121DD69E/Programing/coding/My_Code/YOUTUBE TUTORIALS/dicordjsv14/node_modules/discord.js/src/structures/Message.js:792:25)
    at Client.<anonymous> (/media/techboy/20121DFB121DD69E/Programing/coding/My_Code/YOUTUBE TUTORIALS/dicordjsv14/index.js:49:17)
    at Client.emit (node:events:527:28)

Node.js v17.6.0```
copper jetty

addComponents method takes rest parameters

radiant gate
let buttons = new ActionRowBuilder().addComponents([
          new ButtonBuilder()
            .setCustomId("1")
            .setLabel("GREEN")
            .setStyle(ButtonStyle.Success),
          new ButtonBuilder()
            .setCustomId("2")
            .setLabel("RED")
            .setStyle(ButtonStyle.Danger),
        ]);

valid ?

nocturne kayak

no.
Do you know what's rest param?

radiant gate
plain roverBOT

_ 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 gate

yems

mossy locust

Is it not possible to reply to a modal with ephemeral?

nocturne kayak

it's entirely possible

proven wolf

modals with forms not yet viewable in Discord (standard version not development/canary)?

copper jetty
proven wolf
copper jetty

<Interaction>.showModal(modal)

proven wolf
plain roverBOT
proven wolf

Thanks

nocturne kayak

and you can showModal() in any type of interaction except autocomplete and modal itself

scarlet tangle

hello, could i ask whats the solution?

copper jetty
acoustic nymph
gloomy kayak

Yeah, that PR fixes an error with modals. Just wait for it to be merged and released

scarlet tangle
    const options = categories.map(category => ({
            label: category.name,
            value: category.name,
        })
       )
     
    const menu = new SelectMenuBuilder()
      .setCustomId('help')
      .setPlaceholder(`Choose a category`)
      .addOptions(...options);

Why this doesn't work?

t.toJSON() is not a function

copper jetty

you can just ping Mod role

it looks like you didnt define guildid for me

forest elm
silver robin
shrewd sparrow

Some mistakes were made...

river harbor

What partials are used to recieve GuildMessages?

river harbor
copper jetty
river harbor
shrewd sparrow
copper jetty
shrewd sparrow

ik

i just wanted to point it out

regal mason

How to send buffer attachment ?

woeful pollen

channel.send({ files: [file] })

river harbor
onyx cove

nvm

river harbor
knotty plover

Nothing to do with v14 itself, that's a standard JS error for using await incorrectly

stuck solstice

What argument does <EmbedBuilder>#setAuthor() take?

User or Member?
Or can I use both?

plain roverBOT
stuck solstice

stable docs :T
if it's the same then thx

Thought using object was deprecated or smth

vague coyote

using string was

stuck solstice

Ah, thx

plain roverBOT

<MessageEmbed>.setFooter() and <MessageEmbed>.setAuthor() now each take an object:

- embed.setAuthor('This is an example text', 'https://exampleicon.com', 'https://websiteofauthor.com')
+ embed.setAuthor({ name: 'This is an example text', url: 'https://websiteofauthor.com', iconURL: 'https://exampleicon.com' })

- embed.setFooter('This is an example text', 'https://exampleicon.com')
+ embed.setFooter({ text: 'This is an example text', iconURL: 'https://exampleicon.com' })
regal mason

I don't really understand

forest elm

EmbedBuilder, the Embed class is only used when receiving embeds, you cant construct it yourself

regal mason

oh okay

It is possible to set an buffer in setImage() ?

plain roverBOT

Tag suggestion for @regal mason:
MessageEmbed#attachFiles has been removed. Files should be attached via the message option object instead:

  const attachment = new MessageAttachment('./image.png', 'image1.png');
  const embed = new MessageEmbed()
-   .attachFiles([attachment])
    .setTitle('Attachments')
    .setImage(`attachment://${attachment.name}`);

- channel.send(embed)
+ channel.send({
+   embeds: [embed],
+   files: [attachment]
+ });
forest elm

in the message attachment constructor you can pass a buffer as the first argument instead of a file path

onyx cove

I feel like I can't be the only one who's getting this, but while using modals, the bot completely freezes up, and this happens:

no errors in console

using both InteractionCollector, and client.on

nocturne kayak
onyx cove
nocturne kayak you didnt reply to the modal?

It won't let me reply to the interaction cuz the bot freezes once I click "submit":

const col = new Discord.InteractionCollector(client, {max: 999});
col.on("collect", async (i)=>{
    console.log("f")
    if(!i.isModalSubmit()) {
    const modal = new Discord.ModalBuilder().setTitle("My Modal.").setCustomId("mymodal").addComponents(new Discord.ActionRowBuilder().addComponents(new Discord.TextInputBuilder().setCustomId("yasser").setPlaceholder("no placeholder?").setStyle(Discord.TextInputStyle.Short).setLabel("Yasser").setRequired(true).setValue("yasser").setMinLength(3).setMaxLength(200)))
        i.showModal(modal)
    } else if(i.isModalSubmit()){
        console.log("e")
        i.reply({content: "yetys"})
    }
})

to elaborate, once I click submit the bot won't respond to anything, console.log anything, or listen to any other messages or slash commands

knotty plover

Why is it waiting for 999 submissions

onyx cove
river harbor

Do collectors have a default time from which it ceases to function?

nocturne kayak
river harbor
onyx cove
stuck solstice

Code:

const modal = new ModalBuilder()
    .setTitle("LFG Creation")
    .setCustomId("lfg-create")
    .addComponents(
        new ActionRowBuilder().addComponents(new TextInputBuilder().setCustomId("lfg-time").setLabel("Time").setStyle(TextInputStyle.ShortText)),
        new ActionRowBuilder().addComponents(new TextInputBuilder().setCustomId("lfg-desc").setLabel("Description").setStyle(TextInputStyle.Paragraph)));
interaction.showModal(modal);

Error: ZodError: Invalid enum value. Expected 1 | 2
Full stack: https://pastebin.com/YuX1YsxP

I'd like to know what's wrong and how to debug a ZodError
Never encountered one before

copper jetty
subtle vortex

that would make sense.

stuck solstice
subtle vortex
stuck solstice

Might take a peek, thanks ^^

knotty plover

We're replacing Zod with Shapeshift too

Cause Zods errors suck

copper jetty
stuck solstice

Pretty clear? That was in no way clear.
Anyway, if we are to discuss about it -> #archive-offtopic

stuck solstice
river harbor
pallid ice

anyone remember or know what the last good commit was before modal submits broke? I wanna do some testing with them for an upcoming project

stuck solstice

doesn't work anyway

This was a commit that worked for me 14.0.0-dev.1647259751.2297c2b

radiant gate

how can i resolve guild permissions in cmds like SEND_MESSAGES to enum number

rain bramble
rain bramble
carmine bridge

why prefix not work

new version

plain roverBOT

Tag suggestion for @carmine bridge:
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?

carmine bridge

the
last version can

i upgrade the ^14.0.0-dev.1648339713-520f471

can't

no error

the command not work

i trying the help

no response

i use this is ok

carmine bridge
radiant gate

And when i set commands giving error j can't resolve bigint

prefix cmds not working in djsv14

it will not work ?

rain bramble
onyx cove
carmine bridge

yes

idk why

last dev version ok

14.0.0-dev.1648339713-520f471 this is new version

prefix not work and no error in the console

onyx cove

And make sure it’s also enabled on the bots application dashboard

But fair warning, prefix commands aren’t recommended, and you should switch to slash commands

radiant gate
onyx cove

So I recommend switching to slash commands/application commands for the most capabilities, and they’re less annoying to use and develop

carmine bridge

How to loading slash fast

pallid ice

guild slash commands are instant, global can take up to an hour to appear

carmine bridge

How to use guild slash commands are instant

Can you give me the eg?

scarlet tangle
idle galleon

You put smth weird or incorrectly in an ActionRowBuilder

copper jetty
idle galleon

Show the row too

scarlet tangle
const row = new ActionRowBuilder()
.addComponents([menu])

Just figured it,nvm

idle galleon

It prob doesn't take an array

urban belfry
scarlet tangle
civic topaz
woeful pollen

GuildMessages

civic topaz
woeful pollen

its GUILD_MESSAGES in v13

civic topaz

then I added already

I add all intents to my bot :-)

copper jetty

Message content intent isn't guild messages intent

woeful pollen

??

urban belfry

GUILD_MESSAGES isn't the same as the privileged message content intent
that is added in v10, or will be, i'm not sure but it's a separate intent

woeful pollen

ah, never knew that

copper jetty

You still can receive messages without message content intent but the content property will be null

thin folio

Yeah, afik you will have to explicitly specify that intent for message content

summer elbow

InteractionCollector
extends Collector

Collects interactions. Will automatically stop if the message (messageDelete or messageDeleteBulk), channel (channelDelete), or guild (guildDelete) is deleted.

Will this behaviour remain the same in v14?

nocturne kayak

yes? why not

summer elbow

Didn't really go through source but thought it might be affected by the removal of Message#deleted

nocturne kayak

not at all

summer elbow

Thanks, and my bad I was looking at the Collector file for the listeners. Should've checked what the name was

gloomy kayak

Yes

onyx cove

Some1 pin that maybe^

gloomy kayak

I mean, why would you use 32_768 instead of 1 << 15

small mica

What is js SelectMenuOptionrenamed to?

scarlet tangle
     const options = categories.map(category => ({
            label: category.name,
            value: category.name,
        })
       )
     
    const menu = new SelectMenuBuilder()
      .setCustomId('help')
      .setPlaceholder(`Choose a category`)
      .addOptions(...options); 
 
    const row = new ActionRowBuilder()
       .addComponents(menu)

message.channel.send({ components: [row] })

Why this doesn't work?

velvet jasper
small mica

okay

copper jetty

I think select menu options needs description

scarlet tangle

No?

small mica
.addOptions(
            categories.map((cmd) => {
              return {
                label: cmd.directory,
                value: cmd.directory.toLocaleLowerCase(),
                description: `Commands from ${cmd.directory} category`,
              };
            })```
Even this doesn't work
south python

Are modals already on the dev version?

scarlet tangle
small mica
scarlet tangle
south python

What is the class called

south python

Ahh thanks

thin folio