#djs-in-dev-version

1 messages · Page 35 of 1

uncut kelp
#

Try that

#

Also you don't need to install /builders yourself as discord.js comes installed with it now

scarlet tangle
#

nothing has changed

dawn phoenix
#

i have no idea

#

huh. the line numbers do not align they do, i'm blind

#

i actually have to try really fucking hard to even get that error...

scarlet tangle
dawn phoenix
#

it has to be letters that are not in hex and no numbers at all

uncut kelp
#

I just ran that code and the embed colour worked, so...

dawn phoenix
#

-ev new Discord.EmbedBuilder().setColor("z")

forest geyserBOT
dawn phoenix
#

-ev new Discord.EmbedBuilder().setColor("f")

forest geyserBOT
dawn phoenix
#

like...

#

that must be coming from somewhere else

uncut kelp
#

I'd log in the source and see what it thinks the colour is really

dawn phoenix
#

or actually follow the stacktrace instead of assuming things, might help too, because that aint it

ebon tiger
#

You mean for this

        collector.on('end', collected => {
          menumsg.edit({ embeds: [EmbedBuilder.from(0).setDescription(`~~${EmbedBuilder.from(0).description}~~`)], components: [] })
        });
``` or not?
forest elm
#

0 is not an Embed instance, no

ebon tiger
forest elm
#

menumsg.embeds[0] is an Embed instance

#

you should have kept the one inside the string as it was

#

what was wrong was the call to setDescription()

ebon tiger
forest elm
#

you have to pass menumsg.embeds[0] to EmbedBuilder.from()

#

that will return an EmbedBuilder, which you can call .setDescription() on

scarlet tangle
#

Although all intents are open in the bot, I can't get the message content, it sends an empty string

idle galleon
#

Are you sure that’s all intents?

uncut kelp
#

Although all intents are open in the bot
One more reason to not use magic numbers. Because 3244031 does not contain them all

uncut kelp
# idle galleon Are you sure that’s all intents?

No, it's

[
  'Guilds',
  'GuildMembers',
  'GuildBans',
  'GuildEmojisAndStickers',
  'GuildIntegrations',
  'GuildWebhooks',
  'GuildInvites',
  'GuildVoiceStates',
  'GuildPresences',
  'GuildMessages',
  'GuildMessageReactions',
  'GuildMessageTyping',
  'DirectMessages',
  'DirectMessageReactions',
  'DirectMessageTyping',
  'GuildScheduledEvents'
]
knotty plover
#

I don't see MESSAGE_CONTENT

#

Maybe your source should be the discord.js docs meguFace

idle galleon
#

There’s currently 22 intents

#

That site only covers 18 of them

scarlet tangle
#

oh sorry maybe I shouldn't have fully trusted this site, can you give me the link to the right source?

idle galleon
#

I don’t think Discord has an official intents calc

#

I’d just specify intents manually w/ an Array

gritty patio
idle galleon
#

Every time a person uses all intents, a puppy dies

steel haven
gritty patio
#

why

steel haven
# gritty patio why

Bloats your bot, slows it down, unneeded load on the API, unneeded death of puppies, …

dawn phoenix
#

data economy

gritty patio
#

how should I do

knotty plover
#

List out the ones you actually need

gritty patio
#

slowing down the bot doesn't matter that much, it doesn't make a big difference for me, the server is a private bot

dawn phoenix
#

it's more of a general mindset a developer should develop and adopt, rather than a fundamental issue for your codebase

#

just use what you need, don't receive data you don't do anything with, if you have the option not to

#

most bots def. don't need the very frequent payloads for typing events, for example, having them makes no sense

gritty patio
#

hmm true

#

Is there a v13 to v14 page? @dawn phoenix

#

or a written source

nocturne kayak
#

check pins

reef meadow
#

Many breaking changes as usual kappapuff

vague coyote
#

thats what a major release is for

scarlet tangle
steel haven
scarlet tangle
#

yea tried but seems like my typescript wont let me i'll have to ignore that part ig

quasi dew
#

how exactly make modal in here, like i just update the v13 code to dev version and uses ActionRowBuilder,ModalBuilder,TextInputBuilder, and keeps getting

TypeError: Found non-callable @@iterator at ActionRowBuilder.addComponents

#

basically the same i think

#

Ok i Fixed it, i just need to make the components inside an array ; -;

scarlet tangle
#

Have the button styles changed? I'm getting an error in the style part

#
const { EmbedBuilder, ButtonBuilder, ActionRowBuilder} = require("discord.js");
const { SlashCommandBuilder } = require("@discordjs/builders");
const db = require("quick.db");
const Timestamp = require("../../utils/DiscordTimestamp.js");

module.exports = {
    data: new SlashCommandBuilder()
        .setName("avatar")
        .setDescription("aaaaaa"),
    type: "USER", // USER | MESSAGE
    async execute({ interaction, Client, Embed }) {
        const target = interaction.guild.members.cache.get(interaction.targetId);

        const k4h1n = new EmbedBuilder()
        .setColor("AQUA")
        .setImage(target.user.displayAvatarURL({ dynamic: true, size: 4096, format: 'png' }))
        
        const button1 = new ButtonBuilder().setLabel('Avatar URL').setStyle('LINK').setURL(target.user.displayAvatarURL({ dynamic: true, size: 4096, format: 'png' }));
        const row = new ActionRowBuilder().addComponents(button1)

        await interaction.reply({embeds: [k4h1n], components:[row]})
    },
};

mental inlet
#

dumb question but how do you check if the user has already run a command. for example: i have a fidget spinner command and i'm trying to prevent the user from running it while it's spinning

scarlet tangle
#

But if your waiting time is long, I do not recommend using cache.

mental inlet
earnest linden
#

Is the particials for message is it Particial.Message?

#

Cuz that doesnt seem to work woth the dev 14

stable edge
mental inlet
earnest linden
#
C:\Users\thoma\Desktop\me\index.js:21
    partials: [Partials.Message, Partials.Channel, Partials.Reaction],
                        ^

TypeError: Cannot read properties of undefined (reading 'Message')
    at Object.<anonymous> (C:\Users\thoma\Desktop\me\index.js:21:25)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47```
#
partials: [Partials.Message, Partials.Channel, Partials.Reaction],
forest elm
#

cannot replicate, how are you importing Partials

earnest linden
#

const { Client, Collection, GatewayIntentBits, Partials} = require('discord.js');

forest elm
#

what version are you on

earnest linden
#

the version 14 dev

vague coyote
#

npm ls discord.js

earnest linden
vague coyote
#

the exact version

forest elm
#

you aren't

vague coyote
#

thats not @ dev like I told you plenty of times before

forest elm
#

you're using 13.8.1

earnest linden
#

Wait what i thought i did

#

I had it installed

vague coyote
#

apparently not.

earnest linden
#

I literally had it installed

vague coyote
earnest linden
#
C:\Users\thoma\Desktop\me\node_modules\discord.js\src\util\BitField.js:168
    throw new RangeError(ErrorCodes.BitFieldInvalid, bit);
    ^

RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined.
    at Function.resolve (C:\Users\thoma\Desktop\me\node_modules\discord.js\src\util\BitField.js:168:11)
    at C:\Users\thoma\Desktop\me\node_modules\discord.js\src\util\BitField.js:163:54
    at Array.map (<anonymous>)
    at Function.resolve (C:\Users\thoma\Desktop\me\node_modules\discord.js\src\util\BitField.js:163:40)
    at Client._validateOptions (C:\Users\thoma\Desktop\me\node_modules\discord.js\src\client\Client.js:481:41)
    at new Client (C:\Users\thoma\Desktop\me\node_modules\discord.js\src\client\Client.js:78:10)
    at Object.<anonymous> (C:\Users\thoma\Desktop\me\index.js:13:16)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  [Symbol(code)]: 11
}```
forest elm
#

did you update to @dev

earnest linden
vague coyote
#

whatever you passed at index.js line 13 is undefined

earnest linden
#

The intents?

forest elm
#

yes, they are all wrong

vague coyote
#

PascalCase

earnest linden
#

Is there any way i can get all the GatewayIntentBits ntents? Like the Guilds, Messages etc

vague coyote
#

no, you pass the ones you need

earnest linden
#

Whats the intent for the Guilds messages

vague coyote
#

you need Guilds GuildMessages and MessageContent if you want... the content

plain roverBOT
scarlet tangle
#

How do we query perm

steel haven
scarlet tangle
#

interaction.guild.appPermissions.has(command.botPerm)

#

this part

#

I'm asking how can I query the bot's authority on the server, I can't do it like in v13.

scarlet tangle
dawn phoenix
#

appPermissions is on the interaction, not the guild

dawn phoenix
#

appPerms is preferable, already has overwrites calculated and everything

#

the new, cool, kid on the block

steel haven
#

Oh, right, my bad

late venture
#

is there a list of every permission available in PascalCase?

forest elm
#

thats not a thing

earnest linden
#
intents: [
        GatewayIntentBits.Guilds,
        GatewayIntentBits.GuildMessages,
        GatewayIntentBits.GuildMembers,
        GatewayIntentBits.GuildPresences,
        GatewayIntentBits.GuildBans,
        GatewayIntentBits.MessageContent

    ],

I have these intents enabled but my bot would not respond still to my command

uncut kelp
#

Slash commands don't require intents

earnest linden
#

I am doing prefix

#

not slash cmds

#

So?

willow dust
#

whats the equivalent to, interaction#isContextMenu, i know its smth like interaction#type === InteractionType#MessageComponent ?

green plume
#

What does this means?

idle galleon
green plume
#

Oh okay

earnest linden
#

My bot is using a prefix command and my bot wont respond to me

#

So?

#
const client = new Client({
    partials: [Partials.Message, Partials.User, Partials.GuildMember, Partials.Channel, Partials.Reaction],
    intents: [
        GatewayIntentBits.Guilds,
        GatewayIntentBits.GuildMessages,
        GatewayIntentBits.GuildMembers,
        GatewayIntentBits.GuildPresences,
        GatewayIntentBits.GuildBans,
        GatewayIntentBits.MessageContent

    ],
``` i have these intents
steel haven
#

Also what made you switch to v14 dev version?

earnest linden
# steel haven Doesn’t look like the intents are the issue. Show your messageCreate handler
const { Client, Intents, Collection } = require('discord.js');

const cooldowns = new Map()
module.exports = {
    name: "messageCreate",
    execute: async function runAll(client, message) {
        console.log(message);
        const prefix = "!";

        if (message.author.bot) return;
        if (!message.guild) return;
        if (!message.content.startsWith(prefix)) return;
        if (!message.member) message.member = await message.guild.fetchMember(message);

        const args = message.content.slice(prefix.length).trim().split(/ +/g);
        const cmd = args.shift().toLowerCase();

        if (cmd.length === 0) return;

        let command = client.commands.get(cmd);
        if (!command) command = client.commands.get(client.aliases.get(cmd));

        if (command)
            command.execute(client, message, args);
        if (!message.member.permissions.has("MANAGE_MESSAGES")) return;
        if (message.author.client) return;
        if (!message.guild) return;
        if (message.content.length >= 5) {
            message.delete();
            message.channel.send(`${message.author}, You are not allowed to send "Walls" of text, continuing will result in a mute`)
        }
    }
}
earnest linden
steel haven
earnest linden
#

So i should use the older dev version? #djs-help-v14 someone said that i should use the newer dev version

#

So i went ahead and done that

steel haven
earnest linden
#

Let me get you the message link

rain reef
#

Has this been released to djs yet?

rain reef
#

This is dev channel?

uncut kelp
#

Not in a stable version

rain reef
uncut kelp
#

What's that? O_o

rain reef
uncut kelp
#

We have no such thing. It's just in dev

rain reef
#

So if I do npm i discord.js@dev I should be able to use it?

rain reef
#

Also another question, I saw in the guide v14 changelog that builders is included into the dev version. Does this mean I can directly import SlashCommandBuilder from discord.js instead of @discordjs/builders?

uncut kelp
#

Yeah

#

It means you can also just uninstall it

rain reef
#

Ok thank you so much. I wanted to use SlashCommandBuilder for so long but I didn’t want to install an entire different package for it so you just made me so happy

uncut kelp
#

o,o

#

But... discord.js installs the package for you so it's no different xd

rain reef
#

I had no idea 😂

willow dust
scarlet tangle
#

Hello, how can I check if the person using the command has the authority to delete messages, I've been trying since yesterday evening, but I couldn't find it, I don't have a source :/

steel haven
#

Or ManageMessages in CamelCase

scarlet tangle
steel haven
scarlet tangle
#

Where exactly should I write this?

steel haven
scarlet tangle
spare fiber
#

as the error said, define it

scarlet tangle
spare fiber
#

it is, import it from discord.js

mental inlet
#

how do you save data to the cache? for example, i would like to save users if they're using a command and then delete the cache after.

scarlet tangle
plain roverBOT
spare fiber
vague coyote
#

PermissionsBitField is valid

spare fiber
#

alr

scarlet tangle
#
 [Error_Handling] :: Multiple Resolves
resolve Promise {
  {
    url: 'wss://gateway.discord.gg',
    shards: 1,
    session_start_limit: {
      total: 1000,
      remaining: 1000,
      reset_after: 0,
      max_concurrency: 1
    }
  }``` i am facing this strange err
#

what does it means?

scarlet tangle
#

bcz of this

#

i can't load cmnds

dawn phoenix
#

nah

scarlet tangle
#

events

scarlet tangle
gloomy kayak
#

it's normal, it just means that a promise resolved more than once (it seems a discord.js handled promise so no problem) and has no relation with your commands/events

indigo fable
#

any reason why a webhook would be firing locally but not be firing on my server?

steel haven
indigo fable
#

sending a message

steel haven
indigo fable
#

nope

#

nothing in console, just .. doesn't send

#

running it locally sends it 🤷‍♂️

hoary tree
#

How could i get an user id and store it in a json file

plain roverBOT
#

Documentation suggestion for @hoary tree:
property User#id
The user's id

hoary tree
#

nevermind

#

found it

night light
#

What is the difference between the GuildMessage and MessageContent intent? As I was required to have both of them for any messages to be logged in the messageCreate event

copper jetty
#

if you don't have message content intent the content will be empty string

night light
hoary tree
#

anyone knows why this doesn't work when member was kicked nor does the join event

night light
hoary tree
#

oh shoot, what is the intent

night light
knotty plover
#

On Dev it's GuildMembers

hoary tree
#

yea

#

ty

uncut kelp
hoary tree
#

it just auto captures my code and adds that

night light
knotty plover
#

Use the enum

knotty plover
hoary tree
#

true

stuck geyser
knotty plover
#

npm uninstall discord.js and npm install discord.js

#

Not sure how you ended up on dev then lol

stuck geyser
#

k

#

Well ty

knotty plover
#

No worries

stuck geyser
#

Sorry for all the trouble, kind of new to this stuff

knotty plover
#

all good

bitter schooner
#

am i only getting this warning on startup?js (node:15964) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time (Use `node --trace-warnings ...` to show where the warning was created)

#

is there a way to remove it?

#

(typescript)

knotty plover
#

Nah its just a warning

willow dust
#

how do you send a hyper link?

#

if i do

message.reply(`something ... ${hyperlink('swebsite', 'example.com')}`)
``` it doesn't work
EDIT: wait is it only embed descriptions that support hyperlinks?
outer bane
#

embeds and webhook messages (and therefore interaction replies)

willow dust
#

oh okay thanks

brittle robin
#

Why was interaction.isCommand/interaction.isAutocomplete type guards removed?

knotty plover
#

They only checked one thing, not necessary

#

We kept the ones that check multiple conditions

brittle robin
#

okay but checking for interaction.type doesn't 'automagically' make the interaction a CommandInteraction or a AutocompleteInteraction, it was kind of nice..? :p

knotty plover
#

<BaseInteraction>.isChatInputCommand() will for the former

#

Which is a ChatInputCommandInteraction, renamed from the old one

#

Checking type should do it for AutocompleteInteraction since its only that one parameter

brittle robin
#

aah

#

right, okay - I missed that renaming :D

#

are the types not up to date btw? I still see isCommand() and isAutocomplete()

knotty plover
#

Are you on the main docs?

brittle robin
#

I'm just using the typings that (I hope) came from installing discord.js@dev

knotty plover
#

Because I see the new ones

#

Uhhhh

#

The types are fine, are you sure its installed properly?

brittle robin
#

really strange.. I uninstalled/installed discord.js[at]dev just to make sure.

discord.js@14.0.0-dev.1657411900-f0b68d5
isAutocomplete() etc shows up in node_modules/discord.js/typings/index.d.ts

#

perhaps I have to manually install the types for dev? nope

knotty plover
#

uhhh

#

nope

#

I have no idea

#

Can you npm ls discord.js

brittle robin
#

└── discord.js@14.0.0-dev.1657411900-f0b68d5

knotty plover
#

Is that the only version you have installed?

brittle robin
#

in this project, yes

knotty plover
#

yup no idea

brittle robin
#

should I see a type called AnyInteraction now/still or is it gone?

knotty plover
#

Im not sure on that one

#

I think its new

brittle robin
#

Okay, I had some old cached data or something 🤦🏿‍♂️. Fixed

brittle robin
rain reef
#

Where can I see the current status of discord.js v14 on GitHub?

#

Please ping me when someone has the answer

knotty plover
#

There isnt really a "current status"

#

You can look at the open PRs

green plume
#

Why is it returning undefined?

`\`${i + 1}\` | ${ctx.client.users.fetch(r).username}#${ctx.client.users.fetch(r).discriminator} | <@${r}>)`
knotty plover
#

fetch returns a Promise

vague coyote
#

also why are you fetching twice instead of once, resolving it to a variable and using that

hasty gorge
#

this issue is from a select menus options right?

copper jetty
hasty gorge
#

okay, and max 5 rows per message right?

steel haven
hasty gorge
#

kk

dark steeple
#
const button = new ButtonBuilder()
                                .setCustomId('verifyme')
                                .setLabel('Nejsem Robot')
                                .setEmoji('☑️')
                                .setStyle(ButtonStyle.Primary);
        
        const actionRow = new ActionRowBuilder().addComponents(button);

        let msg = await channel.send({ embeds: [embed], components: [actionRow] });

Any idea what is wrong here? 🤔

outer bane
#

yes, you have to specify the generic type of the action row, e.g. ActionRowBuilder<ButtonBuilder>

dark steeple
#

Oh okay, thanks.

green plume
#

hi

hard robin
#

In V14 the way to check permissions is this right?
if (interaction.member.permissions.has("ManageMembers")) {

hard robin
#

It works, but are there newer way?

vague coyote
#

yes, use the flags

plain roverBOT
hard robin
#

How can I use it?

mental inlet
#

import it from djs

hard robin
#

Can you give me example for usage?

vague coyote
#

Why do you need an example, you just pass it to .has()

hard robin
#

Ok I got it

mental inlet
#

how do you save data to the cache? for example i'm trying to disable using a command for an amount of time.

steel haven
#

There is not the cache. How you save data for your bot is your responsibility, you can use volatile memory like Collection or persistent like a DB

pseudo flare
#

changed to which one in v14?

copper jetty
mossy cosmos
#

How do I get highest roles in the guild?

interaction.guild.roles.highest.position << Doesn't work

dawn phoenix
#

how does it not work?

mossy cosmos
#

Works now interaction.guild.members.me.roles.highest.position

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

#

thanks

dawn phoenix
#

that is not the highest role of the guild, but the highest role the bot has

mossy cosmos
#

Oh

woven grove
#

notice the me part

regal mason
#

why ChatInputCommandInteractionData doesn't exists anymore ?

steel haven
regal mason
#

Even ApplicationCommandData

idle galleon
#

It’s prob using the one from the discord-api-types package now

regal mason
#

I don't get it, really

uncut kelp
#

When you compile, does it actually exist

regal mason
#

Yes

#

I think I will restart webstorm

regal mason
uncut kelp
#

WebStorm (':

regal mason
#

Like when I push ctrl and hover the import it do not act as a link anymore

uncut kelp
#

All I hear from that is typing issues lol

#

It's not a problem with us or our typings just the IDE itself

regal mason
#

So VSC is better ?

uncut kelp
#

Well, it seems optimal. My only knowledge of that IDE is that people keep reporting issues about the typings

low tundra
#

Hey, when I use a context menu command, i get this error, and I can't figure out where is the error 😅

uncut kelp
#

So what's the code that's causing the error

knotty plover
#

looks like line 22 of events.js is where it hits your code

low tundra
#

Line 22 of events.js is litterally a .setDescription for an embed

dark minnow
#

The error traces back to the discord.js => @discordjs/builders => @saphire/shapeshift

willow dust
#
ButtonBuilder.from(button).setDisabled(true)

doesn't disable the button?

dark minnow
#

<ButtonBuilder>.from()?

willow dust
#

???

dark minnow
# willow dust ???

What are u trying to do? Disable a button that's have been clicked or on the message creation?

willow dust
#

disable a button thats been clicked

dark minnow
# willow dust disable a button thats been clicked

If you are replying to the ButtonInteraction (https://discord.js.org/#/docs/discord.js/main/class/ButtonInteraction):

Use the <ButtonInteraction>.message.components and to find your button:

Let's suppose: The button you want to disable is the first on the first ActionRow, so <ButtonInteraction>.message.components[0][0]

From there you will have an <ButtonComponent> object (https://discord.js.org/#/docs/discord.js/main/class/ButtonComponent):

Using the object you can set the <ButtonComponent>.disabled to true

To finalize use the <ButtonInteraction>.update (if you used the <ButtonInteraction>.deferUpdate you should use <ButtonInteraction>.editReply) with the components property set with the updated button to update (edit) the message

young gull
#

For .awaitModalSubmit do you have to provide time? When I do not provide the parameter it provides the error "Supplied time is not a number.", but I do not want to have a set time for the user to fill out the modal

knotty plover
#

yes

#

else you can lock up your code forever, because you will never know if they dismiss the modal

#

It needs to timeout eventually

dark minnow
#

Like Collection<id, function(ModalInteraction)> an then call the function with the modal interaction

willow dust
# dark minnow If you are replying to the `ButtonInteraction` (<https://discord.js.org/#/docs/d...

thanks, but https://www.toptal.com/developers/hastebin/ebenokoxuk.yaml
heres a bit a code along with it
i get that the error says that the type field is only suppose to be 1, but like how am i suppose to modify the field, am i suppose to directly modify the property?

  let confirmationButtonRow = interaction.message.components[0];
  let [acceptButton, denyButton] = confirmationButtonRow.components;

  interaction.update({
    components: [ButtonBuilder.from(acceptButton).setDisabled(true).toJSON(), ButtonBuilder.from(denyButton).setDisabled(true).toJSON()]
  });
dark minnow
#

Yeah, that's not gonna work

ButtonBuilder.from isn't a thing

You are passing the buttons as components outside of an ActionRow

willow dust
#

ButtonBuilder.from is a thing tho, its in the v13-v14 changes, its in the docs too

#

but thanks for the lead

dark minnow
#

type: 1 is the ActionRow

dark minnow
#

I was reading the @builders docs, srry

#

Well, wrap your button in an ActionRowBuilder and pass it to the update

#

And it should work

willow dust
#

ah they moved the @discordjs/builders into discord.js library so you shouldn't have it installed fyi

#

yeah okay thanks

hybrid zealot
#

Does the model support only 5 input fields?

knotty plover
#

yes

hybrid zealot
#

No wonder

hybrid zealot
knotty plover
#

No, 5 rows, one input each

steel haven
#

Hi, i have a problem with default_permissions:

``Cannot use 'in' operator to search for 'default_member_permissions' in undefined`

#

Oh it good my bad

lethal cliff
#

am I using the ChannelType enum incorrectly here?

  const channelConfig = {
    name: reviewParams.slug,
    type: ChannelType.GuildText,
    parent: categoryId,
    permissionOverwrites: permissions,
  };
  const newChannel = await guild.channels.create(channelConfig);
#

I get a weird error like:

src/handlers/project/create.ts:107:50 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(options: GuildChannelCreateOptions & { type: GuildChannelTypes; }): Promise<CategoryChannel | NewsChannel | StageChannel | TextChannel | VoiceChannel>', gave the following error.
    Argument of type '{ name: string; type: ChannelType; parent: string; permissionOverwrites: OverwriteResolvable[]; }' is not assignable to parameter of type 'GuildChannelCreateOptions & { type: GuildChannelTypes; }'.
      Type '{ name: string; type: ChannelType; parent: string; permissionOverwrites: OverwriteResolvable[]; }' is not assignable to type 'GuildChannelCreateOptions'.
        Types of property 'type' are incompatible.
          Type 'ChannelType' is not assignable to type 'ChannelType.GuildText | ChannelType.GuildVoice | ChannelType.GuildCategory | ChannelType.GuildNews | ChannelType.GuildStageVoice | ChannelType.GuildDirectory | ChannelType.GuildForum | undefined'.
  Overload 2 of 2, '(options: GuildChannelCreateOptions): Promise<TextChannel>', gave the following error.
    Argument of type '{ name: string; type: ChannelType; parent: string; permissionOverwrites: OverwriteResolvable[]; }' is not assignable to parameter of type 'GuildChannelCreateOptions'.
      Types of property 'type' are incompatible.
        Type 'ChannelType' is not assignable to type 'ChannelType.GuildText | ChannelType.GuildVoice | ChannelType.GuildCategory | ChannelType.GuildNews | ChannelType.GuildStageVoice | ChannelType.GuildDirectory | ChannelType.GuildForum | undefined'.

107   const newChannel = await guild.channels.create(channelConfig);
#

I feel like maybe I'm just too tired and am missing something obvious

#

when I looked into the type def of GuildChannelCreateOptions it looks like I'm using this property correctly

lethal cliff
#

I know this is bad but if I do ChannelType.GuildText as ChannelType.GuildText it resolves

#

in any event the command to create the channel seems to fail silently

#

I'll just get some rest and hopefully it just works tomorrow 😛

idle galleon
lethal cliff
idle galleon
#

You should use the one from d.js

lethal cliff
#

yeah that's what I'm using

idle galleon
#

Could try ChannelType.GuildText as const

lethal cliff
#

oh that also suppresses the type error

idle galleon
#

The inferred type is ChannelType, which includes non-guild types

lethal cliff
#

but in any event the value is just a 0 so that should be unrelated to the command failing I guess

idle galleon
#

The type it wants are the specific ChannelTypes in the union

#

Heh, union

#

I hope that makes sense

lethal cliff
#

it kinda does, but I didn't know typescript would just forget which particular value I was using from the enum

#

enums are weird, I don't fully understand their semantics

idle galleon
#

It’s pretty much just an object

lethal cliff
#

oh I just tested it with an object, you're right

#

I guess my misunderstanding was with how object property types are inferred

idle galleon
#

I recently learned what as const actually does

lethal cliff
#

will read up on as const again, thanks for the hint!

#

at least I can go to bed knowing my types are correct now, will work on the runtime issue another time

#

JS problem - I sleep; TS problem - not so much

idle galleon
#

You prob could’ve just typed channelConfig as GuildChannelCreateOptions now that I think abt it

lethal cliff
#

oh, so as const forces the inference engine to not widen literals, TIL

lethal cliff
prisma kiln
#

what is the maximum amount of options in select menu

#

I wanna make select menu with all disocrd text channels

#

have the select menu with channels been released

prisma kiln
copper jetty
#

right

low tundra
#

Hey, sorry but I still didn't find why I get this error

outer bane
#

uncached everyone role, either the guild is unavailable or you are missing the Guilds intent

low tundra
#

thanks so much

low tundra
#

sorry, me again 😅
there's nothing in the v13 to v14 wiki that says it's now impossible to edit embed color AFTER it's declared 🤔

onyx cove
#

What is Embed?

uncut kelp
low tundra
velvet jasper
#

EmbedBuilder.from()

low tundra
#

oh okay so...

#

i try something lol

velvet jasper
#

Yes

#

Then you can change the color

forest elm
#

that if statement no longer serves a purpose

#

probably not what you want

low tundra
low tundra
uncut kelp
#

What happens if message.embeds[0] is undefined and you chuck it into that from() method

forest elm
#

an embedbuilder is returned

forest elm
low tundra
#

why are you changing everything 😭

forest elm
#

what

velvet jasper
#

Just change the if statement to check if embeds at index 0 is nullish

#

And put the if before the EmbedBuilder.from

low tundra
velvet jasper
#

Yes

low tundra
#

now I get this
I think I have to do Embed.setFields() but I don't know what to put in here

forest elm
#

you can use spliceFields(1, 1, newFieldData)

plain roverBOT
low tundra
#

it works! 😂 thanks

low tundra
steel haven
cloud moat
#

is v14 gonna be as big as v13 was... it took me forever to update everything 🤣

uncut kelp
#

It took me 2-3 hours for my large project if that helps

hasty gorge
ebon tiger
#

Why this not working

    allowedMentions: {
      parse: [ ],
      repliedUser: false,
    },
    partials: ['MESSAGE', 'CHANNEL', 'REACTION'],
``` I changes for v13 to v14.
forest elm
#

those are not valid partials

plain roverBOT
ebon tiger
#

I mean for this.

#

For v13 works for this line

    allowedMentions: {
      parse: [ ],
      repliedUser: false,
    },
forest elm
#

that is how

ebon tiger
#
    partials: [
    Partials.Channel,
    Partials.Message, 
    Partials.User, 
    Partials.GuildMember, 
    Partials.Reaction] 
forest elm
#

show the reply code

ebon tiger
#
        const inviteUrl = `https://discord.com/api/oauth2/authorize?client_id=${process.env.CLIENT_ID}&permissions=8&scope=bot%20applications.commands`;
        const embed = new EmbedBuilder()
        .setTitle('Invite me')
        .setDescription(`Invite the bot to your server. [Click here](${inviteUrl})`)
        .setColor('#03fcdb')
        .setTimestamp()
        .setThumbnail(client.user.displayAvatarURL())
        .setFooter({ text: client.user.tag })

        const actionRow = new ActionRowBuilder()
        .addComponents([
            new ButtonBuilder()
            .setLabel('Invite')
            .setURL(inviteUrl)
            .setStyle(5)
        ])
        message.reply({ embeds: [embed], components: [actionRow] })
forest elm
#

can you show the full client constructor?

ebon tiger
forest elm
#

if thats where you're constructing the client, sure.

ebon tiger
#
const { Client, GatewayIntentBits, Partials, Collection } = require('discord.js');
const client = new Client({
    intents: [
        GatewayIntentBits.Guilds, 
        GatewayIntentBits.GuildMessages, 
        GatewayIntentBits.GuildPresences, 
        GatewayIntentBits.GuildMessageReactions, 
        GatewayIntentBits.DirectMessages,
        GatewayIntentBits.MessageContent
    ], 
    partials: [
    Partials.Channel,
    Partials.Message, 
    Partials.User, 
    Partials.GuildMember, 
    Partials.Reaction] 
});

//const fs = require("fs");
//const Enmap = require("enmap");
const colors = require("colors");
const config = require('./settings/config.json');
require('dotenv').config();
module.exports = client;

client.commands = new Collection()
client.aliases = new Collection()
client.events = new Collection();
client.slashCommands = new Collection();


["event","command","slash"].forEach((handler) => {
  require(`./handlers/${handler}`)(client)
});


client.login(process.env.TOKEN)
forest elm
#

you're not setting the allowedMentions?

ebon tiger
forest elm
#

adding allowedMentions: { repliedUser: false } will disable the mention on the reply

#

either to the client options or to message.reply()

ebon tiger
#

@forest elm Sorry for tag , but how this fix..

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

CODE

 embeds: [
                        new EmbedBuilder()
                            .setColor(`RED`)//This line get error.
                            .setAuthor({ name: `${member.user.tag}`, iconURL: `${member.user.displayAvatarURL({ dynamic: true })}` })
                            .setTimestamp()
                    ],
                })
dull widget
#

what is wrong here?

copper jetty
dull widget
#

intents?

copper jetty
plucky patrol
scarlet tangle
#

Does <ChatInputCommandInteraction>.options.resolved.attachments return a collection of the attachments that were sent with the interaction?

idle galleon
green plume
#

How to check if the bot has permission in a specific channel, not in roles. Like the bot have Send Message permission in roles but not in channel. So, how can I get weather it have permission in channel or not?

knotty plover
#

channel.permissionsFor(client.user).has(PERMISSION)

polar night
#

is v14 out ??

vague coyote
#

Does it look released

knotty plover
#

no ??

vague coyote
#

exactly

glass lodge
#

yea

regal umbra
#

what is interaction.options.getSubcommand() this in v14?

forest elm
#

that's what it is

lusty cairn
#
Error: Unsupported MIME type: image/webp
    at Jimp.throwError (D:\Scarface\node_modules\@jimp\utils\dist\index.js:33:13)
    at Jimp.parseBitmap (D:\Scarface\node_modules\@jimp\core\dist\utils\image-bitmap.js:198:32)
    at Jimp.parseBitmap (D:\Scarface\node_modules\@jimp\core\dist\index.js:431:32)
    at D:\Scarface\node_modules\@jimp\core\dist\index.js:373:15
    at D:\Scarface\node_modules\@jimp\core\dist\index.js:115:14
    at D:\Scarface\node_modules\@jimp\core\dist\request.js:48:9
    at IncomingMessage.<anonymous> (D:\Scarface\node_modules\phin\lib\phin.compiled.js:1:2100)
    at IncomingMessage.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)```
#

does anyone know about this problem?

forest elm
lusty cairn
gentle coyote
#

slash commands does not have a permission property yet that i can set that only allows administrators to use that command right? or am i mistaken

#

or should i just manually handle the interaction and check the member's permissions

night light
#

What version of Node.js does Discord.js v14 require?

hoary horizon
gentle coyote
forest elm
#

the command does not show up at all in the client if they dont have the default member permissions

#

and if it does, it was either overridden or they're using an older client

gentle coyote
#

ahh thanks does it only work on the main command or can i do it differently for sub-commands

night light
#

What is the alternative to dynamic in <User | GuildMember>#displayAvatarURL()

uncut kelp
#

It's already dynamic

digital sequoia
knotty plover
#

Something before that line preventing it from responding?

digital sequoia
#

I removed the code and copyed 1to1 the same code again

#

and now it works idk xd

river harbor
#

This code await role.members.forEach(async member => { await member.user.send({ embeds: [embed] }).catch((error)); }); returns TypeError: Cannot read properties of undefined (reading 'id') at GuildMemberRoleManager.get cache [as cache] (/workspace/node_modules/discord.js/src/managers/GuildMemberRoleManager.js:37:101) at /workspace/node_modules/discord.js/src/structures/Role.js:158:57 at Map.filter (/workspace/node_modules/@discordjs/collection/dist/index.js:156:11) at Role.get members [as members] (/workspace/node_modules/discord.js/src/structures/Role.js:158:37) at Module.execute (file:///workspace/src/interactions/dm.js:18:26) at processTicksAndRejections (node:internal/process/task_queues:96:5)

idle galleon
river harbor
idle galleon
#

Well, the everyone role doesn’t seem to be cached

river harbor
#

Well that's odd. It should be.

#

Do you require an intent for that?

idle galleon
#

Just Guilds intent

river harbor
#

Oh I removed that-

idle galleon
#

You should enable it, otherwise d.js is rather useless

#

Better off using http interaction at that point

river harbor
#

HTTP Interactions aren't supported on DJS are they 🙄

idle galleon
#

That’s not within the scope of d.js

#

D.js focuses more on the bot api

#

You could still make use of the rest package and discord-api-types

#

There should be other packages that do focus on http interactions tho

viscid creek
#

Bit of a weird issue:
When I deployed my v14 project to my linux vps I ran into some pathing issue that I fixed, however now that it has been fixed, my file handler will throw an error when I require a file that has a ContextMenuCommandBuilder class attached to it the error is non-descript error of "TypeError: process.EventEmitter is not a constructor", when I went through the error from restler js a dependency of something it was something to do with URLs

The reason I am asking here is because all my other commands work with my handler, except the context menu commands
local & vps d.js v: discord.js@14.0.0-dev.1657757514-fe34f48
local & vps d.js/b v: @discordjs/builders@0.16.0-dev.1657757509-fe34f48

my file handler:

const { readdir, lstat } = require('fs').promises;
const p = require('path');

let paths = [];

module.exports = async bot => {
    await findFiles(p.resolve('./interactions/'));

    for (let file of paths.filter(x => x.endsWith('.js'))) {
        console.log('trying', p.resolve(file));
        let exported = require(p.resolve(file));
        console.log('found', file);
        exported.path = file;
        bot.interactions.set(exported?.command?.name?.toLowerCase() || file.split('//')[file.split('//').length - 1].split('.')[0], exported);
    }
}

async function findFiles(path) {
    for (let file of await readdir(path)) 
        ((await lstat(p.join(path, file))).isDirectory()) ? paths.concat(await findFiles(p.join(path, file)) || []) : paths.push(`${path}/${file}`);
    return paths;
}

my working command file structures:

module.exports = {
  command: new SlashCommandBuilder()
    .setName('ex'),
  run: async (interaction, args) => {
    
  }
}```

my-nonworking context:
```js
module.exports = {
  command: new ContextMenuCommandBuilder()
    .setName('Example')
    .setType(ApplicationCommandType.Messaage),
  run: async (interaction, args) => {
    
  }
}
#

sorry if it's not d.js related, I just think it might be? since they are the same just wont work with context menus?

#

If you want to try and reproduce I can send you my actual code as well

nova sonnet
#

when the djs v14 is going to release? any ETA

jolly birch
#

When it’s ready

nova sonnet
jolly birch
nova sonnet
#

Okie thnks

weary arch
steel haven
# weary arch bruh 💀

Anything valuable you‘d like to add or did you just want to reply (and maybe even ping) to this person in a support chat without any valuable information?

nova sonnet
rare rivet
#

Hi do you know how to put a text on a hyperlink text in discord embeds, like that :

#

I finally found, I let you that there for person who don't know :
text

plain roverBOT
#

Tag suggestion for @rare rivet:
You can use markdown syntax to display clickable links in embeds, webhook messages and interaction responses without showing the url:

"[text](url)"
'[text](url "optional hovertext")'
"[text](url 'optional hovertext')"

• Embeds only support this in description and field values

rare rivet
#

thanks @hoary fox x)

river harbor
#

what is the latest dev release?

knotty plover
#

Check GitHub

#

Or npm

river harbor
#

cant find it on either, only the stable releases

knotty plover
#

Versions

river harbor
#

Ah thanks. I wasn't even looking in there

hybrid zealot
#

What is that home?

knotty plover
#

?

shell summit
#

can i use slash commands in bot dms

crude valley
#

Yes if they're registered globally

hoary fox
regal mason
#

When receiving Select Menus, how I can get the selected values ?

regal mason
#

thx

plain roverBOT
vague coyote
#

Did you know, posting code without any context doesn't help anyone?

outer bane
#

most likely missing partials or intents

#

capital c

digital sequoia
#

Short Question how do I do this in v14?

channel.permissionOverwrites.edit(interaction.guild.id, {USE_VAD: false}).catch(err => { })
digital sequoia
#

thx mate

copper jetty
#

and you need to use ChannelType enum instead of string

hoary fox
#

member.voice.channelId

#

ah okey

flat ice
#

Yeah you cant acces 'member' if it was executed in dms.

copper jetty
#

get the member from cache using message.author id

flat ice
#
  • member might not be in the cache
vague coyote
#

fetch the member instead

#

fetch returns a promise

#

also you dont need to fetch guilds

#

client.guilds.cache.get('guildId')

#

looks good to me

#

then you are either missing the GuildVoiceStates intent or that member simply isnt in a voice channel

steel haven
#

And you are in a VC of that guild?

copper jetty
#

wrong guild id

steel haven
#

And is the bot in that guild? And is the client ready?

#

console.log(client.guilds.cache) then

#

Does it have Guilds intent?

#

Were you already in the VC when the bot started?

#

Ah, nvm, the guild wasn’t in cache, not you…

#

Guess the guild was unavailable then…

low tundra
#

Hey, when I start my bot I get this :

faint elk
#

Why it doesn't ping the role?

const { ButtonBuilder } = require("discord.js");

message.channel.send({ components: [{ type: 1, components: [new ButtonBuilder().setLabel("123").setCustomId("123").setStyle(1)]}] }).then(msg => {
const collector = msg.createMessageComponentCollector();
collector.on("collect", (btn) => btn.reply({ allowedMentions: { parse: ["roles"] }, content: "<@&ROLE_ID>" }))
})

https://i.xaliks.fun/a78c21.png

low tundra
#

maybe delete the allowedMentions: { parse: ["roles"] } part? I never use it and it works for me 🤷‍♂️

copper jetty
low tundra
steel haven
low tundra
#

thanks I just realized that nearly no dependencies are working with v14

copper nymph
#

I am looking at sending a message on kick/ban commands succeeding, but I want to attach a gif to the message that is sent to the channel the command is run in. I cannot find how to do this in the docs. Is it done by passing the URL of the gif into the attachment builder and then adding the attachment to the message?

copper nymph
#

Thanks

hoary fox
#

u want to get channel member count?

#

so <voiceChannel>.members.size

#

and its recommended to fetch members before it

stuck fiber
#

Anyone getting UNKNOWN unknown err: read coming from shapeshift? i am on djs ^14.0.0-dev.1657757514-fe34f48

earnest linden
#

Someone

steel haven
unreal cedar
#
[Error] TypeError [CommandInteractionOptionType]: Option "threshold" is of type: 4; expected 10. TypeError [CommandInteractionOptionType]: Option "threshold" is of type: 4; expected 10.
    at CommandInteractionOptionResolver._getTypedOption (/app/node_modules/discord.js/src/structures/CommandInteractionOptionResolver.js:99:13)
    at CommandInteractionOptionResolver.getNumber (/app/node_modules/discord.js/src/structures/CommandInteractionOptionResolver.js:182:25)
    at SetThresholdCommand.execute (/app/dist/commands/set-threshold.js:34:47)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async InteractionEvent.execute (/app/dist/events/interactionCreate.js:17:13)

full error
Please fix this most of my slash commands are not unusable because of this

https://gist.github.com/link-discord/7ea9447dc6b0328f8edd836c758326ac

#

I am using the latest version and I use all the right stuff and my code worked for months and suddenly it stops working for no reason

#

maybe an api change but I can't fix this because its in discord.js and not in my code

dusky portal
open copper
#

can I have a docs for modal?

unreal cedar
plain roverBOT
#

class Modal
Represents a modal (form) to be shown in response to an interaction

open copper
#

thanks

unreal cedar
open copper
dusky portal
unreal cedar
open copper
unreal cedar
#

Can't the djs devs just push something to update the enum

dusky portal
# open copper wdym?

Go onto google or whatever search engine and find examples on how modals can be used

dusky portal
unreal cedar
#

Ok

dusky portal
#

But you could also wait for someone to talk to you here about things you may have missed in your code while they have been changing v14 darkShrug

unreal cedar
#

Im preeetty sure I haven't missed anything

open copper
#

how do I get the types in modal e.g. ButtonStyle.Primary

steel haven
unreal cedar
#

Nah I already found the issue

#

My type was set to integer but I used the getNumber function not getInteger

steel haven
#

In the code you provided you had the type set to number though. So you didn’t deploy that command with that code

crude valley
#

I am so confused, oldMessage.content and newMessage.content return the same value, but I am editing the content of this message

copper jetty
#

if you fetch old message it will be the new message

crude valley
copper jetty
#

no

crude valley
#

Oh okey

stuck fiber
# stuck fiber

well, i turned off my computer last night and just turned it on again, its working 🤣

earnest linden
#

Anyone

#

Am trying to make it where it will randomly pick an image

vague coyote
#

you are passing the array instead of the picked image to setImage()

earnest linden
#

Wdym?

vague coyote
#

I mean what I said

#

why do we always have to explain it twice

uncut kelp
vague coyote
#

yeah

earnest linden
#

Cuz if u explain easier itll be easier for me to understand

vague coyote
#

I suggest you take your time and learn JS.
If I explain it "easier" I would be spoonfeeding.

earnest linden
#

Nvm i got it

wintry crescent
#

Hello

#

Guys my message creat isn't working!

#

Discord.js v14

plain roverBOT
#

Tag suggestion for @wintry crescent:
To help you we need more information:
• What are you trying to do?
• What is your code?
• What errors and debug logs do you have?

forest elm
#

also show the intents you're using

wintry crescent
# plain rover *Tag suggestion for <@766240913050697748>:* To help you we need more information...

Message create isn't working.

const config = require("../Configuration/config.json")

module.exports = {
    name: `messageCreate`,
    async run(message, { client, Discord, snipe }) { 

      const prefix = config.prefix
        if (message.content.startsWith(prefix)) {
  const args = message.content.slice(prefix.length).trim().split(/ +/g)
    const commandName = args.shift()
    const command = client.commands.get(commandName)
          //Getting PREFIX
          
          if(!command) return message.channel.send({content: "That is not a valid command! **Op!help** for commands!"})

     
  command.run(client, message, args)
  }
}
}
forest elm
wintry crescent
forest elm
#

show the client constructor

wintry crescent
#
const client = new Discord.Client(
  {intents: ["GuildMessages", "GuildMembers"]}
  
);
vague coyote
#

you are missing Guilds

wintry crescent
#

Oo okay!

wintry crescent
forest elm
#

yes

wintry crescent
#

Or partial?

#

Okay

forest elm
#

no partials needed, unless you're expecting dm messages, but if you are you are also missing more intents

wintry crescent
#

Oo

#

Still not working!

vague coyote
#

why did you switch to magic numbers now instead of just adding Guilds

wintry crescent
#

Aslo streaming status isn't working!

wintry crescent
#

Oo sorry, spelling mistake 😅

vague coyote
#

what even is Ideal

#

that doesnt exist

forest elm
#

you have to use the ActivityType enum

#

and yeah, ideal is not a thing

wintry crescent
crude valley
mossy cosmos
copper jetty
mossy cosmos
#

thanks

terse mirage
#

Now, why the error?

knotty plover
#

Would need to see the code before that point

terse mirage
#

In my interaction event, have this "isChatInputCommand()"

knotty plover
#

I don't see any typeguarding here though

#

Or types at all really

#

And this is a message type anyway, which is a context menu

#

Not a slash command

#

It can't have subcommands

terse mirage
#

So, can't have subcommand?

jaunty vault
#

Yes, it was just said, they can't have sub commands

wintry crescent
#

Please help someone.

grim sigil
#

I just updated to djs v14.0.0-dev.1657757514-fe34f48 and I get this error, does anyone else have problems with ESM?

scarlet tangle
#

what can i change it to???

icy dew
olive wraith
#

where is the isAutocomplete method

jolly birch
#

you check the interaction type now for autocomplete

olive wraith
#

now give this error

jolly birch
olive wraith
#

okey thx

mental inlet
#

asking this question again, how can I not let the user run a command again after they run it once (no I don't mean saving data even when the bot is offline). this is for a fidget spinner command

dawn phoenix
#

your question includes the answer to your query

#

there is no "one time use" or native cooldown in slash commands
save the user id, compare it before doing whatever and tell the user they already used it or something

lethal trail
#

is there any changes in client activity status? if yes please give the link to that topic as im unable to find it.

dawn phoenix
#

explaining the issue would help massively with finding the solution

lethal trail
dawn phoenix
#

and i'm asking to show what you are doing and to explain the issue

#

if you don't have any, look at the docs on Client

lethal trail
#

ok

floral prism
#

Hi I wanted to know that in v13 to send the attachment inside embed, we had something like this,

.setImage("attachment://chart.png")
interaction.editReply({
  embeds: [response],
  files: [attachment],
})

But it's not working in v14. What is the new format to attach it inside the embed?

copper jetty
#

its the same in v14

floral prism
#

Ok I'll try again

#

But it's not working

#

Nvm fixed it

crystal valve
#

I have

      interaction.reply({
        content: `@everyone`,
    allowedMentions: { parse: ['roles']}
      });```
the bot doesn't ping everyone
i've also tried `<Interaction>.channel.send` rather than `.reply()`

the bot has admin in the server, and so do I.
vague coyote
crystal valve
#

ah alr

vague coyote
#

and interaction.reply() relies on @ everyone perms until the end of the month

crystal valve
vague coyote
#

Like I said, interaction replies rely on the perms of @ everyone, since its a webhook

crystal valve
#

oh ok

pliant salmon
#

I was recoding some stuffs and reading the changes but i came across this

#

Nvm i was using ChatInputCommandInteraction instead of CollectedInteraction

velvet jasper
#

That error is correct an interaction can’t be both application command and a modalsubmit

pliant salmon
#

Yeah it was just weird at first glance because it worked on the old version but was an issue on my side

green plume
#

Is it possible to get the role id of the booster role of a server?

plain roverBOT
scarlet tangle
boreal kraken
#

waveBoye is there any way to check to see if my bot is getting rate limited? The client even for "rateLimit" doesnt exist anymore

jaunty vault
#

client.rest has the event now iirc

boreal kraken
#

ty

crystal atlas
#

Question, any breaking changes between 27d8deb and the release version? 🙂

#

Also, any ideas how to get around this?

scarlet tangle
#

Im having the same issue

uncut kelp
#

Hold

dusky agate
#

help

uncut kelp
#

No one can help you

#

(:

dusky agate
rain bramble
#

Is it supposed to be like this in the release?

uncut kelp
#

But it's being fixed atm dw

bitter schooner
#

Whoops

crystal atlas
#

Seems to be updating now 🙂

gentle iron
slate mango
#

Shadow's issue is a different one

#

It's an issue caused by 14.0.0, it's fixed in 14.0.1

high jacinth
#

interesting

dawn phoenix
#

deploying guide, changing from deploy preview

supple musk
dawn phoenix
#

or click new link

supple musk
#

jeah

high jacinth
#

yeah that's what I did (clicking through the warning), just figured I'd mention it

supple musk
#

What is the new link?

hoary fox
#

nice

limpid owl
#

These methods have been omitted, but I could not find anything related in the breaking changes guide
Am I supposed to use purely get now? If so, getUser and getMember haven't been omitted then

knotty plover
#

They haven't been removed

copper jetty
knotty plover
#

You havent typeguarded the interaction correctly, yeah

limpid owl
#

oh wait, I got it, thanks

#

Ahhh okay, the type changed, CommandInteraction => ChatInputCommandInteraction

dim lichen
dull mulchBOT
dim lichen
#

Thansk

low tundra
#

I searched a bit in the documentation and did not find anything about that : is there a way to get the channel where the automod sends it's logs please?

fierce lantern
#

not yet, there's a pr for automod though

knotty plover
#

Not yet, Discord has been really slow merging their documentation

#

And we dont merge features until the documentation is final

low tundra
#

okay thanks

#

so it should appear in some times?

knotty plover
#

Yeah

low tundra
#

oh 🤔

knotty plover
#

Will be supported once Discord finalises it

#

You can see there's still 2 PRs we're waiting on

low tundra
#

okay thanks !

#

that would be very useful lol

scarlet tangle
#

Hey, I couldn't find a fix to this anywhere, but how do you know if a interaction was made by a slash command? If I try interaction.IsCommand() it errors out

knotty plover
#

isChatInputCommand

scarlet tangle
#

I am using discord.js@dev

#

Perfect, thanks!!

knotty plover
#

If you're going to update to v14 make sure you check the changes guide

scarlet tangle
#

Last time I even touched a bot was v12, its so different now lol

knotty plover
#

Yeah most likely

scarlet tangle
knotty plover
#

Yeah, the docs default to the main branch

plain roverBOT
#

Suggestion for @scarlet tangle:
discord **Guild: **
read more

scarlet tangle
#

bruh

scarlet tangle
knotty plover
scarlet tangle
#

ty

scarlet tangle
#

Hey, ran into another issue..

I'm making a kick command, so at the time of the kick, the bot would make sure the user has the kick perms, but upon checking for it, I get this error

Error [GuildUncachedMe]: The client user as a member of this guild is uncached.

#

heres my code

#

If you do decide to help me, thanks! Just give me a ping, so ik when to come back

uncut kelp
#

discord.js can only check the permissions of your bot if it knows it exists in the server

scarlet tangle
#

alr

#

wait,

uncut kelp
#

If it doesn't know it exists, it doesn't know its permissions, it won't know what to do

scarlet tangle
#

i check to make sure the member exists lol

#

member

uncut kelp
#

Fetch yourself

scarlet tangle
uncut kelp
#

If you want

scarlet tangle
scarlet tangle
uncut kelp
#

Seems you are not fetching correctly then

scarlet tangle
#

client.users.fetch('id') ?

#

<Guild>.members.fetch('id')?

#

Try this^

#

oh ok ty

#

Error [GuildUncachedMe]: The client user as a member of this guild is uncached.

#

the bottom line there is the line the error is complaining about

knotty plover
#

whats user here

#

It seems like its not the client user

scarlet tangle
#

yeah cuz its a kick command

knotty plover
#

yeah so... not the client user

idle galleon
#

Client user needs to be cached as member to make sure thte user can be kicked

scarlet tangle
#

mhm

idle galleon
#

He’s using member.kickable

scarlet tangle
idle galleon
#

The bot is always cached as a member in every guild on ready, the only way it’s uncached is if ur uncaching it

scarlet tangle
#

I dont believe I am though

idle galleon
#

Did you enable the guilds intent?

scarlet tangle
#

guess not

idle galleon
#

Yea, you need at least the Guilds intent

scarlet tangle
#

fr ok, one sec how many tabs do I have open rn lmao

#

so, does v14 have like a different way of enabling intents or smthn?

idle galleon
#

It’s now IntentsBitfield.Flags.Guilds

#

There’s also GatewayIntentBitfield.Guilds

#

Hopefully I spelled those correctly blobsweats

scarlet tangle
#

so do i do intents: [IntentsBitfield.Flags.Guilds]

idle galleon
#

Yea

scarlet tangle
#

alr

#

fr i gotta define intentsbitfield

knotty plover
#

Well, import it

scarlet tangle
#

do u know by heart how to, to save another tab from being opened?

knotty plover
#

import it from discord.js

scarlet tangle
#

k

#

oh wait nvm ik what i did wrong

idle galleon
#

global.client blobsweats

scarlet tangle
idle galleon
#

Is it BitField?

plain roverBOT
scarlet tangle
idle galleon
#

Make Field capital

scarlet tangle
#

same fr

idle galleon
#

You have to change both of them…

scarlet tangle
#

OH

#

me up at midnight be like

#

i mean, it kinda works, just how do i find the kickable property in member?

#

cuz it is a guildmember obj

scarlet tangle
plain roverBOT
scarlet tangle
idle galleon
#

It’s a getter

scarlet tangle
#

oh wait so after I fetch, I have to get it?

idle galleon
#

Logs won’t show getters

#

No

scarlet tangle
#

OH

#

*breaks desk*

#

i wasted so much time, thinking that my results were false, when in reality, i forgot to give my bot the kick members perm

#

tysm guys tho

plain roverBOT
#

Suggestion for @scarlet tangle:
discord **Permissions: **
read more

#

Documentation suggestion for @scarlet tangle:
property (static) Permissions.FLAGS
Numeric permission flags. All available properties: (more...)

#

Documentation suggestion for @scarlet tangle:
method PermissionsBitField#has()
Checks whether the bitfield has a permission, or multiple permissions.

knotty plover
scarlet tangle
#

oh sry

paper sparrow
#

sooo.

#

v15 when?

velvet jasper
#

Tomorrow

thick pawn
#

31st September 2022

marsh smelt
#

blue>blur

plain roverBOT
#

Suggestion for @regal umbra:
guide Popular Topics: Embeds
read more

scarlet tangle
#

hi, can sb help me?

knotty plover
#

Syntax error, just fix your JS

plain roverBOT
floral prism
prime ridge
floral prism
floral prism
#

This is where you're making the attachment

#

Rest will be same

prime ridge
scarlet tangle
#

Hey, I'm back again :/

So why is my slash command still not coming up if you're not an admin?
I used to set its default permission to kick or ban members, but I removed it, restarted the bot, and waited a whole day, still not coming up..?

#

heres how I set up the cmd:

const data = new SlashCommandBuilder()
    .setName('kick')
    
    .setDescription("Kicks a user from the server.")
    
    .addUserOption(option => option.setName('target').setRequired(true).setDescription("The user to kick."))
    .addStringOption(option =>
        option.setName('reason')
            .setDescription('What to tell the user about the kick.')
            .setRequired(false))
#

Any idea?

#

Should I report it as a bug?

uncut kelp
#

Pretty sure Discord intended it to be that way. Default member permissions only apply when it joins a server or something

#

Someone correct me if I'm wrong

scarlet tangle
#

so I have to make it rejoin?

scarlet tangle
fervent umbra
#

does anyone know hot to kick a bot from a voice channe using discord.js @13.1

scarlet tangle
scarlet tangle
#

bru

fervent umbra
#

i am new in this server i didnt noticed there're 2 chat for v13 n v14

plain roverBOT
fervent umbra
scarlet tangle
#

np

opaque narwhal
plain roverBOT
#

class Client (extends BaseClient)
The main hub for interacting with the Discord API, and the starting point for any bot.

#

Documentation suggestion for @soft maple:
class Client (extends BaseClient)
The main hub for interacting with the Discord API, and the starting point for any bot.

steel haven
scarlet tangle
#

Why am I getting TypeError [InvalidType]: Supplied options is not an object. when banning a user, its litteraly the same as my working kick command, but replaced kick with ban

forest elm
#

show the code

scarlet tangle
#

idk if you need a certain part of it or not, but I'll just send u my whole messy ban.js file (1 sec making a hastebin)

forest elm
#

just the part that bans the member

plain roverBOT
#

Documentation suggestion for @scarlet tangle:
method GuildMember#ban()
Bans this guild member.

scarlet tangle
#

its in the file

forest elm
#

as the error told you, it takes an object now

scarlet tangle
#

and not the kick?

scarlet tangle
forest elm
#

kick doesn't because the reason is the only thing you can set

scarlet tangle
#

one more question, is there a limit, or certain numbers u can put in delete message days?

#

cuz im thinking about adding an option for the user to add that number

scarlet tangle
#

alr

#

ty

pliant salmon
#

does the filter option on the collector still gets the interaction as its first input?

hoary fox
#

yea

pliant salmon
radiant jasper
#

I wonder, is multiple choice coming to modals?

knotty plover
#

maybe

#

For now, only text

radiant jasper
#

Nice!

knotty plover
#

Select Menus are coming "soon"

radiant jasper
#

Ok, also will modals be able to read labels after a user submitted them? Rather than just IDs and Types.

knotty plover
#

Not sure what you mean

radiant jasper
#

After a user submits a modal. You can figure out what they responded to for the text, whether it was a short or long response. However, you cannot get what the question was.

#

For my above form to work, I just snuck the questions in the id.

knotty plover
#

Yeah thats what you should do generally speaking

#

Discord doesnt send back static data you should have on your side already, would be a waste of bandwidth

#

Can just look up the question in the modal builder data from the customId

radiant jasper
#

Ah.

scarlet tangle
#

Why am I getting this error? TypeError: MessageButton is not a constructor

#
const { ApplicationCommandOptionType, MessageActionRow,  MessageButton, MessageEmbed } = require("discord.js");

const { PermissionFlagsBits } = require('discord-api-types/v10');
const yesButton = new MessageButton()
.setCustomId('yes')
.setLabel('Yes')
.setStyle('SUCCESS')
.setDisabled(false);
scarlet tangle
#

oh ty

scarlet tangle
copper jetty
#

and ActionRowBuilder

#

adn you can import PermissionFlagsBits from discord.js because discord.js reexports everything from discord-api-types

wanton aspen
#

I also have the same problem, ok but how do I solve this now, how to add connection time

ionic wren
scarlet tangle
#

Hi, how to compare bitfield permissions?
I have channel.permissionsFor(role) and this function returns bitfield, how can I check if role has for eg. VIEW_CHANNEL permission?

knotty plover
#

In what version?

#

In Dev you would add .has(PermissionFlagsBits.ViewChannel)

scarlet tangle
knotty plover
#

yeah, as above then

scarlet tangle
#

okay, thank you!

regal mason
#

So now it's v15 ?

hoary fox
regal mason
#

Ah okay

knotty plover
#

14.1

dawn phoenix
#

or 14.0.x
depends firL

knotty plover
#

Milestone is 14.1 tho

uncut kelp
#

I assume the patches just gets picked out of them

#

If needed

knotty plover
#

Yeah if a patch release is needed it shouldn't be sitting in dev very long lol

uncut kelp
#

Ooh mhmm

woven grove
#

do we have anything that needs an immediate release

#

I guess the emoji thing

uncut kelp
small bloom
#

is there a way to set the attachment type in slash commands? Because I don't want to accept everything, is crashing the bot

hoary fox
#

no

gloomy kayak
#

You can check the file type when you receive it

#

file.contentType is the MIME type of the file

hoary fox
#

yea byt u cant set file type to optiom

small bloom
hoary fox
#

yea but contentType did it for you

small bloom
#

is there a list of the types?

hoary fox
#

idk google it but really much

small bloom
#

ok ty

ivory dirge
#

Fro vetified bots
All intents are disabled

When im trying to run mt bot :

const client = new Client({intents : [] })
App listening at votre site oauth2.
AuthBot connecté !
[SUCCÈS] BASE DE DONNÉE CONNECTÉE
/
WebSocketManager.js:245
        throw new Error(WSCodes[error.code]);
              ^

Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
    at WebSocketManager.createShards (/home/runner/Verify-work/node_modules/discord.js/src/client/websocket/WebSocketManager.js:245:15) {
  [Symbol(code)]: 'DISALLOWED_INTENTS'
}
repl process died unexpectedly: exit status 1
 
hoary fox
#

sus are sure that is it this client

ivory dirge
#

How can ifix it

ivory dirge
scarlet tangle
#
How are you```
vague coyote
valid idol
#

help me pls

#

how can i fix it in visual studio code

vague coyote
#

update nodejs