#djs-in-dev-version

35223 messages · Page 17 of 36

heavy pasture

thx

kind pulsar

Is there a way to check if a message has been deleted? (I ask it because the .deleted method no longer exists in the version 14)

urban belfry

try and fetch it, if it fails, it doesn't exist

kind pulsar
urban belfry

message.fetch()

but like what, you're trying to delete a message? just call delete and handle the error

kind pulsar

ok, thanks :D

restive bear

How would I go through a list of users with the same name, then ban them if they have the same username?

copper jetty

Fetch all members and loop through the collection

velvet jasper
woeful pollen
knotty plover

Theres a rate limit on everything

copper jetty

why

knotty plover

So people cant abuse the APIs

velvet jasper
cinder bane

can a GuildNews channel be a GuildText channel as well?

knotty plover

No

cinder bane

okay

fluid summit

Is the embed setFooter still broken?

knotty plover

Never was?

Or if it was it was too long ago for me to remember so no, is fixed

fluid summit

Hmm just adding a footer causes my embed to crash. Only thing I changed

scarlet tangle
knotty plover

whats the crash

fluid summit

I actually opened a issue ticket in the discordjs github but wasn't sure if it's implemented in the recent discord.js@dev release

  const secretEmbed = new EmbedBuilder()
    .setColor('#e7cb04')
    .setTitle('test1')
    .setDescription('test2')
    .setImage(`attachment://${test3.name}`)
    .setFooter('testFail');
knotty plover

setFooter takes an object

setFooter({ text: "testFail" })

fluid summit

omg...

Ah right. I forgot my old issue ticket was about footer not taking attachments correctly

knotty plover

Looks like thats using the old error message though, I did do a PR to improve the output so its more meaningful

fluid summit

Thanks. Dumb error by me

wintry bear

in modals anyway to change the character limit per text box?

tame gazelle

.setMaxLength / .setMinLength

wintry bear

ty

scarlet tangle
TypeError: Cannot read properties of null (reading 'id')
    at InteractionCollector._handleMessageDeletion (C:\RolexBot\node_modules\discord.js\src\structures\InteractionCollector.js:214:29)
    at RolexBot.emit (node:events:527:28)
    at MessageDeleteAction.handle (C:\RolexBot\node_modules\discord.js\src\client\actions\MessageDelete.js:22:16)
    at module.exports [as MESSAGE_DELETE] (C:\RolexBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_DELETE.js:4:32)
    at WebSocketManager.handlePacket (C:\RolexBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
    at WebSocketShard.onPacket (C:\RolexBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:22)
    at WebSocketShard.onMessage (C:\RolexBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:304:10)
    at WebSocket.onMessage (C:\RolexBot\node_modules\ws\lib\event-target.js:199:18)
    at WebSocket.emit (node:events:527:28)
    at Receiver.receiverOnMessage (C:\RolexBot\node_modules\ws\lib\websocket.js:1137:20)
    at Receiver.emit (node:events:527:28)
    at Receiver.dataMessage (C:\RolexBot\node_modules\ws\lib\receiver.js:528:14)
    at Receiver.getData (C:\RolexBot\node_modules\ws\lib\receiver.js:446:17)
    at Receiver.startLoop (C:\RolexBot\node_modules\ws\lib\receiver.js:148:22)
    at Receiver._write (C:\RolexBot\node_modules\ws\lib\receiver.js:83:10)
    at writeOrBuffer (node:internal/streams/writable:390:12) uncaughtException
``` is this a bug or smth it works properly sometimes after it stops and gives this error which results in a interaction failed message
outer bane

it's a bug but it has already been fixed, update

scarlet tangle
lucid spade

does dev version have attachments?

urban belfry
lucid spade

yes in slash commands

urban belfry

yeah we have that and it'll drop in version 13.7 too

compact falcon

i have a problem using flags in v14 and some ppl told me to change intents to IntentsBitField because it got renamed
but if i change intents to ... then i'll get more problems

jaunty vault
compact falcon

code:

urban belfry

read the guide for updating

jaunty vault
compact falcon

oh rly?

jaunty vault
compact falcon oh rly?

only the client option btw, not Intents.FLAGS you still have to change Intents.FLAGS to IntentsBitField.Flags

urban belfry

they didn't tell you to change the property, they told you to change the flag accessing

again, there's a guide for updating and it's pinned

compact falcon
forest elm

read the guide for updating

again, there's a guide for updating and it's pinned

compact falcon

i try to fix that code for hours and i looked for so much information ;-; i just want help

compact falcon

i am and it didnt helped me

proper jetty

can anyone help?
code:

  if(cmd == `!h`){
       
      
                    
    let channel = message.member.voice.channel
    if(channel) {
    channel = "**מחכה בחדר: ** <#" + message.member.voice.channel + ">"
    }else{
    channel = ':x: **לא מחובר לשום חדר** :x: '
    }
                var reason = args.join(" ");
    if(!reason) reason = "לא צויינה סיבה";
            const embed = new EmbedBuilder()
            .addField( "**__ממבר__**:\n",` ${message.author} | **זקוק לעזרתך!**`)
            .addField("**__וויס__**:", `${channel}`)
            .addField("**__סיבה__**:\n", reason)
            .setColor(`#11CCEE`)
            .setThumbnail(message.author.displayAvatarURL({dynamic: true}))
            .setFooter(message.author.username + "#" + message.author.discriminator, message.author.avatarURL)
    .setTimestamp(new Date())
            message.channel.send({ content: '<@&968138149429649469>',embeds: [embed] });


        setTimeout(function(){

        }, 20000);
    }```
jaunty vault
proper jetty
jaunty vault use addField**s**

Now saying Im not connected to voice, even when I am.

  if(cmd == `!h`){
       
      
                    
    let channel = message.member.voice.channel
    if(channel) {
    channel = "**מחכה בחדר: ** <#" + message.member.voice.channel + ">"
    }else{
    channel = ':x: **לא מחובר לשום חדר** :x: '
    }
                var reason = args.join(" ");
    if(!reason) reason = "לא צויינה סיבה";
            const embed = new EmbedBuilder()
            .addFields(
            { name: ` **__ממבר__**:\n`, value: ` ${message.author} | **זקוק לעזרתך!**`},
            {name: "**__וויס__**:", value: channel},
            {name: "**__סיבה__**:\n",value: reason}
            )
            .setColor(`#11CCEE`)
            .setThumbnail(message.author.displayAvatarURL({dynamic: true}))

    .setTimestamp(new Date())
            message.channel.send({ content: '<@&968138149429649469>',embeds: [embed] });


        setTimeout(function(){

        }, 20000);
    }```
jaunty vault
proper jetty
proper jetty

Why not?

urban belfry

bad idea, just use the ones you need, easy way to know, read the guide

jaunty vault

just use the ones you need

proper jetty

Easier to do isn't?

vague coyote

Cuz you get payloads you dont need.
Its not easier.

urban belfry

it takes like 3 minutes to learn, saves up a lot of resource use

regal mason

How I can create an message component collector on a interaction reply ?

(How I can listen to button interactions on a interaction reply)

urban belfry
regal mason

okay, thanks

urban belfry

and the it's simple, create a collector on the the message

velvet jasper
urban belfry

whaa

regal mason

So I just have to resolve the promise without adding fetchReply

velvet jasper

yeah await it

urban belfry

since when? how
and why'd the source button on the docs break again

dull mulchBOT
regal mason

But I get this error

The same as I tried to use interaction.fetchReply()

velvet jasper

Are you on the latest dev version?

regal mason

no

velvet jasper

You’ll need to be on the latest dev version

This channel is for people on v14 dev

regal mason

I am on v14

I am not at the latest commit

urban belfry

then just update..

regal mason

I was*

Updated and the error still, but does this work with editReply ?

velvet jasper

Oh edit reply always gives the message back anyways you just need to cast it as a message

urban belfry
scarlet tangle

(intermediate value).setColor is not a function what does this supposed to mean?

woeful pollen

show the code

scarlet tangle
woeful pollen show the code
let emb = new Embed()
            .setColor(0x2F3136)
            .setFooter({
                text: `Page ${page}/${Math.ceil(ctx.client.guilds.cache.size / 10)}`
            })
            .setDescription(description);
woeful pollen

its EmbedBuilder

scarlet tangle

is the import from builders or djs?

urban belfry

both work actually
djs just adds more functionality on the builders one

scarlet tangle

ok

@urban belfry@woeful pollen both of you thanks for the help

uncut kelp
somber mirage

How can I put hex code in embed color?

velvet jasper

Or just use a hex string

versed trench

When is v14 coming out ?

vague coyote

when its ready

we dont do eta's

scarlet tangle

Hi, can sb help me?

TypeError: components.map is not a function

const adContentModal = new TextInputBuilder();
adContentModal.setCustomId('adContentModal').setLabel('Treść reklamy').setStyle(TextInputStyle.Paragraph);

const firstActionRow = new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents([adContentModal]);
setAdModal.addComponents(firstActionRow);

await interaction.showModal(setAdModal);

This line returns error

setAdModal.addComponents(firstActionRow);
copper jetty

it takes an array

scarlet tangle

where

vague coyote

addComponents

takes an array of actionrows

scarlet tangle

oh, okay..

Thank you

vague coyote

You tell us, how did you register them

sharp pine

oopsie dayse

i accidently overrided my old files 😬

lavish snow

Hey, cannot figure out why this is happening

knotty plover

Not our package, not supported

copper jetty
knotty plover

Theyre not even using the dev version

copper jetty

how

knotty plover

Because I know they arent

It would be called ModalBuilder if they were

copper jetty

then install dev version @lavish snow

knotty plover

Also because I'd already spoken to them in another channel

copper jetty
rocky elk

algum br kkkkkkkkkk

?

knotty plover

no

flint lark

Good morning. meow_wave Any ETA for when Discord.JS V14 would release, as in the date?

spare fiber

no eta

carmine bridge

what is this

idle galleon

Smth expected an array

Show the stack trace

knotty plover

Looks like it expected a number and didn't get one

idle galleon

I believe it’s from a item.length constraint, where the item doesn't have a length property

knotty plover

ahh

carmine bridge

client.ws.ping

cant this

knotty plover

what

carmine bridge

npm 8.7

cant use client.ws.ping

covert cipher

🤔 where are the other get functions

oh nvm

it was CommandInteraction not ChatInputCommandInteraction

idle galleon
carmine bridge
idle galleon
carmine bridge

have err ?

idle galleon

No

Unless ur using the latest dev version builders Thinkeng

idle galleon
carmine bridge
idle galleon

Provide arrays for addFields

.addFields([ { name, value } ])

carmine bridge

oh

thx

carmine bridge
idle galleon
scarlet tangle

how can i install dev and will it break my v13?

fluid bronze

Check the pins

And yes, it will break unless you update your code

small mica

do you have the message content intents in your code?

is there any error?

forest elm

that slice (probably) returned an empty array

check for the length .options.length, an empty array is truthy

regal mason

I got this

urban belfry
regal mason
urban belfry

that really does not help
i asked where it was, and for additional context

regal mason

I'm not modifying .token, i'm not calling destroy

urban belfry

ah so maybe that's just undefined

but this shouldn't be connected to the code you've shown though

regal mason

Yes that's why I find that weird

outer bane

any other errors before this one?

like invalid token for a webhook?

regal mason

A lot of errors like this

outer bane

and at the start?

regal mason
outer bane

the stack trace shows minified code which means you are not on the latest dev commit, you should update

regal mason

deprecation 👀

outer bane

There's a high possibility that whatever lead to you getting those errors is already fixed, there was a fix for invalid webhook tokens resetting the bot token

regal mason

ah

stiff mantle

why does it appear like this? was fine before

TypeError: Cannot read properties of undefined (reading 'permissions')
proper jetty

How do you make the bot's status member count of a specific guild in v14?
current code:

client.on('ready', () => {
    console.log("online")
     setInterval(() => {
         const totalMembers = client.guilds.cache.map(guild => guild.memberCount).reduce((a,b) => a + b, 0);
          client.user.setPresence({ game: { name: totalMembers, type: 'WATCHING' }, status: 'online'  })
                .then(console.log)
                .catch(console.error);
       
     }, 1000 * 60 * 5);
})```
nocturne kayak

pretty sure game.name expects a string
stringify the number from totalMembers

proper jetty
nocturne kayak

same as v13 pretty much

urban belfry

except the ActivityType enum

proper jetty

Can't be simple as this?

client.on('ready', () => {
    console.log("online")
    client.user.setPresence({ activity: { name: `${client.users.cache.size} members` , type: 'WATCHING'}, status: 'online' })
});```
jaunty vault
urban belfry

it's fine

client.users.cache though, no that's not reliable really
your previous implementation was better

proper jetty
jaunty vault
proper jetty

right.

proper jetty
forest elm

now fix the syntax

jaunty vault
plain roverBOT

Getting your bot's member count
client.users.cache.size is unreliable because it will only return cached users
• The preferred method is using collection.reduce() on client.guilds.cache

client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
proper jetty
proper jetty

ActivityType is not defined.

nocturne kayak

import it from djs then

jaunty vault
proper jetty

okay.

Thanks, finally works.

jaunty vault

👍

unborn aurora

hey, how do I get v14 ?

jaunty vault
unborn aurora

thanks, are there docs too?

unborn aurora

thanks sir

brazen knoll
  const m = await cmd.reply({
    components: buttons,
    content: question,
    ephemeral: true,
  });
  const buttonsCollector = m.createMessageComponentCollector({ time: 60000 });

  buttonsCollector.on('collect', (interaction) => {
    console.log(interaction);
  });```

why is interaction not collected, is there a different way for collecting ephermeral interactions?
nocturne kayak

specify fetchReply: true on your reply option

brazen knoll

will try

jaunty vault
urban belfry

you shouldn't need to fetchReply anymore just to create a collector

brazen knoll

that worked, thank you

brazen knoll
urban belfry

@brazen knoll could you try and update to the latest commit first?

brazen knoll

i did just yesterday

urban belfry

if this doesn't work, that's an issue right there

brazen knoll

lemme do taht rq

nope only works with fetchReply

urban belfry

could you log m?

brazen knoll

(i cut away client)

ping if u need more

urban belfry

i can't test it now, but well it is an InteractionResponse, maybe it being ephemeral is the issue

brazen knoll

probably, well the fetchReply fixed it so im happy

brazen knoll
  new Builders.ModalBuilder()
    .setCustomId(`suggestionReason_${i.createdTimestamp}`)
    .setTitle('Add Details')
    .addComponents([
      new Builders.ActionRowBuilder().setComponents(
        new Builders.TextInputBuilder()
          .setCustomId('longReason')
          .setLabel('Put long Text here')
          .setPlaceholder('optional')
          .setStyle(Discord.TextInputStyle.Paragraph)
          .setRequired(false)
          .setMinLength(0)
          .setMaxLength(4000),
      ),
    ]);```
data.components[0].components[BASE_TYPE_REQUIRED]: This field is required

now im trying to do modal stuff but i cant figure out how to make it work

issue was .addComponents([]), shouldnt be given an array

vague coyote
brazen knoll

woh

but its not working with array

vague coyote

setComponents takes an array as well

brazen knoll

bots cant delete ephemeral messages can they?

dawn phoenix

no

brazen knoll

Okay

undone yew

how to fix?

brazen knoll

remove ...

undone yew

line

brazen knoll

on components ...

spare fiber

it must be array

undone yew

ok

brazen knoll

they made it accept arrays now

copper jetty

update node

addComponents takes an array

they made it work with arrays for some reason

lavish snow

Anyway to fix this?

copper jetty
lavish snow
vague coyote

isText() is a typeguard, use it like one

lavish snow

Hey, my code doesnt log it

copper jetty

modalSubmit isn't discord.js event, use interactionCreate

obtuse plaza

Are we able to create confirmation modals like this?

copper jetty

no

worn gyro

How I can install discord.js v14 ?

vague coyote

checkpins

somber mirage
worn gyro

Is there a guide for modals?

copper jetty

yes

somber mirage

Yes, Check the pinned messages

proud stump
obtuse plaza
half barn

is slashCommandBuilder not integrated into djs 14?

copper jetty

no

outer bane

it is re-exported though

copper jetty

ok i dikdnt know sorry

outer bane

no worries, everything from builders is being re-exported nowadays

marble blade

Why are these methods removed?

How do I get the name SubCommand?

copper jetty
forest elm

eg

plain roverBOT
half barn

Any clue why this is happening? Pretty sure I'm setting the name?

marble blade

Why did they leave only getUser and getMember? How do you get a Subcommand?

forest elm
copper jetty
half barn
copper jetty

you would have to check if its ChatInputCommand

forest elm

it has to be an array of objects, { name: 'Name', value: 'name' }

marble blade
forest elm

who else knows

what

forest elm
marble blade

what is this

forest elm

read my message

its a function that narrows the type of the interaction

copper jetty

if (!<Interaction>.isChatInputCommand()) return

do this

forest elm

marble blade

I need subcommand

copper jetty

you can only get subcommand from chatinputcommand

you cant from contextmenucommands

because you cant add any options to contextmenus

marble blade

hm

okay...

thanks)

cookieCat

copper jetty

donutCat

undone yew

how to fix?

copper jetty

what is action

undone yew

const action = new Menu()

copper jetty

Menu isn't discord.js constructor unless you renamed it

undone yew
half barn
undone yew

this is official discord.js constructor

idle galleon

You need to put the menu in a Row

And provide the row when calling uodate

undone yew
brazen knoll

can i find out if a user has their DMs closed before doing a post request

copper jetty

NO

brazen knoll

OH OKAY :(

vague coyote

No, only way to check is to catch the error from .send

brazen knoll

it'd be nice of discord to add something to the user object where you can figure that out

would also lessen ratelimit possibilities

marble blade

How can I remove the APIInteractionDataResolvedChannel type?

hoary fox

typeguard

marble blade

I don't understand why it's needed at all.

undone yew

how to fix?

hoary fox

or 0 number - guildTextChannel

rain bramble
undone yew
hoary fox
rain bramble
half barn

Kind of confused as to why I'm getting this error

hoary fox
idle galleon

It’s missing a string name, and a string value property

plain roverBOT

property Guild#commands
A manager of the application commands belonging to this guild

half barn
forest elm

are you on the latest versions? because it used to take an array, and then rest parameters, and now an array again

idle galleon

Try spreading the Array

The current main branch takes rest parameters for addChoices

forest elm

oh yeah what peepoThink

copper jetty
velvet jasper
marble blade

How to use descriptionLocalizations correctly? I tried to set the Ukrainian text, but the description is still in English. How does it work?

half barn

how do you set rest parameters for addChoices then? never heard of that

tame gazelle

.addChoices({ name, value }, { name, value })

copper jetty
lost berry

wha

half barn
vague coyote
half barn

apparently it only takes rest parameters but I just get an error if I put in 2 objects like that with no array

forest elm

are you using the latest version of builders? aka 0.14.0-dev.1650931748-df64d3e

because it takes rest parameters

half barn

I'm on 14.0.0-dev.1650931749-df64d3e

ngl I have no clue what rest parameters are but I put it in like that with no array and it just gives me an error. MDN docs didn't make much sense to me

vague coyote

again, it should take an array

vague coyote
marble blade

okay)

thanks)

half barn
idle galleon

It should take an array, but it doesn't

It’ll likely be changed in the future

void abyss
 "rawError": {
        "message": "405: Method Not Allowed",
        "code": 0
      },
      "code": 0,
      "status": 405,
      "method": "put",
      "url": "https://discord.com/api/v10/applications/962304955971174440/guilds/626102413857652746/commands/permissions",
      "requestBody": {
        "json": [
          {
            "id": "965298369247453294",
            "permissions": [
              {
                "id": "658779239117750285",
                "type": 1,
                "permission": true
              }
            ]
          },
          {                                                                                                                                                                                
            "id": "964957793205514300",
            "permissions": [
              {
                "id": "658779239117750285",
                "type": 1,
                "permission": true
              }
            ]
          }
        ]
      }
    }
const fullPermissions = [
        // Ping - pong?
        {
            id: '965298369247453294',
            permissions: [{
                id: process.env.ADMIN_ROLE_ID!,
                type: 1,
                permission: true,
            }],
        },
        // Mod Suggestions
        {
            id: '964957793205514300',
            permissions: [{
                id: process.env.MODERATOR_ROLE_ID!,
                type: 1,
                permission: true,
            }],
        }
    ];


    if (!client.application?.owner) await client.application?.fetch();
    await client.guilds.cache.get(guildId)?.commands.permissions.set({fullPermissions});
idle galleon
dull mango
DiscordAPIError: Bots cannot use this endpoint

when setting command perms

idle galleon

Same issue

void abyss
copper jetty

you can't set permissions...

idle galleon

Discord trying to roll out slash cmd perms v2

knotty plover

The whole point of permissions V2 is that you don't need to set permissions

dull mango

how to fix it?>

knotty plover

The admins of the server do

copper jetty

maybe add this to faq because many people will try this

knotty plover

Using a UI

dull mango

UI?

idle galleon

User Interface

vague coyote
dull mango
idle galleon

Only a 30 min warning? blobsweats

idle galleon

Did Discord give an earlier warning?

vague coyote

not that I know

but does that matter smirkel

copper jetty

no

idle galleon

Right, totally won’t affect bots that currently use it

dull mango
copper jetty

yes

dull mango

ok

void abyss

Okay but can i set default perm for command?

dull mango
idle galleon

Nope

It’s a present for everyone

copper jetty
dull mango ok

unless your bot is in guilds that dont have permissions v2 yet

knotty plover

Which they're rolling out to all of them now

void abyss
dull mango

how much time till the set method will be removed from djs docs?

curious

copper jetty

it will be removed in v14 probably

void abyss

There will be way to set perms from API soon?

restive bear

Question, is addComponent array or not? Some say its a rest param?

idle galleon

Prob when Discord removes it from their docs

dull mango
vague coyote

addComponents should definitely already take array

idle galleon
dull mango

or add a deprication tag

idle galleon

Bots can’t just not use it

copper jetty
restive bear

Alr 👌

dull mango
vague coyote

thats automatic

idle galleon

Discord has to process all of the guilds

dull mango

where to look on the guild to set the perms?

idle galleon

Discord heavily relies on the eventual consistency model

knotty plover

See blog post

It has instructions

copper jetty

or something like that

dull mango
half barn

ur looking at it

copper jetty

In Bots and Apps section

vague coyote

read, do

dull mango
vague coyote

then its not on that guild yet

dull mango

my client is getting the error and also doesnt see the commands tab on his server

vague coyote

again, they are rolling out perms v2, you will have to wait

dull mango

do i shut down the bot till it appears?

vague coyote

you do what you wanna do

restive bear

Does anyone see anything that is been changed? Cause I get a component.toJson error whenever I try to run this cmd

urban belfry

and make sure all the packages are up to date

restive bear

I mean i'm using the absolutely newest v14 version, could it be something with the package itself?

copper jetty
restive bear

I don't, more or less getting the same error for every button I click

urban belfry

either way try updating builders to dev and djs to dev

marble blade

How can I send components?

copper jetty

addComponents takes an array

marble blade
hoary fox
marble blade
restive bear
restive bear

Alr well updating builder & rest package doesn't work, I assume its just a bug in the latest dev version

forest elm
outer bane
restive bear

Well it was just a button I clicked randomly, none of my buttons work but sure i'll show it

outer bane

cannot reproduce the error with latest dev, is your builders package up to date? if you have it installed manually remove it, d.js exports re-everything from it

copper jetty
restive bear

Lemme see

Highlighted one is

knotty plover

That intent still exists

There's also MessageContent to access content

copper jetty

Guilds

not GUILDS

Its the same they just made it PascalCase

GuildMessages

copper jetty

don't do this it will slow down your bot

pallid ice

you can't use SCREAMING_SNAKE_CASE for things like styles anymore in v14 dev

see the changes/guide in pins

knotty plover

Create a new InteractionCollector

No

plain roverBOT

class 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...)

knotty plover

Modals arent message components

rapid lintel

On the subject of modals, it is not impossible to modify the OG interaction once the modal has been shown, correct?

plain roverBOT
rapid lintel

Whenever I try to make edits to the original ephemeral interaction after a modal is shown, it tells me the interaction has already been acknowledged.

Hm

Let me give it the ole try

knotty plover

Or just interaction.editReply on the original

rapid lintel

^ Now that I know fails

knotty plover

Why?

Already acknowledged means you're using the default reply again

editReply would work for up to 15 minutes

rapid lintel

I really couldn't tell you why, but if I showModal() and then follow it up with editReply, then it fails. You're welcome to give it a quick shot on your end if you'd like

Been struggling with this all day

knotty plover

So uhh... what triggers the modal?

rapid lintel

A button in an ephemeral message

knotty plover

So if a Slash Command triggers the modal, theres nothing to edit. Just reply to the modal

A button in a message, you should still be able to use ButtonInteraction.editReply I would have thought

But still, might as well use ModalSubmitInteraction#update to achieve the same thing

rapid lintel

Since I need to do that on the modalSubmit event anyways

plain roverBOT

Suggestion for @scarlet tangle:
guide Popular Topics: Interaction collectors
read more

knotty plover

No?

Maybe Discord is just being fucky with ephems then

rapid lintel

No it worked perfectly.

knotty plover

oh good lol

rapid lintel

I didn't think to do an update on the ModalSubmit interaction because I figured you can't update a Modal

I mean the verbiage Discord's API uses is weird. You're not updating the Modal, and a ModalSubmit stems from a modal interaction. Maybe I am just an idiot, but the wording is a bit strange.

A .reply() on a Modal makes sense to me, though.

knotty plover

all good yeah

Thats why we try to make it a bit clearer

rapid lintel

Thank you

quick musk

is there a bug on Guildmeber.displayAvatarURL in current dev version?

my code is iconLink: guild.members.cache.get(userid).displayAvatarURL({ format: 'png', dynamic: true, size: 2048 }), but it only return .webp url

white nebula

format was replaced with extension, and the dynamic option was removed

quick musk

oh thx

proven wolf

Hello,
I followed the instructions I found on https://discord.com/blog/slash-commands-permissions-discord-apps-bots but despite that I can't modify the permissions of my commands: when I click on "manage" on my bot line in my server's integrations list I don't have the part that allows me to allow or deny permissions for commands.
If it helps it's a certified bot on a partner server

white nebula
proven wolf
scarlet tangle

will djs14 use the permissions v2 system? and how will that work with updating the permissions since now bearer token from oauth2 is required?

spare fiber
knotty plover

Its unclear if we will or wont support the oauth endpoints but its would be up to you to get oauth bearer tokens to use with them if thats the case

scarlet tangle

but for developer commands, you want to set permissions programatically and restrict it only to few selected users

knotty plover

What do you mean by "developer commands"

scarlet tangle
knotty plover

eval is a terrible command to have

scarlet tangle

Yep

knotty plover

But if you do have one

It probably shouldnt be global at all

Restrict default_member_permisisons

And then go into your server and add an override for yourself

pallid ice
scarlet tangle
knotty plover

Well those commands will be available to every admin/server owner

For guilds they're deployed to

exotic adder

will there be new commits?

on Dev branch

knotty plover

At some point in the future yes, a new commit will be on the dev branch

copper jetty

There are new commits every day

small mica

So as the new addFields() takes arrays, can I have multiple addFields() or just multiple objects in a single array?

knotty plover

both

small mica

okay

marble blade

How can I extend the class CommandInteraction<"cached">?

forest elm

whats the point of doing that, discord.js will not use your extended class

warm basin

Is localisation already in v14 ? 0.o

forest elm

yes

warm basin

nice

tame gazelle

how does SlashCommandSubcommandBuilder#setDescriptionLocalizations() work?

plain roverBOT
tame gazelle

I didn't for ask that

knotty plover

What do you mean by "how does it work" then?

tame gazelle

when I change my discord language to french it still show me the text in english

knotty plover

Client-side, theyre still locked behind the experiment

tame gazelle
knotty plover

Whatever the docs say, I dont use builders

But thats probably why its not working

The experiment

slow storm
tame gazelle

it's only for discord website no?

not the application

tame gazelle

web-slash-command-loc... ?

it means what I said?

forest elm

try it and see

tame gazelle

I tried and what I did still doesn't work ._.

warm basin

Why do i get an Message out of Fetch ? after i updated ? Shouldn't i get an Collection of Messages ? Am i missing something ?

forest elm
tame gazelle

rip

knotty plover

Which is why it says +1 overload

haughty lava

what is wrong with this now?

copper jetty

message is null

haughty lava

it's not

warm basin
copper jetty

Because it says it is

small mica
warm basin

Okay, i just restarted VS Code and that did the trick

exotic wind
const { GatewayIntentBits } = require('discord.js');
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages],

bot not responding to commands

nocturne kayak

are you still using text command? you gotta need MessageContent intent as well

exotic wind

I write a bot for both text commands and slashes

const { GatewayIntentBits } = require('discord.js');
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent],
```?
nocturne kayak

i said 'as well'

yep

exotic wind

ths

TypeError: Found non-callable @@iterator
copper jetty

you passed rest parameters where you should pass an array

exotic wind
await command.execute([client, message, args]);
```?
copper jetty

this code has nothing to do with discord.js

elder sluice

Hello Admin & Mods!

Today, we have a new update for slash commands in your servers: Permissions! If you don’t know, slash commands are a new, easier way to use bots on Discord. You might already have some to use—type / to find out!

With this new system, you can:
dotControl who can use slash commands in your servers
dotControl in which channels commands can be used
dotSync or unsync commands like channels and categories, making mass management and special cases easy to handle

You can find these permissions in Server Settings → Integrations → Pick an app! If the app supports slash commands, you’ll see the UI.

warning If a bot you use has integrated slash commands, the old way of denying the bot Read Messages will not work to moderate commands usage. You’ll need to use this new system to control access.

Not sure if your bots support slash commands? Check out in Server Settings → Integrations, or just type /!

Check out our blog post to learn more and see a detailed walkthrough: https://discord.com/blog/slash-commands-permissions-discord-apps-bots

Does djs support it?

copper jetty
elder sluice
copper jetty

in dev v14

velvet jasper

We don’t support it yet

tame gazelle

^

copper jetty

how

you can set default permissions

tame gazelle
velvet jasper

The pr for perms v2 isn’t merged

cinder bane
rawError: { message: 'Bots cannot use this endpoint', code: 20001 },
copper jetty

its disabled

cinder bane

do you know any alternative

copper jetty

yes you go to server settings and integrations and choose your bot and edit permissions

cinder bane

cant the bot set the permissions anymore?

in v2

copper jetty

no

tame gazelle

only server admins

or members who have the ManageGuild permission dunno

cinder bane

the bot has admin perms

tame gazelle

bots can't set permissions

cinder bane

ohkay

I wonder why would they remove the ability of the bots to add or remove permissions

keen bobcat

That's not a discussion for here

cobalt swallow

Ok so bots can't set slash commands permissions now, but what happens if we want to clear them? Like for example I have some commands that I allow me to have explicit access to them and I can't seem to clear that extra permissions. The integrations panel says I cannot manage this user.

cobalt swallow

Well those explicit permissions where set through d.js so how is it unrelated?

nocturne kayak

djs doesnt manage those perms

scarlet tangle

are you removing those with djs?

cinder bane
copper jetty
exotic wind
copper jetty you passed rest parameters where you should pass an array
let menuOptions = [];
commandDir.forEach(folder => {
    menuOptions.push({ name: `${folder}`, value: `**\`${client.commands.filter(x => x.folder === folder).map(x => x.name).join('`**, **`')}\`**`});
});
embed
    .setTitle(`${lang.titleNoArgs.replace('%bot%', client.user.username)}`)
    .setDescription(`${lang.descriptionNoArgs.replace('%prefix%', guildData.prefix)}`)
    .setColor(cfg.colors.good)
    .addFields(menuOptions);
exotic wind

menuOptions.push

copper jetty

then idk

cobalt swallow
scarlet tangle are you removing those with djs?

I have tried putting an empty permissions array through the endpoint which as expected gives out a "Bots cannot use this endpoint"

I am only asking for a way to clear those extra permissions. Through discord it can't be done, the API is now updated, how can I achieve that?

Edit: nvm figured it out

exotic wind
let menu = []
commandDir.forEach(x => {
    menu.push({ label: x, value: x });
});
const row = new BeQuite.ActionRow().addComponents(
    new BeQuite.SelectMenu()
        .setCustomId('help_menu')
        .setPlaceholder(`${lang.selectCategory}`)
        .addOptions(menu)
);

here are 2 pieces of code in which i use arrays

copper jetty

addComponents needs array

exotic wind

but i dont know where is the mistake

oh, ok

ths

everything is working now

scarlet tangle
cinder bane
undone yew

How to fix? This channel id is correct

tame gazelle
tame gazelle
undone yew
tame gazelle

log channel

undone yew

?

scarlet tangle

console.log(channel)

undone yew

null

tame geyser

Just use a webhook

undone yew

its worked

undone yew

how to edit channel permissions?

on an existing channel

tame gazelle

channel.permissionOverwrites.edit(...)

undone yew
plain roverBOT

Documentation suggestion for @undone yew:
method PermissionOverwriteManager#edit()
Edits permission overwrites for a user or role in this channel, or creates an entry if not already present.

undone yew

thx

how to edit channel topic?

?

scarlet tangle
                                   ^

TypeError: Cannot read properties of null (reading 'roles')
    at Client.<anonymous> (/root/Generaly/app.js:1026:36)
    at Client.emit (node:events:539:35)
    at MessageCreateAction.handle (/root/Generaly/node_modules/discord.js/src/client/actions/MessageCreate.js:26:14)
    at Object.module.exports [as MESSAGE_CREATE] (/root/Generaly/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/root/Generaly/node_modules/discord.js/src/client/websocket/WebSocketManager.js:351:31)
    at WebSocketShard.onPacket (/root/Generaly/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/root/Generaly/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/root/Generaly/node_modules/ws/lib/event-target.js:199:18)
    at WebSocket.emit (node:events:527:28)
    at Receiver.receiverOnMessage (/root/Generaly/node_modules/ws/lib/websocket.js:1137:20)
    at Receiver.emit (node:events:527:28)
    at Receiver.dataMessage (/root/Generaly/node_modules/ws/lib/receiver.js:528:14)
    at Receiver.getData (/root/Generaly/node_modules/ws/lib/receiver.js:446:17)
    at Receiver.startLoop (/root/Generaly/node_modules/ws/lib/receiver.js:148:22)
    at Receiver._write (/root/Generaly/node_modules/ws/lib/receiver.js:83:10)```
what can couse this error is used to require a specific role to run a command only some times not all time if giving this eror
outer bane

a message without a member. DM, webhook or system message

scarlet tangle
undone yew
outer bane
plain roverBOT
undone yew

how to fix?

tame gazelle
undone yew

ok

chilly zephyr

When showing a modal, does it automatically defer the interaction?

Ah right right. I got confused with slash commands, thank you

cinder bane
// Code
const userEmbedOptions = [{...}, {...}, {...}];
new ActionRowBuilder()
    .addComponents(
        new SelectMenuBuilder()
            .setCustomId('ViewUser')
            .setMaxValues(1)
            .addOptions(...userEmbedOptions)
    );
// Error
TypeError: options.map is not a function
    at SelectMenuBuilder.addOptions

what's wrong with my code?

hoary fox

in addOptions u must put array

cinder bane

since it says options.map is not a function i tried to remove the spread operator but it too resulted in an error

hoary fox
cinder bane

so

.addComponents([new SelectMenuBuilder()])

like this?

hoary fox

yea

half barn

Any clue why this aint working?

vague coyote

put the textinput in an actionrow

and the actionrow in the modal

half barn

ty

cinder bane

still having problem with this, I checked the docs as well and it seems that addOptions and setOptions now take an array instead of objects

// Code
const userEmbedOptions = [
    new SelectMenuOptionBuilder()
        .setLabel('Overview')
        .setValue('overview')
        .setDefault(true),
    new SelectMenuOptionBuilder()
        .setLabel('Roles')
        .setValue('roles'),
    new SelectMenuOptionBuilder()
        .setLabel('Avatar')
        .setValue('avatar')
];

let x = new ActionRowBuilder()
    .addComponents(
        new SelectMenuBuilder()
            .setCustomId('ViewUser')
            .setMaxValues(1)
            .setOptions(userEmbedOptions)
    );

what am I doing wrong here?

tame gazelle

addComponents takes an array

cinder bane

but im getting the same error even after giving an array in .addComponents

let userEmbedComponents = new ActionRowBuilder()
    .addComponents([
        new SelectMenuBuilder()
            .setCustomId('ViewUser')
            .setMaxValues(1)
            .setOptions(userEmbedOptions)
    ]);

im getting the exact same error from .setOptions() line

im stuck with this for 2 hours now

this didnt have in the earlier versions of v14

i updated to the latest v14 version today

copper jetty
cinder bane

..

can someone please help me this is really frustrating

forest elm

edit the message manually

plain roverBOT
forest elm

showModal() is a reply to the interaction

no, show the modal and then edit the message manually
interaction.message.edit()

cinder bane
// Code
const userEmbedOptions = [
    {
        label: 'Overview',
        value: 'overview',
        default: true
    },
    {
        label: 'Roles',
        value: 'roles'
    },
    {
        label: 'Avatar',
        value: 'avatar'
    }
];

let userEmbedComponents = new ActionRowBuilder()
    .addComponents([
        new SelectMenuBuilder()
            .setCustomId('ViewUser')
            .setMaxValues(1)
            .addOptions(userEmbedOptions)
    ]);

updated the code a bit

forest elm

are you on the latest version?

that error message makes it seem like addOptions is expecting rest parameters

(and the latest version doesnt, it takes an array)

forest elm
uncut kelp
forest elm

GuildDefaultMessageNotifications.OnlyMentions

and you'd have to import that from discord-api-types as its not exported in djs

uncut kelp

Ah thank you, that (:

uncut kelp
forest elm

yeah idk why some of the enums that have an EnumResolver aren't reexported

unreal blaze

How can I use messageCreate when Im not getting its content?

MessageContent its blocked look like it

forest elm

enable it in the dev portal

plain roverBOT

Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.

If you are using the GUILD_MEMBERS, GUILD_PRESENCES, or MESSAGE_CONTENT intents, you need to enable them in the developer portal:
Developer Portal > Your app > Bot > Privileged Gateway Intents

unreal blaze

Ahh, there is something new

Thank you

scarlet tangle
scarlet tangle

err:

plain roverBOT

• Websocket intents limit events and decrease memory usage: learn more
• See what intents you need here

idle galleon

emoji name is invalid

scarlet tangle

what would the name be
?

idle galleon

The error just said it’s on name

Are you sure that’s the only button?

scarlet tangle

yes

tame gazelle
jagged marsh

in my threadCreate event, client returns true (the readyState, even though I'm not using that...), in the exact same usage in other events that work perfectly. it functions fine on v13. any reason why this might be?

cinder bane

well not latest but the commit where these changes were made

cinder bane

Ill just open an issue then, since both rest parameters and array returns an error

knotty plover

where are the errors

nvm I see

knotty plover
knotty plover
knotty plover

Yeah, cant replicate that issue

cinder bane

i just ran the same thing again and I got this

I didnt make a single change in the code either

its the same one that i posted above

knotty plover

Can you show me the full output of npm why @discordjs/builders

cinder bane

okay 1min

knotty plover

I get this

@discordjs/builders@0.14.0-dev.1650672503-3617093
node_modules/@discordjs/builders
  @discordjs/builders@"^0.14.0-dev" from discord.js@14.0.0-dev.1651147765-679dcda
  node_modules/discord.js
    discord.js@"^14.0.0-dev.1651147765-679dcda" from the root project
cinder bane
knotty plover

Its almost like it thinks theres a nested array?

cinder bane
@discordjs/builders@0.14.0-dev.1650240529-9ef7ffd
node_modules/@discordjs/builders
  @discordjs/builders@"^0.14.0-dev" from discord.js@14.0.0-dev.1651147765-679dcda
  node_modules/discord.js
    discord.js@"^14.0.0-dev.1651147765-679dcda" from the root project
knotty plover

hmm so you have a different builders dev version

I wonder why

cinder bane

do i need to update them separately? I have just done npm i discord.js@dev

knotty plover

You shouldnt

Uninstall discord.js fully first, then run npm why @discordjs/builders and make sure it errors

Then reinstall

cinder bane

okay

it wont error

oh, nvm

removed @\dev

knotty plover

hmm its still installed from somewhere

oh did you fix it?

cinder bane

i tried to uninstall discord.js instead of discord.js@\dev and it got removed

knotty plover

okay cool

Just reinstall now then

cinder bane

its done now

knotty plover

that looks better, the builders tag matches the discord.js tag

cinder bane

let me try the code once

yup works

thanks @knotty plover

knotty plover

cool, no idea how they got out of sync

cinder bane

i dont either, I just remember that I had updated my dev version and thats it, the errors started coming up after i updated the version

cinder bane

receiving this error from one the fields but I cant figure out which

// Code
.addFields(
    { name: 'Sent By', value: `${target}`, inline: true },
    { name: 'Sent On', value: `<t:${Math.floor(message.createdTimestamp / 1000)}>`, inline: true },
    { name: 'Deleted By', value: `${executor}`, inline: true },
    { name: 'Message Id', value: message.id, inline: true },
    { name: 'Author Id', value: target.id, inline: true },
    { name: 'Executor User Id', value: executor.id, inline: true }
);
knotty plover

takes an array now

cinder bane

oh right

my bad

scarlet tangle

in the v13 to v14 switch guide that the functions have been renamed but isVoice()/isText() still exists and aren't even deprecated?

knotty plover

Yeah they got added back

What isText() used to do, is now isTextBased()

isText() now specifically checks the GUILD_TEXT type of channel

scarlet tangle

but what's the difference between isText() and isTextBased()?

knotty plover

TextChannel, DMChannel, probably ThreadChannel are all text based

NewsChannel

scarlet tangle

ohh

ty

cinder bane
knotty plover

nope

cinder bane

then, how do we find which message was pinned or unpinned in channelPinsUpdate event?

this is a separate question

im trying to fetch pinned and unpinned events from audit logs

but since I dont know which event has triggered, unpinned or pinned i cant fetch the exact data from audit logs

const { executor, target, extra } = (await channel.guild.fetchAuditLogs({ type: AuditLogEvent.MessagePin })).entries.first();
const message = (await channel.messages.fetchPinned()).find(({ id }) => id === extra.messageId);
console.log(message);

this will return the message data if the message was pinned but will return undefined if it was unpinned since im searching for MessagePin Events and not MessageUnpin

scarlet tangle

fetch 2 times, first for pin and again for unpin, it isn't possible to fetch both at the same time as the api also takes an integer for the action_type..

cinder bane

any way to get the message that was pinned or unpinned from the channels? that way I could fetch the AuditLogs after wards and decide if type should be MessagePin or MessageUnpinned depending on the value of pinned property

jagged marsh
uncut kelp
jagged marsh
uncut kelp Can you show how you are using it

I'll just paste it here as it is small:

const { ThreadChannel, Client } = require('discord.js');
const { logEmbed, getChannelInfo } = require('../../util/functions');

module.exports = {
    name: 'threadCreate',
    /**
     * @param {ThreadChannel} thread
     * @param {Client} client
     */
    async execute(thread, client) {
        logEmbed({ client, guild: thread.guild.id, channel: thread.parent, description: `A new thread, ${thread.toString()}, was created:\n\n${getChannelInfo(thread).join('\n')}`, title: `Thread Created`, color: 'Green', isEvent: true });
    },
};
function logEmbed(input) {
    const { client, guild, channel, description, title, color, thumbnail, attachment } = input;

...
    client.channels.cache.get(targetChannel).send(attachment ? { embeds, files: [attachment] } : { embeds });

I can't see any issue with this at all, and nothing has changed since I migrated from v13

uncut kelp

The second parameter isn't the client

jagged marsh

I pass it through to each event from my events handler

client.once(event.name, (...args) => event.execute(...args, client));
uncut kelp

In that case, the third parameter is your client

You are not using it

jagged marsh

ah well that explains it– I didn't know that was updated–

uncut kelp

This worked for you on version 13 because this did not exist in version 13

jagged marsh

thank you so much!!

uncut kelp

You're welcome

jagged marsh

do you know if there were similar changes to any other events? (I'll look through anyway)

uncut kelp

You can also access the client via thread.client, you know that right? Just curious why you're passing it

uncut kelp
jagged marsh
jagged marsh
uncut kelp

[:

plain roverBOT

Tag suggestion for @scarlet tangle:
Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.

If you are using the GUILD_MEMBERS, GUILD_PRESENCES, or MESSAGE_CONTENT intents, you need to enable them in the developer portal:
Developer Portal > Your app > Bot > Privileged Gateway Intents

wary holly

I want to change the permissions of the bot when joining the server, not the role, nor the permissions of the channel.
what should I do?

wary holly
tame gazelle
urban belfry

If a bot could change it's permission right after joining meguFace

What are you talking about specifically

wary holly
tame gazelle
wary holly

If there are multiple roles after the bot is added, how do I know which one I should edit?
(Some bots will add roles for newly joined members.)

tame gazelle

execpt for the server owner

wary holly

OK.

how do I know which one I should edit?

tame gazelle

you can find a role by the bot name and check it it’s managed

but two bots can have the same so it isn’t reliable

tame estuary

a bit of topic but do you need to cache mysql data for a pokemon bot
data must be accessed and changed quickly

forest elm

there's also <Guild>.roles.botRoleFor(<User>)

scarlet tangle

how do i use status in v14
?

jaunty vault
scarlet tangle

?

hoary fox
scarlet tangle

ok

urban belfry

32767 doesn't mean all the intents anymore dogeHaHa
nor should you be using all of them

urban belfry

well no you should use the ActivityType enum instead

magic numbers are not recommended

hoary fox
urban belfry

it's easy to explain
instead of it being in all caps, the property is just in PascalCase, ActivityType.Streaming for example

scarlet tangle

Why content property is empty in messageDelete event?My bot is unverified btw.

mint latch

so I have this: ```js
const row1 = new ActionRowBuilder({components:[
new ButtonComponent(new ButtonBuilder().setLabel('1').setCustomId('00').setStyle("Primary").toJSON()),
new ButtonComponent(new ButtonBuilder().setLabel('2').setCustomId('01').setStyle("Primary").toJSON()),
new ButtonComponent(new ButtonBuilder().setLabel('3').setCustomId('02').setStyle("Primary").toJSON()),
]}).toJSON()

and I keep getting this error, anyone know why?

it's coming from the .toJSON, and I have no idea why because I already have a label

urban belfry

why do you create a new ButtonComponent?

you can just pass the ButtonBuilder on addComponents

mint latch

oh alr

is that the problem

copper jetty

yes

mint latch

alr thanks

scarlet tangle
urban belfry
copper jetty

i think if the message isnt cached it shouldnt fire the messageDelete event

scarlet tangle

is there a way to know if the User dms are open or closed?

jaunty vault
scarlet tangle
scarlet tangle
pallid ice

if it was cache or intent related then content would be null

copper jetty

its empty string if you dont have message content intent

tame gazelle
pallid ice
scarlet tangle
copper jetty

it doesn't look like discord.js to me

narrow lagoon

i choose current for node 16.9?

pallid ice

LTS is fine

proven wolf
narrow lagoon

okey starting my journey with v14 today

proven wolf

But all bots need intents

narrow lagoon

will i have to unistall earlier version of node i had?

or it auto remove older version

lunar robin

@narrow lagoon you can just use n
npm cache clean -f
npm install -g n
sudo n stable

actually idk what os u r using but thats what i use on ubuntu

narrow lagoon

i use windows

lunar robin

yeah then just use the binary on the website

i dont think its necessary to uninstall old node

narrow lagoon
const client = new Client({ intents: 32767 });```
does that still work?
copper jetty

yes

narrow lagoon

thanks

stuck fiber

is there a method to check if an interaction is chatinput or user/msg contextmenu only? ( application command )

plain roverBOT
stuck fiber

literal poggers

thanks

zenith terrace

Is there any date on when model interactions will be available in the stable version of DJS? I’m sorry if this is a question you get asked regularly

copper jetty

no

plain roverBOT
stuck fiber

ty, but i needed chatinput | ctxmenumsg | ctxmenuuser

velvet jasper

Oh you wanted both ok

vague coyote

thats why I linked isCommand() kekw

tame gazelle

@slender hull

copper jetty
tame gazelle
grim hawk

do command translation gonna be in the v14 ?

copper jetty

Yes

grim hawk

nice

The v will be released when ? (if there is a date)

copper jetty

no date

grim hawk

ty

cyan jewel

With perms v2 in effect, can I still deploy a bot in the next week or so that uses v14? Do I just forgo setting defaults, deploy it, then configure it on my server with the UI?

It's not a public bot so I don't have to worry about that. It's bespoke for just my server.

dawn phoenix

sure, you can't deploy "traditional" slash perms for users and roles anymore, that's it

cyan jewel

OK great, that's what I figured. Then I can just remove perm updating from my framework for now.

dawn phoenix

there will be default member and dm permissions, which are not currently supported by builders, so you'd need to switch to raw payloads for your command deploying, if you need that

cyan jewel

Oh! I already use raw payloads in my framework. I guess I can use the new default perms then.

dawn phoenix

sure, those are bitfields for required perms
side note: the UI is very broken and displays allow on everyone, regardless

cyan jewel

I saw those mentioned in #769862166131245066 but wasn't sure if that was a raw thing or a d.js thing.

cyan jewel

That'll be fun.

Doesn't seem like there's a choice since the new perms are fully released and the endpoint for setting perms is gone.

I saw a follow-up post on api-docs regarding the perms rollout. I guess that bug is probably one of the reasons.

Thanks for your help. Seems like I'll be good to go since I'm not using builders for my commands.

And thanks for the tip re: the broken UI, heh.

opal cloak

help please

copper jetty
opal cloak

do you need my code?

copper jetty

Undefined doesnt mean not defined, undefined means its defined but it has no value

scarlet tangle
scarlet tangle
dusky agate

why it says the option is invalid?

onyx cove
opal cloak

ApplicationCommandOptionType.SubCommand I got an error using that

tame gazelle

better to send the error instead of having that you have one

scarlet tangle
opal cloak
vocal wadi

Does .addField have any changes

It is showing an error for me

small mica

Yeah it takes arrays now, also .addFields()

slow storm
winged hull

Hello. Recently I read that there can be only one text option inside an action row for models. But how many action rows can there be in a model?

unreal blaze

Hi, anyone knows why that user tag on left side is not working as should? Its working sometimes but then its changed for its uuid form

latest dev version

nocturne kayak

your discord client didnt cache that user
nothing to do with djs

winged hull
unreal blaze
dawn phoenix

if you actually mention them in message content (not the embed) the message payload includes the member data so the client can resolve it
that's the only way to ensure it - and i doubt you'd want to actually mention the person for this use case
(unless the feature is placed in a locked channel that people generally can't read anyways (think modmail, for example))

flat tulip

Error: TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.

Code:

const category_name = interaction.options.get('category_name').value;
const category = await interaction.guild.channels.create(`${category_name}`, {
   type: 4,
   permissionOverwrites: [
                    {
                        id: interaction.guild.id,
                        deny: ['ViewChannel'],
                    },
                    {
                        id: 'my role id here',
                        allow: ['ViewChannel', 'SendMessages', 'ReadMessageHistory', 'EmbedLinks', 'AttachFiles', 'AddReaction'],
                    }
                ]
});

pls help

mint latch

did the GUILDS intent change for v14?

tame gazelle

Guilds

mint latch

is it not all caps anymore

nocturne kayak

SCREAMING_SNAKE_CASE => PascalCase

fierce hatch

so i have a messageCreate event: js bot.on('messageCreate', (message)=>{ console.log(message) }) for some reason it's not logging anything, intents: { intents: ['Guilds','MessageContent'] } i also have the intents on the dev portal enabled

silk topaz
fierce hatch

yea

silk topaz

still those are not valid, you should use the enums provided by the library

fierce hatch

when i did Intents.FLAGS.GUILDS it raised TypeError: Cannot read properties of undefined (reading 'FLAGS')

fierce hatch

i see, let me try

tame gazelle
tame gazelle

new Client({ intents: ['Guilds', 'GuildMessages', 'MessageContent' })

fierce hatch

let me try that too then

silk topaz

that looks so weird when you are used to all caps

tame gazelle
Error: Received one or more errors
    at UnionValidator.handle (/root/ObitoInteractions/node_modules/@sapphire/shapeshift/dist/index.js:1467:23)
    at UnionValidator.parse (/root/ObitoInteractions/node_modules/@sapphire/shapeshift/dist/index.js:110:88)
    at EmbedBuilder.setDescription (/root/ObitoInteractions/node_modules/@discordjs/builders/dist/index.js:261:54)
    at Object.execute (/root/ObitoInteractions/commands/utility/emoji.js:70:6)
    at Object.execute (/root/ObitoInteractions/events/interactionCreate.js:56:31)
    at Client.<anonymous> (/root/ObitoInteractions/Structure/Client.js:59:37)
    at Client.emit (node:events:526:28)
    at InteractionCreateAction.handle (/root/ObitoInteractions/node_modules/discord.js/src/client/actions/InteractionCreate.js:81:12)
    at Object.module.exports [as INTERACTION_CREATE] (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
    at WebSocketManager.handlePacket (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)

is the description empty?

nocturne kayak

empty string description, it seems

tame gazelle

yeah that was it

mint latch

what does this mean

tame gazelle

import it from discord.js

mint latch
tame gazelle

ah I thought it was a context menu command

mint latch

ah alright

scarlet tangle
[Error: ENOENT: no such file or directory, stat '/home/container/4d6f6b6471f1b808cd3dc8d005509ed7'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '/home/container/4d6f6b6471f1b808cd3dc8d005509ed7'
} Promise {
  <rejected> [Error: ENOENT: no such file or directory, stat '/home/container/4d6f6b6471f1b808cd3dc8d005509ed7'] {
    errno: -2,
    code: 'ENOENT',
    syscall: 'stat',
    path: '/home/container/4d6f6b6471f1b808cd3dc8d005509ed7'
  }
}
``` do you know what does this mean it keeps coming when a guild is updated and i try to edit all the properties to the oldGuild parameter and this comes up

why?

await newGuild.edit({
                                    name: oldGuild.name,
                                    icon: oldGuild.icon,
                                    features: oldGuild.features,
                                    description: oldGuild.description,
                                    premiumProgressBarEnabled: oldGuild.premiumProgressBarEnabled,
                                    verificationLevel: oldGuild.verificationLevel,
                                    explicitContentFilter: oldGuild.explicitContentFilter,
                                    afkChannel: oldGuild.afkChannel,
                                    systemChannel: oldGuild.systemChannel,
                                    afkTimeout: oldGuild.afkTimeout,
                                    splash: oldGuild.splash,
                                    discoverySplash: oldGuild.discoverySplash,
                                    banner: oldGuild.banner,
                                    defaultMessageNotifications: oldGuild.defaultMessageNotifications,
                                    systemChannelFlags: oldGuild.systemChannelFlags,
                                    rulesChannel: oldGuild.rulesChannel,
                                    publicUpdatesChannel: oldGuild.publicUpdatesChannel,
                                    preferredLocale: oldGuild.preferredLocale,
                                    reason: "Server Update | Not Whitelisted"
                                })
``` this is the way i am editing the guild
hoary fox
tame gazelle
DiscordAPIError[40005]: Request entity too large
    at SequentialHandler.runRequest (/root/ObitoInteractions/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:708:15)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (/root/ObitoInteractions/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:511:14)
    at async ChatInputCommandInteraction.reply (/root/ObitoInteractions/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:110:5)
    at async Object.execute (/root/ObitoInteractions/commands/utility/avatar.js:39:28)
    at async Object.execute (/root/ObitoInteractions/events/interactionCreate.js:56:17)
    at async Client.<anonymous> (/root/ObitoInteractions/Structure/Client.js:59:25)
hoary fox
tame gazelle
hoary fox
copper jetty