#djs-in-dev-version

1 messages · Page 33 of 1

median jetty
#
const code = new TextInputComponent().customId('code').setLabel('Code').setStyle('PARAGRAPH');
tall verge
#

I recommend you see the documentation

median jetty
tall verge
median jetty
tall verge
#

Are you using the code from v13?

median jetty
#

No

urban belfry
median jetty
#

ok

tall verge
#

TextInputComponent v13

TextInputBuilder 14

crystal valve
#
const member = interaction.user;
if (member.permissions.has([Permissions.FLAGS.ADMINISTRATOR])) {```
`TypeError: Cannot read properties of undefined (reading 'has')`
flat ice
crystal valve
#

ohh

#

hm TypeError: Cannot read properties of undefined (reading 'FLAGS') now

urban belfry
#

check the pinned guide for updating

crystal valve
#

alright

crystal valve
urban belfry
#

what does the guide tell you? idk i don't code

crystal valve
#

oh

#

ah i'm not supposed to use flags when using PermissionsBitField monbreyFacepalm

urban belfry
#

no?

urban belfry
crystal valve
urban belfry
#

FlagsBits, read what you said again

crystal valve
urban belfry
#

PermissionsBitField.Flags is PermissionFlagsBits

crystal valve
#

thank you for reiterating the fact

urban belfry
#

as it is undefined, fancy
you're not really supposed to create your own ActionRow instances, create ActionRowBuilders

undone yew
#

not working...

uncut kelp
#

Read the update guide, specifically enums

undone yew
#

GameType.Watching

#

yes

undone yew
uncut kelp
#

Not a discord.js issue, you just have to wait

#

You're doing that... every 5 seconds? Jeez, why?

undone yew
uncut kelp
#

I view that as API spam

#

Especially since setting presences are blocking in the gateway iirc

undone yew
#

status is loaded, but activity no found

scarlet tangle
#

so i had a question should i use fetch instead of cache since fetch returns the accurate value for what i look forward to but takes a lot of time so either way i wanna know is there any way i can make my fetching faster?

forest mulch
uncut kelp
#

That will have no effect

forest mulch
#

oh

uncut kelp
pine compass
#

is there any updates with the permissions of the slash commands w/ v14, i find it very restrictive to make slash commands permissions be tied to PermissionBits or smth, rather than a role

dawn phoenix
#

that is how discord decided to implement permissions going forward

#

roles can be set by the server staff

#

if you want to change that (server settings) as a bot dev you need oauth2 by someone with that permission (manage guild) to do it in their name

#

as a dev you are limited to default permissions with bits - which staff can change whenever they want

  • anyone with manage guild permission cannot be prevented from using any command anywhere (as long as it is deployed globally or to the specific guild, of course)
median jetty
#
if (interaction.type === InteractionType.Autocomplete) {}

Auto complete don't work

uncut kelp
#

Well, InteractionType.Autocomplete doesn't even exist, so yes, it won't work

forest mulch
urban belfry
uncut kelp
urban belfry
#

the changes in v14

uncut kelp
#

Will change it, thank you

median jetty
uncut kelp
#

That's not my call to make

uncut kelp
#

Use InteractionType.ApplicationCommandAutocomplete

median jetty
dawn phoenix
#

"contributor on the guide"? we take prs, knock yourself out
the v14 guide is however a deploy preview, meaning it is tied to a particular PR
so a comment/suggestion on that is better than opening your own

brave beacon
#

Oh there is lot's of preview Kappa, thanks :D

median jetty
uncut kelp
#

The what now

crystal valve
#

This isn't really v14 stuff, but I'm using v14:

my bot does not ping the role specified

interaction.channel.send({
content: `<@&${pingID}>`
})```
I have also tried putting the role ID directly into the content section; it does not work.

I have the role in the server, and the bot has admin.
median jetty
uncut kelp
crystal valve
#

alr, i'll check

#

yeah monbreyFacepalm

forest mulch
#

wdym by "valid options"

median jetty
#

It is possible that a person can select a string only from these options

cosmic parrot
cosmic parrot
steel haven
south python
#

How do i provide a custom hex color in the embed color?

west fjord
#

not been keeping up with the library for a while so sorry if this is a redundant question, have most of the isWhatver() typeguards been removed from structures?

west fjord
#

ah thanks! just what i needed

#

so this new way doesn't "apply" the typeguards or am i doing something wrong?

uncut kelp
#

The type of int is wrong

#

It should be AnyInteraction

west fjord
#

ohhhh never knew that existed

uncut kelp
#

It's a recent change. Are those types not inferred there already?

west fjord
#

if you mean this event file will always be an autocomplete, no

scarlet tangle
#

Heyy, a quick question, cause ts is showing that isModalSubmit method doesnt exists any more, so what is the other method to check if interaction is a modal?

#

// docs too

uncut kelp
#

Check the type of interaction

obtuse crater
#

Look above

dark minnow
#

Defer can be used with showModal?

outer bane
#

no

#

both are initial replies to an interaction

kindred moss
#

do you have to write your own type guard functions for TS now that they've been removed from DJS? checking the type property doesn't narrow down the actual type.

idle galleon
#

Type for what?

kindred moss
#

channels and interactions

marble barn
#

change Interaction to AnyInteraction

idle galleon
#

Likewise, Channel to AnyChannel

#

The former is the base class, the latter is a union, allowing ts to know which type correspond to which subclass

marble barn
#

Which is why I think there is a PR to rename them to Base* right now

kindred moss
#

ah, thanks. what about the remaining functions like isButton()? are they going to be removed too?

idle galleon
#

Yea

kindred moss
#

is ModalBuilder supposed to only work when using its functions instead of the constructor? or is it a bug?

// doesn't work
const modal = new ModalBuilder({
    customId: 'string',
    title: 'string',
    components: [new ActionRowBuilder<TextInputBuilder>({ components: [nameInput] }), new ActionRowBuilder<TextInputBuilder>({ components: [descriptionInput] })],
});

// works
const modal = new ModalBuilder()
    .setCustomId('string')
    .setTitle('string')
    .setComponents([new ActionRowBuilder<TextInputBuilder>({ components: [nameInput] }), new ActionRowBuilder<TextInputBuilder>({ components: [descriptionInput] })]);
#

I'm assuming that the first variant should work, since every other builder class behaves like this.

uncut kelp
#

@velvet jasper maybe? ^

#

Maybe ActionRowModalData is just missing title? Not too sure

knotty plover
#

where is the builder imported from?

kindred moss
#

discord.js

#

this is a type issue btw, the first variant works just fine when ignoring the TS error/forcing transpilation.

jade harness
#

hey I think I came across a bug: https://sourceb.in/r15atGFcs7
14.0.0-dev.1655770161-94f7ca9
My token is valid but for some reason I can't login

const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent] });

client.on('ready', () => {
    console.log(`Logged in as ${client.user.tag}!`);
});

client.on('messageCreate', message => {
    console.log(message);
});

client.login('token');```
uncut kelp
#

Lol

#

Yikes

#

That is indeed a bug

jade harness
#

I'll open an issue I guess

uncut kelp
#

Please do

#

I think I found the problem though

#

const invalidToken = new Error(ErrorCodes.AuthenticationFailed);

#

This line is causing the issue

#

That error code doesn't exist

uncut kelp
#

Opened a pull request to correct the error code, so it's all good for now

jade harness
#

nice

uncut kelp
#

This is all that needs changing, lol
packages/discord.js/src/client/websocket/WebSocketManager.js:133

- const invalidToken = new Error(ErrorCodes.AuthenticationFailed);
+ const invalidToken = new Error(ErrorCodes.TokenInvalid);
jade harness
#

lol

latent lion
#

This error keeps happening when I start the bot.

#

This is where the error line is

uncut kelp
#

It's a bug. Just downgrade

#

Or do the diff above

latent lion
#

Alright, thanks!

#

It works now

plain roverBOT
shy aspen
#

I might be dumb, but isn't this redundant?

idle galleon
#

Keyword is "Based"

#

You can’t check if smth is TextBased, for example, with a single .type check

#

DmChannel, TextChannel, ThreadChannel, and VoiceChannel is TextBased

shy aspen
#

Oh ok, makes a lot more sense

vestal ibex
#

how fix emoji?

dawn phoenix
#

give everyone the permission to use external emojis

vestal ibex
#

no other way?

dawn phoenix
#

nope

vestal ibex
#

Oh.... Okay, thx

dawn phoenix
#

default to a unicode emoji if you don't have the perms, i suppose

#

but at the end of the day app cmd responses are built on webhooks which depend on the at-everyone permission

crystal atlas
#

I updated to the latest dev version and now I'm getting this, any ideas?

dull mulchBOT
crystal atlas
#

So I need to wait for the next update or what? 🤔

forest elm
#

you need to wait for that pr to be merged and then the next release cycle after that

tame gazelle
#

technically this error is causing because of a bad token no?

#

so he can just put a correct token?

forest elm
#

no

tame gazelle
#

ah

forest elm
#

its a bug

crystal atlas
#

How can I go the the last working version?

forest elm
#

14.0.0-dev.1655640259-358c3f4 is probably fine

crystal atlas
#

Hey, that worked, thanks! ❤️

I updated because I was getting this every now and then, is that also connected to that commit?

median jetty
#

MessageAttachment in v14?

tame gazelle
#

AttachmentBuilder

median jetty
#

Thanks

crystal atlas
#

Where can I see a list of dev releases? 🤔

tame gazelle
#

pins

crystal atlas
#

I might be blind, but I don't see that in pins :/

tame gazelle
#

you mean every changes in the dev version right?

crystal atlas
#

A list of releases, like how Almeida knew that 14.0.0-dev.1655640259-358c3f4 is a previous version

uncut kelp
#

The last bit is the commit hash, so if it's not the current one, it's an old one

forest elm
#

and then what jiralite said

crystal atlas
#

Perfect, thank you both! ❤️

uncut kelp
#

I used to get that error but I haven't since it was fixed

forest elm
#

might be because the forward port of that pull request was merged prematurely

uncut kelp
#

That too

slow storm
crystal atlas
#

I had it happen today and yesterday I think, and maybe around a week ago prior to that, never before that though 🤔

uncut kelp
#

I got that error today too during the outage but that's just a one-off

crystal atlas
#

Today around 6:20 UTC if that helps with anything 🤔

uncut kelp
#

There was just an outage, that's expected

#

That screenshot is from before the forwardport happened btw. That line number doesn't go to anywhere relevant

#

So you weren't running on the version it was ever fixed

crystal atlas
#

This might be a bit out of scope, but any idea why the bot did not resume/restart after that error? I'm running it with PM2. This is the full log of when it crashed I think:

crystal atlas
crystal atlas
crystal atlas
#

Hm, but it wasn't running properly 🤔

forest elm
#

a 500 on /gateway/bot, did that happen during the outage?

crystal atlas
#

Possibly 🤔

#

So it restarted but then froze after the 500 🤔

#

Anyway, hopefully the version I'm on right now will prevent those issues 🙂

#

Thank you all!

south python
#

Is it just me or do I not receive any message content anymore?

woven grove
#

do you have the intent enabled

south python
#

Yes i do

#

At the client and the dev portal

median jetty
#

createMessageComponentCollector in v14?

plain roverBOT
median jetty
#

i have use this:

const collector = interaction.channel.createMessageComponentCollector({ filter: menuFilter, componentType: 'SelectMenu', time: ms('60s'), max: 1 });

But it don't work

jaunty vault
median jetty
#

thanks

regal mason
#

Why I keep getting this error event if deleted all actual applications

#

And in my request there's no duplicate

jaunty vault
mental inlet
#

what does the "cached" type variable do for the interaction types?

urban belfry
#

like if it wasn't cached, interaction.member would be a raw member object from discord and not a Discordjs.GuildMember

mental inlet
#

ah okay

#

so what's the best to use in this case? raw data or a discord.js object?

obtuse crater
#

You can't just choose what object it will be, if you receive an interaction from uncached guild it will be a raw object

#

You have to use typeguards to know what the object actually is

scarlet tangle
#

Uh what's wrong?

dull mulchBOT
forest elm
#

install the latest @dev

scarlet tangle
#

Worked

swift pike
#

Is discord.js v14 in an okay state for me to begin to update my bot?

uncut kelp
#

For the past day or so, it crashed on launch. Does that answer your question?

swift pike
#

Yeah, lol

dusky portal
#

Lmao

#

Is there anywhere to see the progress thats been made towards V14 being released? A roadmap or something?

steel haven
#

You can always look at open issues and PRs on GitHub. But it’s a WIP until it‘s not. It’s done when it’s ready.

dusky portal
#

Ah, classic

dusky portal
#

oh fuck 97% thats scary

steel haven
#

That doesn’t say much though. New PRs and such arise often, others getting merged at the same rate. So don’t believe that it‘s only those things and v14 will release after

stiff lark
dusky portal
viscid creek
#

does anyone know if in v14 Channel#setName() resolves/rejects when rate limited, cause in v13 it always just hangs if the rate limit was hit

uncut kelp
#

Discord doesn't send that, I believe, so no

knotty plover
#

The default behaviour on all rate limits is to queue

forest elm
#

seems like you're looking for RESTOptions.rejectOnRateLimit

knotty plover
#

Theres a ClientOption in v13, RESTOption in v14, rejectOnRateLimit, which lets you customise this behaviour

#

But that relies on Discord having that rate limit properly separated if you want to target it specifically

viscid creek
#

yeah, thats alright thanks

#

i just check to see if it worked after a few seconds

ionic wren
#

I just updated my discord.js today, but......

#
  util.destroy(socket, new ConnectTimeoutError())
                       ^
ConnectTimeoutError: Connect Timeout Error
    at Timeout.onConnectTimeout [as _onTimeout] (/mnt/c/Users/Kay/Desktop/KayBotTypeScriptJDA/node_modules/discord.js/node_modules/undici/lib/core/connect.js:108:24)
    at listOnTimeout (node:internal/timers:561:11)
    at processTimers (node:internal/timers:502:7) {
  code: 'UND_ERR_CONNECT_TIMEOUT'
}
nocturne kayak
#

you have a connection problem then

ionic wren
#

This is a little bit weird......

#

🤔

ionic wren
#

In Ubuntu docker on other's server:

#

🤯

tame gazelle
#

npm i discord.js@dev

ionic wren
tame gazelle
ionic wren
#

@tame gazelle

woven grove
#

yeah, you can't use discord-together, whatever that is

#

with v14

#

though it is irrelevant to your error

#

theres a PR open to fix it as it seems

ionic wren
#

👌

fiery widget
#

TypeError: interaction.isCommand is not a function
what can i do?

scarlet tangle
#

Hey, any fix for that?

0.options[0].type[BASE_TYPE_REQUIRED]: This field is required
0.options[1].type[BASE_TYPE_REQUIRED]: This field is required```


```js
new SlashCommandBuilder()
            .setName('ticket')
            .setDescription('Manages channel permissions.')
            .addSubcommand(subcommand =>
                subcommand
                    .setName('add')
                    .setDescription('Adds user to an order channel!')
                    .addUserOption(option =>
                        option.setName('user')
                            .setDescription('User')
                            .setRequired(true)),
            )
            .addSubcommand(subcommand =>
                subcommand
                    .setName('remove')
                    .setDescription('Removes user from an order channel!')
                    .addUserOption(option =>
                        option.setName('user')
                            .setDescription('User')
                            .setRequired(true)),
            )```
forest elm
#

how are you deploying your commands

undone yew
#

I'm clicked buttons and got error

#

should i post the whole code?

scarlet tangle
uncut kelp
#

(That doesn't help)

undone yew
#

no errors

undone quarry
#

Discord services are buggy atm

#

Interactions and audit logs as far as I've seen

undone yew
#

so how can i solve this error?

undone quarry
#

Waiting for them to be fixed

undone yew
scarlet tangle
# uncut kelp (That doesn't help)

here's whole function

    const guild = client.guilds.cache.get(guildId);
    guild?.commands.set([
        //@ts-ignore
        new SlashCommandBuilder()
            .setName('ticket')
            .setDescription('Manages channel permissions.')
            .addSubcommand(subcommand =>
                subcommand
                    .setName('add')
                    .setDescription('Adds user to an order channel!')
                    .addUserOption(option =>
                        option.setName('user')
                            .setDescription('User')
                            .setRequired(true)),
            )
            .addSubcommand(subcommand =>
                subcommand
                    .setName('remove')
                    .setDescription('Removes user from an order channel!')
                    .addUserOption(option =>
                        option.setName('user')
                            .setDescription('User')
                            .setRequired(true)),
            )
    ])
}```
undone quarry
ruby void
#

did any1 catch DiscordAPIError, called 'Object'?
P.S. when trying to edit message

mental scarab
#

Hey, I get this Error: ```js
ExpectedConstraintError > s.number.lessThanOrEqual
Invalid number value

Expected: expected <= 25

Received:
| 26
when executing these lines of code:js
//Define Server Info Variables
for(let i = 0; i < server_amount; i++) {
let name = servers[i].attributes.name
let trimmedName = name.substring(0, 25)
server_embed.addFields([{ name: Server #${i}, value: '' + trimmedName + '', inline: true }])
}```

#

The Error happens in line 5 of the code bit

#

I have no Idea what could have caused this

forest elm
#

you are adding more than 25 fields to the embed

mental scarab
#

ahhh ok. lol. thanks for that info

#

do select menus also have an upper limit of 25 options?

median jetty
#

For use this i must me use client.rest.on

plucky pike
scarlet tangle
#

use type checking

#

i think it should work

uncut kelp
#

That is a TypeScript error

scarlet tangle
#

typings error

uncut kelp
#

But I'm pretty sure that method doesn't exist anymore

uncut kelp
#

So idk what the issue is

scarlet tangle
# plucky pike lmao
if (channel.type === ChannelTypes.GuildNews /* or something similar*/) ...
median jetty
scarlet tangle
#

you must use client.rest.on if you want handle these events

plucky pike
#

it didn't bother to say "this exists on none of them" 🙄

#

TIL.

scarlet tangle
uncut kelp
#

That's literally how TypeScript works

scarlet tangle
#

yes ofc

median jetty
#
client.on('apiRequest', (request) => {
    console.log(request)
})

It don't work

median jetty
#

i have try request

rain bramble
#

Did you add rest?

jaunty vault
#

Instead you should access these events from Client#rest
did you follow this?

median jetty
#

yes

jaunty vault
#

show

median jetty
#

Now work

late venture
#

can the color of an embed no longer be a string?

urban belfry
undone yew
#

I'm clicked delete button and i got error

steel haven
undone yew
#

I'm fixed

#

only "DiscordAPIError[40060]: Interaction has already been acknowledged." got error

#

but buttons working

plain roverBOT
#

DiscordAPIError: Interaction has already been acknowledged
[INTERACTION_ALREADY_REPLIED]: The reply to this interaction has already been sent or deferred.

You have already replied to the interaction.
• Use <Interaction>.followUp() to send a new message
• If you deferred reply it's better to use <Interaction>.editReply()
• Responding to slash commands / buttons / select menus

ruby void
#

I'm doing musical player with "real-time" time bar of song's playback duration. I'm editing a player message every 3 seconds to not to get rate limited. But, after 40-50 mins of editing message, finally i'm getting rate limited... I tried to search info about message edit per hour rate limits, but found nothing... Can anyone help me, what's the reason?

woven grove
#

What reason are you looking for

#

What you do is simply not allowed neither feasible

ruby void
#

Ah, i see, thanks!

trail pine
#

Any reason all of channel types are strings rather than actual ChannelTypes? I'm having trouble comparing channel.type to the ChannelType enum. EnumResolver has been removed as well in a semi-recent merge.

Am I meant to check by keys, is there something else that I'm missing, or is this an oversight?

uncut kelp
#

Any reason all of channel types are strings
What

trail pine
#

Channel classes types have their type property defined as a specific string corresponding to the type name rather than id, compared to ChannelType enums associating by ID.

i.e.

uncut kelp
trail pine
#

Huh, this is why I asked here rather than making an issue. Somehow my packages installed wrong even though I specified the dev build. Thanks for the highlight

uncut kelp
#

Oh okay. Then yeah, that's what happened

marble blade
#

Is there a way to get the number of messages sent by a user in a guild?

idle galleon
#

No

marble blade
idle galleon
#

Unless you just keep count in a db every time they send a message

marble blade
#

okay

scarlet tangle
#

How do I add a select menu in Modal?

vague coyote
scarlet tangle
#

Ah, cool

scarlet tangle
#

you can do this but discord.js doesnt support it because its unreleased

vague coyote
#

That equals you shouldn't do it, so not worth mentioning

jaunty comet
rain bramble
jaunty comet
#

They’d have made an announcement if it was a real thing

rain bramble
jaunty comet
median jetty
#

It don't ping role

spare fiber
#

to ping role <@&roleid>

median jetty
#

thanks

scarlet tangle
#

but added to api already

jaunty comet
rare zinc
#

is there a library or guide for v14?

woven grove
#

Check the pins

rare zinc
#

thanks

scarlet tangle
#

is it possible to get shard id of current logged in client?

scarlet tangle
#

but select menus CAN BE ADDED to modals, it's only undocumented & unreleased & probably unfinished and bugged

jaunty comet
#

Theyre workin on it however

scarlet tangle
#

how do i get the info from Promise { <pending> }

jaunty vault
#

await it

median jetty
#

await message return content = ''

nocturne kayak
#

yeah you need MessageContent intent to receive msg content in api v10

median jetty
#

on dev portal

#

it is enable

nocturne kayak
#

did you enable it in your client constructor

median jetty
digital sequoia
#

Is this deprecated in @dev ?


// Client creation
  presence: {
    status: 'online',
    activities: [{name: "Premium Server", type: "WATCHING"}],
  },
vague coyote
vague coyote
digital sequoia
#

ah thanks

tame gazelle
#

IntelliSense tells me that SlashCommandBuilder doesn't exist when trying to import it from discord.js but when I do console.log(new Discord.SlashCommandBuilder()) it's logging the correct thing
are types missing?

outer bane
#

they are not, restart vscode, you probably have old types cached

tame gazelle
#

ah yeah ._.

south python
#

Does Util still exist on v14? I want to use the Util.splitMessage() function

jaunty vault
#

iirc they removed that

velvet jasper
#

yeah splitMessage() is removed

south python
#

ooh

fresh prawn
#

Did i do this right?

DiscordAPIError[50035]: Invalid Form Body
components[0][COMPONENT_TYPE_INVALID]: The specified component type is invalid in this context

uncut kelp
#

Components are composed of up to 5 action rows, and each action row can have up to 5 buttons

#

It looks like you skipped the action row part there

fresh prawn
#

ah, thought it got removed :p

fresh prawn
#

Am I doing anything wrong here?

#

The select menu doesnt send

#

Dont think there is anything wrong with it, message.content returns nothing, so the embed and select menu wont send :/

#

I got the right intents and all that

tawdry mist
#

Hey, I can't figure out why exactly I am getting this error. DiscordAPIError[50035]: Invalid Form Body\ntype[NUMBER_TYPE_COERCE]: Value "activity" is not int.

#

If anybody can tell me why I'd really appreciate it lol

fresh prawn
tawdry mist
#

I'm lead to believe it comes from my command.

#

I think it's from options.

#
    options: [
        {
            type: 7,
            channel_types: [2],
            name: "channel",
            description: "The voice channel to play the activity in.",
            required: true
        },
        {
            type: 3,
            name: "type",
            description: "The type of activity.",
            required: true,
            choices: [
                {
                    name: "youtube",
                    value: "880218394199220334"
                },
                {
                    name: "poker",
                    value: "755827207812677713"
                },
                ... and so on
            ]
        }
    ]
#

v14 must have changed something here

uncut kelp
tawdry mist
uncut kelp
#

Then maybe it doesn't come from there

tawdry mist
#

Here lemme show the stack rq

#

It comes from this line: await this.application.commands.create(newCmd, process.argv.includes("--dev") === true && "763803059876397056");

#

(When I create the slash command)

uncut kelp
#

It's one of your commands then

tawdry mist
#

Thanks.

late siren
#

Why type guard methods are removed?

tame gazelle
fresh prawn
#

message.content is just an empty string, the bot got the right permissions and intents

uncut kelp
#

Wouldn't that mean you don't?

#

That's quite the contradiction

fresh prawn
#

Well, i think i got the right permissions and intents :p

uncut kelp
#

What are your intents?

fresh prawn
#

GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.DirectMessageReactions, GatewayIntentBits.GuildMembers

uncut kelp
#

Missing the message content intent

fresh prawn
#

Thought GuildMessages would be enough, thanks

reef meadow
#

Hi
Is they an easy way to see breaking changes from v13 to v14 ? Or need to test everything to see what break ?

reef meadow
#

Oups mb

fast jay
#

will automod event(nodejs) come in v14 ?

rain bramble
#

Yes

fast jay
#

nice

tall verge
#

exist the member guild hash banner?

humble nest
#

hey discord.js will only update @discordjs/builders to 0.15.0 in v14? really need bug fix from there

velvet jasper
#

Yes

humble nest
scarlet tangle
#

dm_permission: false doesn't really work in dev version ...why so

#

I am trying to make the commands guild only

steel haven
fresh prawn
#

should it be

interaction.channel.permissionOverwrites.edit(interaction.user.id, {
  "allow": [PermissionsBitField.Flags.SendMessages]
})```

or 

```JS
interaction.channel.permissionOverwrites.edit({
  "id": interaction.user.id,
  "allow": [PermissionsBitField.Flags.SendMessages]
})```
fresh prawn
#
            interaction.channel.permissionOverwrites.edit(user, {
                "allow": [PermissionsBitField.Flags.SendMessages, PermissionsBitField.Flags.ViewChannel]
            })``` Ive been trying to give permissions, and remove but doesnt work
late venture
#

why cant I add a string to .setColor() on EmbedBuilder

steel haven
fresh prawn
#

Oh..

fresh prawn
#

Oh, it was actually

            interaction.channel.permissionOverwrites.edit(user, {
                SendMessages: true, 
                ViewChannel: true
            })```
scarlet tangle
# fresh prawn Invalid json tho
           interaction.channel.permissionOverwrites.edit(user, {
                [PermissionsBitField.Flags.SendMessages] : true,
[PermissionsBitField.Flags.ViewChannel]: true
            })```
#

you can use this

scarlet tangle
#

this work too

green tiger
#

I can't see any content in messages, it's only an empty string. I have tried adding the GatewayIntentBits.MessageContent however, it gives me an error on login:
Error [DisallowedIntents]: Privileged intent provided is not enabled or whitelisted.

#
intents: [
        GatewayIntentBits.Guilds,
        GatewayIntentBits.GuildMessages,
        GatewayIntentBits.MessageContent,
        GatewayIntentBits.GuildVoiceStates
    ]```
knotty plover
#

Turn it on in the Dev portal too

scarlet tangle
#

you need to enable that intent in developer portal

rich cipher
#

I have some weird question in mind guildMemberManager.me is nullibe in which case the client member isn't cached?

outer bane
#

if you manually remove it, sweep it or limit the member collection size

#

and don't have the guild member partial

rich cipher
#

So you could recieve the client member as a partial?

outer bane
#

no, if you have the partial the property isn't nullable but will construct a minimal member (with the user id) iirc

rich cipher
#

Still don't get it how could I recieve client member missing some data

uncut kelp
#

Wasn't cached then a presence update occurred maybe

rich cipher
#

So if I don't mess with chaching it wouldn't happen even if I don't have the guild members intent?

outer bane
#

yes, you get your bot's member with the initial guild payload

upper stirrup
#

interaction.guild.me.voice.setSuppressed(false)
Cannot read properties of undefined (reading 'voice')

outer bane
#

me was moved to guild.members

tawdry mist
#

embeds[0].color[NUMBER_TYPE_COERCE]: Value "#1fa9ff" is not int.
Anybody know why this won't work?

#

I set the embed color to "#1fa9ff"

forest elm
#

use 0x1fa9ff (without quotes) or import EmbedBuilder from discord.js (if you are using it)

tawdry mist
#

Oh alr.

#

Thanks.

tidal lichen
#

Does Modals not support select menus yet? As I've notice we can add them to it but when you try to call upon it using getFieldInput it says Field with custom id "color" is of type: 3; expected 4. or am I somehow not understanding stuff

velvet jasper
#

It will be supported when it’s officially released by discord

scarlet tangle
#
const embed = new EmbedBuilder()
  .from(interaction.message.embeds[0])

(intermediate.value).from is not a function..how to fix?

sacred eagle
scarlet tangle
scarlet tangle
#

Of course you're on latest dev version?

#

Yep, now I fixed it

sacred eagle
#

Note that it must be the imported from discord.js
otherwise the from doesn't exist

unreal cedar
#

Which of these do I need to use to know if the interaction is just a normal slash command

unreal cedar
#

ty

arctic mirage
#
!message.guild.me.permissions.has

right?

tame gazelle
marble barn
#

I'm leaving this here since it helped me

PSA for people who used AnyInteraction to perform type reductions.
Type AnyInteraction was removed in the dev build.
Change AnyInteraction back to Interaction again.

ripe scaffold
#

bless

#

❤️

steel haven
#

Hi i have again my Error : Error [InteractionNotReplied]: The reply to this interaction has not been sent or deferred.

My script:

await i.deferReply({ ephemeral: true });
 i.editReply({ content: 'test'})
console.log(i) -> replied : false

Why ? 🥲

idle galleon
#

It was deferred, not replied

#

Replied means .reply was used

steel haven
#

Ok so,

i.reply({ content: 'test'})
console.log(i) -> replied : true

?

idle galleon
#

You need to await the reply

manic lynx
#

IDK how to do EmbedBuilder.from();


    const embed = EmbedBuilder.from(interaction.message.embeds[0]);```

```js
embed.fields[1] = { name: 'Status', value: 'ACCEPTED' }```
fiery anvil
#

i came back from a long pause developing my bot and i get this error on the dev package

#

didn't have yet time to read all of the changes, can u help real fast pls?

scarlet tangle
#

isCommand got removed

#

you should use .isChatInputCommand

fiery anvil
#

thx

#

and i suppose this got removed too right?

#

interaction.guild.me.voice.channel

forest mulch
fiery anvil
#

i previously got the color as color: '0xA800F6', but i saw that no it got a resolvablecolor function and the old .setColor function gives me an error

#

how does that work

scarlet tangle
#

show your code pls

fiery anvil
#

gives error on that

scarlet tangle
#

Embed class doesn't have method .setColor

#

you should use EmbedBuilder

#

instead of Embed

fiery anvil
#

got it

#

that changed too, interesting

#

thx a lot

scarlet tangle
#

no problem

scarlet tangle
rain bramble
forest willow
plain roverBOT
#

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

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

- embed.setFooter('This is an example text', 'https://example.com/icon.png')
+ embed.setFooter({ text: 'This is an example text', iconURL: 'https://example.com/icon.png' })
arctic mirage
#

how do you check if the invitation is the same as the server?

forest willow
#

and about format?

steel haven
forest willow
#

?

#

ah got it

steel haven
# forest willow

Is that a BaseCommandInteraction? Typeguard it to be CommandInteraction (either by changing the passed type or isChatInputCommand() )

steel haven
forest willow
#

the type conversion

steel haven
#

Well, you use TS so you should be used to that.

forest willow
#

doesnt work or maybe i am doing wrong

tame gazelle
forest willow
tall verge
#

is normal that if I go pass the MessageManager#fetch({ messsage: possibleNullOrUndefined }) method, I get the message collection?

outer bane
#

if you don't pass a MessageResolvable it'll fetch multiple messages

stuck solstice
#

Suggestions how to investigate what's wrong?
Trying to check if the GuildMember has any of the roles specified in an array.

const roles = ['917080707807977492','930607303470743613','963165204894588948','963165552174571550','963165332854407198','963165407433326755','963165452568260729'];
const hasRole = newMember.roles.cache.hasAny(roles);

>hasRole: false

I'm certain the IDs are correct, and the member indeed get's one of the roles in the array. I still get false.

uncut kelp
#

Collection#hasAny() does not take an array

stuck solstice
#

a, I misremember then x)
Gotta re-check

#

A rest param?

uncut kelp
#

Yes

#
- const hasRole = newMember.roles.cache.hasAny(roles);
+ const hasRole = newMember.roles.cache.hasAny(...roles);
arctic mirage
#
TypeError: MessageActionRow is not a constructor
const row = new MessageActionRow()
  .addComponents(
//......
);
steel haven
kind pulsar
#

Is there a way to make the section to choose a channel in the slash commands only show text channels and not voice channels or categories?

plain roverBOT
kind pulsar
#

Thanks

kind pulsar
#

(It should be noted that I do not use the SlashCommandBuilder)

kind pulsar
kind pulsar
steel haven
# kind pulsar

So it’s not JSON meant to be sent directly via REST but options meant for ApplicationCommandManager?

steel haven
# kind pulsar Hmm, yes

In that Case channelTypes would be correct indeed. Did you redeploy the respective command?

kind pulsar
#

Yes, like 3 times

steel haven
#

Reload your discord app maybe?

kind pulsar
#

I already did it, and it still doesn't work

dusky agate
#

this happens when I send an image

#
const attachment = await  new Attachment(
      await captcha.png,
      "captcha.png"
)

return interaction.reply({
    files: [attachment],
                           
})
plain roverBOT
#

Documentation suggestion for @dusky agate:
class AttachmentBuilder
Represents an attachment builder

mental inlet
#

might be a stupid question, but what's the correct type for a MessageComponentCollector

paper sparrow
#

any expectations when its docs will be done? or when will it be released?

mental inlet
#

look in pins

paper sparrow
#

the link which i have its old one, it only has changes from v13-> v14

#

let me see

mental inlet
#

if it redirects you to the stable branch, click on the dropdown menu and click on main, which is v14

paper sparrow
#

i want modals docs..

mental inlet
paper sparrow
#

ahh thank you so much

mental inlet
#

np

mental inlet
steel haven
mental inlet
#

fixed

empty urchin
urban belfry
empty urchin
#

:sip:

urban belfry
empty urchin
#

yes but why doesn't a string work :hmmm:

uncut kelp
#

Because that's the wrong string to provide in the first place?

#

The types only allow you to specify this enum, it seems, so...

empty urchin
#

I thought at the beginning that you changed everything to pascalcase so I tried that out with pascalcase as well

uncut kelp
#

I think it's just how includes() works

#

But in any case, one shouldn't be using magic strings :eyes:

urban belfry
#

the type says GuildFeature[]
so of course you can't just use whatever you want

empty urchin
#

it's not really consistent trough the package that like permissions work with strings an enum's, but guild features only with enum's lol

urban belfry
#

well permissions are a bitfield, there's something to resolve, this is just strings

steel haven
#

Well, discord itself isn’t consistent in that guild features are strings but other flags are Bitfields.🤷‍♂️

empty urchin
#

¯_(ツ)_/¯

#

just thinking that it would be easier for the average user

steel haven
#

True. Let‘s remove the string versions for permissions

empty urchin
#

lmao no then I have to rewrite my whole bot again

steel haven
#

And there you have the reason for inconsistency

urban belfry
#

why use dev then 🤨

empty urchin
#

the only thing I want to say that I don't think it is hard to also allow strings in the guild features

urban belfry
#

since you don't like rewriting i mean

steel haven
#

It also isn’t hard to hardcode all intents as default for all bots. Doesn’t mean it’s the right thing to do

empty urchin
#

why isn't it a good thing lol

#

also hardcoding all intents as default is bad because of performance, but allowing a string.. don't think that this would use a lot

pine compass
#

is v14 close to final?

steel haven
#

In my eyes magic strings are as bad as magic numbers. If there are only certain strings that are valid they should be an enum. If I had any say in it I‘d remove the string versions for permissions etc. too. But since permissions and intents are something that the average Joe would need for almost every bot there are legacy strings so everybody will be able to update to v14

steel haven
#

But as soon as you use TS instead of JS you aren’t that average Joe anymore so the typings can be stricter

pine compass
#

ah yes TS

#

the arch linux of javascript

still crater
#

i can't find where i'm going wrong

uncut kelp
#

Seems the select menu option builder is not correctly passing its data

steel haven
still crater
#

14.0.0-dev.1656158629-c4653f9 and i'm importing directly from discord.js, don't have @discordjs/builders installed as a dependency

uncut kelp
#

Yeah it's only an issue with discord.js and not builders

#

We override those methods

bronze scarab
#

referencing this channels topic, will v14 release today at "00:00 and 12:00 UTC"

#

or is it just referencing that it will release on github and update on npm at those times

steel haven
bronze scarab
#

Yeah upon reading it again that makes more sense

frigid sleet
#

Hey i have a question, i try to send a message with my Bots in Threads and Text-Voice-Channels, / commands working in both channel types, but in threads my bot says me that he has missing accsess, but i ping him so he is at the right in the tread and he has Admin Perms, in Voice-Text Channels he dont reakt, so how can i do it, that he respond/ send messages in the channel types?

frigid sleet
#

ok, never mind, the bot has not the perms to write im threads, but why the Text-in-Voice Channel not working is a question

uncut kelp
#

but i ping him so he is at the right in the tread and he has Admin Perms
So the bot doesn't?

knotty plover
#

Text in voice are not threads though

frigid sleet
frigid sleet
uncut kelp
#

You need to be able to connect to the text-in-voice channel, view it and send messages in it to be able to send messages to a text-in-voice channel

frigid sleet
uncut kelp
#

o,o huh

fresh prawn
#

Hey, is there a method on BaseInteraction i can see if it is a modal?

fresh prawn
#

Thanks

west cobalt
#

Any idea why on each message, the "content" property is an empty string ?

scarlet tangle
west cobalt
#

Ooh there is a specific intent ?

vague coyote
#

Yes, MessageContent

#

You also need to enable it in the dev portal

west cobalt
#

Yeah ok I see, maybe I really need it lol

#

Is that a new intent ?

vague coyote
#

Yes

west cobalt
#

And if I have a verified bot, I guess I have to apply for it ?

vague coyote
#

Yup

west cobalt
#

Hmm ok, thanks

vague coyote
#

And without a good reason you wont get it

west cobalt
#

I know, but I think counting characters is a good reason

vague coyote
#

What

#

Counting characters??

west cobalt
#

My bot is used in roleplay servers, and they don't care if you write lots of message, rather if you can write long and detailed actions, so the experience you get is based on the length of the roleplay actions users write

vague coyote
#

Yeah I doubt thats a valid reason

#

But you can always try

west cobalt
#

Somebody told me it was a good reason, so I don't know x)

gentle bane
#

anyone know this error's reason

#

now works but i really don't know the reason

scarlet tangle
#

you got connection timeout

#

probably temporary network issue

dawn phoenix
west cobalt
#

Hm.. Well kadybat told me that it seems to be ok when I talked about that in the discord api server, the problem lies in explaining everything x)

rough isle
#

Hi, any ideia when the version 14 go to stable?

gentle coyote
#

<message>.guild no longer available? Only able to access the guildId
shall i get the guild from the cache?

forest elm
#

are you using the Guilds intent?

gentle coyote
#

yes

forest elm
#

message.guild gets the guild from the cache

#

its a getter

gentle coyote
#
const client = new Client({
    intents: [
        GatewayIntentBits.Guilds,
        GatewayIntentBits.GuildBans,
        GatewayIntentBits.GuildEmojisAndStickers,
        GatewayIntentBits.GuildInvites,
        GatewayIntentBits.GuildMembers,
        GatewayIntentBits.GuildMessages,
        GatewayIntentBits.GuildMessageReactions,
        GatewayIntentBits.GuildVoiceStates,
        GatewayIntentBits.MessageContent,
    ],
});

These are my intents

#

ill check my code for any typos thanks

west cobalt
pseudo thicket
#

hello pls how to make threads

plain roverBOT
uncut kelp
rain bramble
uncut kelp
#

T_T

pseudo thicket
#

@hoary fox explain urself

hoary fox
scarlet tangle
#

What's the issue?

#

Trying to create a text channel

hoary fox
pseudo thicket
scarlet tangle
# hoary fox how did u created it (code)
const channel = await interaction.guild.channels.create(
      `ticket`,
      {
        type: ChannelType.GuildText,
        permissionOverwrites: overwrites,
        parent: data.config.categoryId,
        position: 1,
      },
    );
hoary fox
plain roverBOT
scarlet tangle
#

Ok

pseudo thicket
neat pier
#

!==, not !.type ===

#

interaction.channel.type !== <type>

urban belfry
#

that's a typescript feature

neat pier
#

Ah he’s using typescript

uncut kelp
#

Using TypeScript but not enums? O_o

neat pier
#

Yeah weird

pseudo thicket
uncut kelp
pseudo thicket
swift pike
pseudo thicket
#

i cant make threads

uncut kelp
pseudo thicket
#

no thread thingy

uncut kelp
#

Probably due to the non-null assertion operator

pseudo thicket
uncut kelp
lapis badger
#

Yeah, it is due to the non-null assertion operator

#

Which you shouldn't be using anyways unless you are certain that the data you're getting is defined

pseudo thicket
#

why is that messing with the intellisense tho

lapis badger
#

I think that's the intended behaviour of non-null assertions

#

You aren't supposed to be using them in most cases

#

Because you aren't ensuring that the data you're asserting is actually present in any way

#

Think of it as saying "trust me" to the compiler, which you are not supposed to do in most cases

hexed flint
#

I am getting Property 'getSubcommand' does not exist on type 'Omit<CommandInteractionOptionResolver<CacheType>, "getMessage" | "getFocused" | "getMentionable" | "getRole" | "getAttachment" | ... 6 more ... | "getSubcommand">'.ts(2339) when using Interaction.options.getSubcommand(), any way to fix this?

#

I am running the latest dev version

#

I am using the CommandOptions type for Interaction

lapis badger
#

You have to assert if the interaction is a command interaction

hexed flint
lapis badger
#

Well if you are sure that your code is receiving the right interaction type, then you can just change the type of that interaction to ChatInputCommandInteraction

hexed flint
#

Thank you so much 👍

pallid ice
#

any idea why I would be seeing this error when I'm 99% sure the type is correct...

#

I don't see why it wouldn't exist

outer bane
#

the type is not correct, threads are text based too and can't have webhooks, as the error tells you

pallid ice
#

oop

rocky sandal
#

does anyone know any way to check if there's an error 429 response

#

im using replit to host

still crater
dull mulchBOT
still crater
#

nice thx

scarlet tangle
#

i'm getting a "Invalid string length" error when adding an option to a chat input command

#

what would be the reason for this? is 153 characters too long?

knotty plover
#

Yes

#

Descriptions are capped at 100

still crater
#

Shard class' spawn and death events are missing the Worker thread option in the types according to the docs as well. also is there an enum for the shard events?

scarlet tangle
plain roverBOT
still crater
forest elm
#

btw, if you know how and want to fix those you can submit a pull request

pseudo thicket
#

is there an enum i can import for thread types? (private, public)

forest elm
#

ChannelType contains the thread types

pseudo thicket
#

ohh

#

ok ty everyone just 1 final thing. is there a way to make the bot not annoucne this? or to have the bot delete it right after its sent

forest elm
#

yeah, fetch a few messages after creating the thread, filter by Message.type and call .delete() on it

pseudo thicket
#

thanks

forest elm
#

the type you want is MessageType.ThreadCreated

pseudo thicket
#

👍

still crater
acoustic temple
#

How can I log a message that is deleted?

umbral slate
#

messageDelete event

arctic mirage
#

TypeError [ColorConvert]: Unable to convert color to a number.

.setColor('RANDOM')

arctic mirage
#

;-;

umbral slate
arctic mirage
umbral slate
#

you're in the dev version

acoustic temple
umbral slate
acoustic temple
#

And the partials?

clear nest
#

what's new in v14?

swift pike
clear nest
#

Modals are in v13

copper jetty
clear nest
swift pike
hexed flint
#

Hey, I’m getting Property 'createdAt' does not exist on type 'Role | APIRole'. Anybody know how can I fix this? I am currently using RoleObject.createdAt

#

I have now fixed by doing js declare module "discord.js" { interface APIRole { createdAt: number, } }

hoary fox
hexed flint
stiff lantern
#

Hello,
In v14 i try to import Intents like this :

const { Intents } = require('discord.js');

But the Intents constant is undefined whereas in v13 it works...
Do the import changed in v14 ?

plain roverBOT
stiff lantern
#

ohhh thx 🙂

umbral slate
#

you have to ensure your role is a discord.js Role

hexed flint
#

It always is tho

umbral slate
#

it might not be, that's why the types are like that

#

if your guild is cached it is

hexed flint
#

I’m already checking if the guild is cached in another file

umbral slate
#

then the check didn't carry out to that file, you have to give it the proper types

hexed flint
#

Alright, I’ll check that now. Thank you

arctic mirage
#
if (user.roles.highest.position > message.guild.me.roles.highest.position ) return 

TypeError: Cannot read properties of undefined (reading 'roles')

jaunty vault
#

it's message.guild.members.me

urban belfry
arctic mirage
#

:-:

#

user = args[0];

scarlet tangle
#

anyone know how i can get my channel to update its name from info pulled from another API? not sure if that makes sense

steel haven
arctic mirage
steel haven
undone yew
#

When will djs v14 stable version be released?

forest elm
#

the answer to that is in the pinned message

west cobalt
#

Why does this field require a string ? What am I supposed to put here to make it show the current date ?

outer bane
#

if it's an APIEmbed an iso date string, the date class has methods for that

west cobalt
#

Oh okay something like new Date().toISOString()

paper sparrow
#

I get error when trying to fetch a channel saying missing access
I have these intents js intents: [ process.discord.GatewayIntentBits.Guilds, process.discord.GatewayIntentBits.GuildMessages, // process.discord.GatewayIntentBits.GuildMessageReactions, ]

uncut kelp
#

It would imply you're fetching a channel the bot is not in

scarlet tangle
#

what's new in v14 👀

swift pike
steel haven
#

when the select menu/ button coming in modal ?

dawn phoenix
#

no idea

steel haven
#

Because I saw on Discord Developers someone using the select menu in a modal

dawn phoenix
#

not officially supported yet

steel haven
dawn phoenix
#

developers are generally advised to not use it until it's documented, even if it technically works if the respective data is sent

plain roverBOT
#

Tag suggestion for @scarlet tangle:
Sending and editing now takes only a single object parameter!

- channel.send(embed);
+ channel.send({ embeds: [embed, embed2] });
- channel.send('Hello!', { embed });
+ channel.send({ content: 'Hello!', embeds: [embed, embed2] });

• Full migration guide: learn more

plain roverBOT
#

DiscordAPIError: Cannot send messages to this user
Your bot is trying to send a DM to a user, but failed to do so:
• The user has DMs disabled or the bot blocked
• The user no longer shares a guild with the bot (make sure to send informational DMs before banning/kicking)
• The bot is trying to DM itself or another bot
Note: You cannot check if you can send a DM beforehand but have to handle the rejection case

#

Invalid interaction application command:
• After updating a global command Discord prevents you from receiving stale data until the update rolled out
• Refresh your commandlist to receive the updated command and try again

plain roverBOT
#

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

scarlet tangle
#

how to change bot nickname i d.js v14?

tame gazelle
scarlet tangle
#

i am getting DiscordAPIError[50013]: Missing Permissions

#

bot has the required perms

rich cipher
scarlet tangle
# rich cipher log `guild.members.me.permissions.toArray()`
[
  'CreateInstantInvite',   'Administrator',
  'AddReactions',          'Stream',
  'ViewChannel',           'SendMessages',
  'EmbedLinks',            'AttachFiles',
  'ReadMessageHistory',    'MentionEveryone',
  'UseExternalEmojis',     'Connect',
  'Speak',                 'UseVAD',
  'ChangeNickname',        'UseApplicationCommands',
  'RequestToSpeak',        'CreatePublicThreads',
  'CreatePrivateThreads',  'UseExternalStickers',
  'SendMessagesInThreads', 'UseEmbeddedActivities'
]
rich cipher
#

it has admin hmm

steel haven
scarlet tangle
#

this?

#
DiscordAPIError[50013]: Missing Permissions
    at SequentialHandler.runRequest (D:\Discord\bots\xd\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:740:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (D:\Discord\bots\xd\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:552:14)
    at async REST.request (D:\Discord\bots\xd\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:986:22)
    at async GuildMemberManager.edit (D:\Discord\bots\xd\node_modules\discord.js\src\managers\GuildMemberManager.js:316:15)
    at async D:\Discord\bots\xd\web\routes\api\Change-Username.js:19:4 {
  rawError: { message: 'Missing Permissions', code: 50013 },
  code: 50013,
  status: 403,
  method: 'PATCH',
  requestBody: {
    files: undefined,
    json: { nick: 'test', communication_disabled_until: undefined }
  }
}```
steel haven
scarlet tangle
#

ok

#

in d.js v12 this shit works

steel haven
lusty trellis
#

Hello, Parogo_72#8847 try to help me with my code he or she said to me "thats a weird error, your code should work", can someone just help with that bug here is document : ( Error ; My Code ; replace error ; discord.js version )

knotty plover
#

Tried a reinstall?

dawn phoenix
valid drift
#

@knotty plover fixed he did not have a package.json and his deps were all fucky wucky

hasty gorge
#

quick question, i installed @discord.js/builders and discord.js@dev and when i wanted to import SlashCommandsBuilder vs code auto completed from "discord.js", is that how it works? does builders complete discord.js or something?

copper jetty
#

Dont install the builders if you install discord.js it will automatically install builders

urban belfry
hasty gorge
#

ohh, thats it then, that prob explains why i got dev version on it too

#

thanks for clarifying!

arctic mirage
#
export default {
  name: 'guildMemberAdd',
async exec (client, message, d, member) {
const channel = message.guild.channels.cache.find(ch => ch.id === "991506128972304414");
  channel.send(`${member}`).then(d);
}

${member} undefined

urban belfry
#

very out of context, what is what?
guildMemberAdd doesn't have a message, it only gives you a member
check your params

hasty gorge
arctic mirage
hasty gorge
#

my question is: is this valid js syntax? I literally cannot remember

obtuse crater
#

it's really hard to help you without any additional context, like how do you call the method etc

hasty gorge
#

i havent coded in so long

urban belfry
hasty gorge
#

okay

arctic mirage
#

'-'

hasty gorge
#

hey, so i have some name localizations i set but for some reason, when i change my discords language they still doesnt change to that language

#

i have my discord set to spanish right now

mental inlet
mental inlet
hasty gorge
steel haven
hasty gorge
#

interesting

#

well, weirdness like always 👍

steel haven
#

That’s discord🤷‍♂️

arctic mirage
#
TypeError: Cannot read properties of undefined (reading 'guild')

const channel = member.guild.channels.cache.find(
  (ch) => ch.name === 'wel');
dusky portal
#

Xd was about to say i had to grab google translate

arctic mirage
arctic mirage
supple musk
#

Hello what is the problem?

idle galleon
severe mason
#

will there ever be a way to put videos into embeds

idle galleon
distant sorrel
#

Any one can help me?

idle galleon
distant sorrel
#

Where?

idle galleon
#

Where is what?

distant sorrel
idle galleon
narrow wagon
#

Does anyone know what interaction.isModalSubmit() looks like in the @dev version?

knotty plover
#

interaction.type === InteractionTypes.ModalSubmit I think, not 100% on the enum naming

crystal atlas
#

I'm on version: 14.0.0-dev.1656158629-c4653f9

Got this again yesterday ~22:40 UTC, don't remember having this issue on non-dev releases, any ideas?


dull mulchBOT
dawn phoenix
crystal atlas
#

Anything I can do to help resolve this? 🤔

silent hedge
#

hm

#

perhaps I'm being dumb, but I can't follow that stack trace

#

nevermind, I got it

#

so you're hitting this

   this.helloTimeout = setTimeout(() => {
      this.debug('Did not receive HELLO in time. Destroying and connecting again.');
      this.destroy({ reset: true, closeCode: 4009 });
    }, 20_000).unref();```
crystal atlas
#

Preferably I'd avoid this whole part overall:

silent hedge
#

I'm aware what you mean, I'm just trying see why this happens

#

since we explicitly rolled a fix out for this

crystal atlas
#

Curious, not sure why it still happens then 😦

silent hedge
#

yeahhh I'm not quite sure either, I assume you weren't listening to the debug event either?

crystal atlas
#

Nope, that screenshot is all I've got sadly 😦

silent hedge
#

👍 just open an issue with what you have and we'll try to look into it again

crystal atlas
#

How do I do that? 🙂

crystal atlas
#

Submitted I believe 🙂

scarlet tangle
#

What missing is needed to fix this??

scarlet tangle
urban belfry
# scarlet tangle What is actually causing the error?

well biryani, perhaps it's you trying to create a channel and trying to give a role/user the manage roles permission, which you can't if you don't have admin
now note that you didn't send the code where you do in fact create the channel, i had only the error to work with 😦

scarlet tangle
# urban belfry well biryani, perhaps it's you trying to create a channel and trying to give a r...
//overwrites
 const overwrites = [
      {
        id: guild.roles.everyone.id,
        deny: ['ViewChannel'],
        type: 'role',
      },
      {
        id: client.user.id,
        allow: [
          'EmbedLinks',
          'ManageChannels',
          'ManageMessages',
          'ReadMessageHistory',
          'SendMessages',
          'ViewChannel',
        ],
        type: 'member',
      },

      {
        id: user.id,
        allow: [
          'AttachFiles',
          'SendMessages',
          'ViewChannel',
          'ReadMessageHistory',
        ],
        type: 'member',
      },
    ];

//channel
 const channel = await guild.channels.create({
      name: `ticket-${(data.ticketCount + 1).toString().padStart(4, '0')}`,
      type: ChannelType.GuildText,
      permissionOverwrites: overwrites,
      parent: data.config.categoryId,
      position: 1,
    });
steel haven
urban belfry
#

yeaaaaa, soo what you want to do is check if your overwrites include setting the manage channel and if so, check if the bot has admin perms beforehand

urban belfry
steel haven
urban belfry
scarlet tangle
scarlet tangle
urban belfry
#

yea
also for member

steel haven
scarlet tangle
urban belfry
#

guild.members.me.permissions

scarlet tangle
#

Don't understand what logging the bot permissions would do.

steel haven
#

It would print them to the console waitWhat

urban belfry
#

what she doesn't understand is the reason why we're logging
and in case you do log, perhaps you'd want to use toArray to make it readable

paper sparrow
#

how to react to a message sent by webhook?

paper sparrow
steel haven
paper sparrow
#

i even tried ....send(...).then(a => a.react(...))

#

still, react is not a function

steel haven
paper sparrow
#

when i console.log message id of webhook message it logs an id which can be only used by fetchMessage, its not same and message id which i see when i copy message id myself

steel haven
paper sparrow
#

wait no

steel haven
#

Then you won’t get a Message, only APIMessage which is plain JSON

paper sparrow
#

well that might be it. i am using test bot and not production bot. i cant have test bot in same guild because double slash command

#

i tried to disable slash commands of 2nd bot from discord->integration but didnt work

paper sparrow
#

that should do the job lets see

#

@steel haven sorry if you are busy its alright, but if free look at this, now after above code still now, here's message js { id: '992086011209338892', type: 0, content: '', channel_id: '768858049338540062', author: { bot: true, id: '992019259192508436', username: 'RconCraft Testing', avatar: '5d61ded016c8bf74c749e713cc088384', discriminator: '0000' }, attachments: [], embeds: [ { type: 'rich', title: 'Feedback:', description: 'sdfg', color: 2383529, timestamp: '2022-06-30T15:15:35.997000+00:00', thumbnail: [Object], footer: [Object] } ], mentions: [], mention_roles: [], pinned: false, mention_everyone: false, tts: false, timestamp: '2022-06-30T15:15:37.139000+00:00', edited_timestamp: null, flags: 0, components: [], webhook_id: '992019259192508436' } now atleast message id and webhook message id are same but how will i react to it without message inetnts

steel haven
paper sparrow
#

really? thats so good than, tysm

steel haven
#

It won’t have any content, but you don’t need the content to react

paper sparrow
#

yep

scarlet tangle
#

can i use deleteMessageDays if i'm banning a user who isn't in the server?

hoary fox
#

yea

scarlet tangle
#

wait, deleteMessageDays isn't even working

acoustic temple
#

What I specify on permissions argument? I tried an array like this:

const perms = [
  { id: 'ID', type: 1, permission: true }
]

but got errors

#

this 🥺

forest elm
#

the default member permission is not the same as that

#

its a single permission bitfield

#

to create permissions like the ones on your second screenshot you need a bearer token from a user

#

bots cant create those

acoustic temple
#

hum

forest elm
#

heres an example of how you can run the method you were asking about .setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)

acoustic temple
#

Yeah, I think I understood

#

Maybe I need specify '0' on the argument and then set permissions manually in server settings

scarlet tangle
#
const { createdTimestamp, guild, guildId, options, user: moderator } = interaction
const days = options.getNumber('delete_messages')
await guild.members.ban(user, { deleteMessageDays: days, reason: `${moderator.tag} (${moderator.id}): ${reason}` })

days isn't doing anything here.

hoary fox
#

should work

scarlet tangle
#

It doesn't.

#

I've been at this for a while now and I have yet to understand why I'm experiencing this issue.

hoary fox
#

do u have lastest dev?

scarlet tangle
hoary fox
#

woah so idk

fresh jackal
#

Hi, can you tell me what the problem is?

const getSimpleModal = (opts: isSimpleModalOpts) => {
    let textInput = new TextInputBuilder()
        .setLabel(opts.label)
        .setPlaceholder(opts.placeholder)
        .setValue(opts.default)
        .setCustomId(opts.id + "-field");

    let row = new ActionRowBuilder<ModalActionRowComponentBuilder>()
        .addComponents(textInput)

    let modal = new ModalBuilder()
        .setCustomId(opts.id)
        .setTitle(opts.title)
        .addComponents(row);

    return modal;
}
    async pencil(interaction: ButtonInteraction, channel: VoiceChannel, activeChannel: ActiveChannels) {
        let request = getSimpleModal({
            id: 'name',
            title: 'Enter channel name',
            default: channel.name,
            placeholder: channel.name,
            label: 'Name'
        });

        await interaction.showModal(request);
        const filter = (interaction: ModalSubmitInteraction) => interaction.customId == 'name';
        let result = await interaction.awaitModalSubmit({ filter, time: 120_000 })
    }
#

I upgraded to the latest version of discord.js@dev and started getting this error

dawn phoenix
#

whatever you pass as channel does not seem to have a name

fresh jackal
#

I figured it out, but thanks for the help)

dawn phoenix
#

actually, probably doesn't have to be "value" potatodetective

fresh jackal
#

Yes, the problem was in the variable itself with the channel

cloud crest
#
DiscordAPIError[50006]: Cannot send an empty message

return Util.default.sendError(author, 'Timely', `You **have** already*taken the **temporary** reward! You can **get** the following via ${timelyString}`, interaction);

static async sendError(member, title, desc,interaction) {
    console.log(interaction);
    const error = new EmbedBuilder()
        .setColor(`#FF0000`)
        .setThumbnail(member.user.displayAvatarURL({ dynamic: true }))
        .setTitle(title)
        .setDescription(`${member.toString()}, ${desc}`);
    await interaction.reply({
        embed: [error],
        fetchReply: true,
        ephemeral: true
    });
}
knotty plover
#

embeds

cloud crest
#

aaaaaaaaa

river harbor
#

Is anyone experiencing issues when fetching the topic of a channel where it adds ' to the end?

sterile hemlock
#

please don't crosspost, especially when you've been answered

scarlet tangle
#

When will v14 be released for stable build

urban belfry
scarlet tangle
#

Oki

urban belfry
#

we don't work with ETAs, it just releases whenever, it's easier that way

scarlet tangle
#

Fair

arctic mirage
#

to set the bot activity is like this?
client.user.setActivity

plain roverBOT
regal mason
#

Does this event requires GUILD_MEMBERS intent ?

arctic mirage
steel haven
regal mason
#

Oh cool

steel haven
split fulcrum
#

What does setAgent mean?? And what does it do??

steel haven
split fulcrum
#

Ahh okej

regal mason
#

The send property disapeared or what ?,

uncut kelp
#

Cannot reproduce

hoary fox
#

( try to update )

regal mason
uncut kelp
#

npm ls discord.js what's the ouput?

regal mason
#

I restarted my pc

#

That works now

knotty plover
#

See pinned upgrade guide, refer to bit about intents

knotty plover
#

Absolutely not

knotty plover
#

Because we don't write code for people here, as per the server rules

velvet jasper
#

Help how?

brittle robin
#

what is that embed?
ah, 2 hours later lol

idle galleon
#

Prob bc it’s empty