#djs-in-dev-version
1 messages · Page 30 of 1
Select menus in modals are also supported by d.js but also not documented 
these are what radio buttons should look like probably

djs wont support stuff until its documented by discord.
My channelTypes in slash commands doesn’t work but I did it right
its just Attachment now
what does it mean??
addComponents takes an array
Does anyone have an example where I can see how to make radio buttons in modals?
Greetings all,
I am encountering a peculiar error with messageComponentCollectors. I have a definition module which adds and listens to buttons on messages to flip the embed definition in a sort of "pages" system. However, when a message with an active collector is deleted, my bot immediately crashes with the error attached bellow. The stack trace shows that all is coming from within Discord.js itself, and unrelated to my code. May I receive some insight on how I may fix this issue?
u cant?
it's here but
But? 
it looks fake
Lol the modal is definitely fake 😂
Launching from an older version of my bot from source control, the same issue occurs in Discord.js v13 as well. I shall ask this question in a separate channel in hopes of finding a resolution.
hey, there is anything new after the Modal update? i mean new bot features like modals & inputs, etc? thx 😄
no
Hey, what are these new embeds called?
Nothing about this is new
thats a suggestiong in github and in the ddevelopers server its not an actual preview
"that would be good" ≠ confirmed
Hello, I don't understand an error
C:\Users\zazbi\Documents\Nael\PROGRAMMATION\DiscordBots\TicketBot\node_modules\@discordjs\rest\dist\index.js:714
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, res.status, method, url, requestData);
^
DiscordAPIError[50035]: Invalid Form Body
data.components[0].components[1][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[2][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[3][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[4][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
at SequentialHandler.runRequest (C:\Users\zazbi\Documents\Nael\PROGRAMMATION\DiscordBots\TicketBot\node_modules\@discordjs\rest\dist\index.js:714:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\zazbi\Documents\Nael\PROGRAMMATION\DiscordBots\TicketBot\node_modules\@discordjs\rest\dist\index.js:517:14)
at async ChatInputCommandInteraction.showModal (C:\Users\zazbi\Documents\Nael\PROGRAMMATION\DiscordBots\TicketBot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:243:5) {
rawError: {
code: 50035,
errors: {
data: { components: { '0': { components: [Object] } } }
},
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'post',
url: 'https://discord.com/api/v10/interactions/982716556779851857/aW50ZXJhY3Rpb246OTgyNzE2NTU2Nzc5ODUxODU3Om9nYVZtZVhTUU51QkVsd2J4TE1BSVl0YVV5RFY1Umx2TmREZjJ3Rkd5TmE4VzJqQzY2eENSa3pNYUlFZWZDd0o3VlBkQ09kS1NhdnlBTTJFbmJ3OURyWlpwYlR1cGFiOWV2NGkzdlRtNjhFWFVMaGpMU2s0clo4ZGlYUFRtNTcw/callback',
requestBody: {
files: undefined,
json: {
type: 9,
data: {
title: 'Choices',
custom_id: 'modal_data',
components: [ { type: 1, components: [Array] } ]
}
}
}
}```
Modal before the show modal:
{
"title": "Choices",
"custom_id": "modal_data",
"components": [
{
"type": 1,
"components": [
{
"type": 4,
"custom_id": "label_0",
"label": "Choice n°1",
"placeholder": "Your answer",
"required": false,
"style": 1
},
{
"type": 4,
"custom_id": "label_1",
"label": "Choice n°2",
"placeholder": "Your answer",
"required": false,
"style": 1
},
{
"type": 4,
"custom_id": "label_2",
"label": "Choice n°3",
"placeholder": "Your answer",
"required": false,
"style": 1
},
{
"type": 4,
"custom_id": "label_3",
"label": "Choice n°4",
"placeholder": "Your answer",
"required": false,
"style": 1
},
{
"type": 4,
"custom_id": "label_4",
"label": "Choice n°5",
"placeholder": "Your answer",
"required": false,
"style": 1
}
]
}
]
}
1 action row per text input
An action row can only contain a single text input
I can't seem to get permissionOverwrites to work for channels. It doesn't throw any error, but it doesn't add the permission in the channel either. Here's the code:
const newChannel = await interaction.guild?.channels.create(channelName, {
topic: `Donator channel: ${interaction.user}.`,
permissionOverwrites: [{ id: interaction.user.id, allow: ["ViewChannel"] }]
}).catch((err) => { return interaction.editReply({ content: "Error creating the channel.\n" + err }); });
You need to specify if is a user permission or a role permission
how do I specify?
you shouldn't need that?
is there a PR for get guild member's banner?
With "type" key in permissionOverwrite object
Value is OverwriteType enum
bots cant get banner, just like they cant get the about me
idk why
oh wrong screenshot
Yeah, for members. To get their url
my original question ^ ._.
Was merged 13 days ago
But I don't think you get the banner hash for guild members currently
So the data necessary to generate it isn't available
hours* no?
aren't banners on users, not guild members?
Oh, yeah hours
per guild banner
you can set banner per guild if you have the nitro upgrade
Definitely can't get guild banner
oh lol, since when
I always thought its just avatar
3 months or more
i tried, but it still did nothing.
User#bannerURL()
A link to the user's banner. See [User#banner](<https://discord.js.org/#/docs/discord.js/main/class/User?scrollTo=banner>) for more info
The user with permission is on the guild?
yep, it should be
sad
it creates the channel and adds the topic, but not the perms
data are info received by the API?
Yes
honestly if the user is present on the guild I do not see why the permission is not added
yeah I find it weird too. I also tried this way, but no luck either.
(newChannel as Discord.TextChannel).permissionOverwrites.create(interaction.user, {
"ViewChannel": true
})
using .then() instead of await seems to have fixed the issue.
It there any way the bot can send a messages to a text-voice-channel?
yes <VoiceChannel>.send()
Hello I have a error :
Type 'ActionRowBuilder<SelectMenuBuilder>' is not assignable to type 'ActionRowBuilder<TextInputBuilder>
code:
modal.addComponents([
(await new ActionRowBuilder().addComponents([time])) as ActionRowBuilder<SelectMenuBuilder>
]);
u can put only text inputs to modals
Yeah but i want use SelectMenu to modal, how ? 🧐
its not released yet
Oh okey
It's normal when i do client.user.setActivity("Hi !", {type: "WATCHING"});, this don't work. no activity presence...
yes its normal
why?
because you need to use ActivityType enum instead of string in the type option
........
thats the name, not the type
good you found the setActivity method in the docs you just need to click the blue ActivityOptions text
You are looking at the wrong thing
"string or ActivityOptions"
you are still looking at the wrong thing
click ActivityOptions not string
still same issue
again, use the ActivityType enum to set the type or use PascalCase
aka Watching not WATCHING
not sure if it works with strings tho
decidedly i will stay idiot...

Hi, Is Text in voice channel discord built-in can be handle by discord js
yes
How ?
Feel free to look at the source code
Can you help me please I am so coufused with the source code
Why do you need to know how it works?
i think he can't find the correct files
what exactly do you want to know
What is this?
TypeError: Found non-callable @@iterator
at ActionRowBuilder.addComponents (/root/cloepremium/node_modules/@discordjs/builders/dist/index.js:532:21)
at Object.run (/root/cloepremium/SlashCommands/info/help.js:45:22)
at commandExecute (/root/cloepremium/events/guild/interactionCreate.js:107:15)
at /root/cloepremium/events/guild/interactionCreate.js:148:11
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
thats my function:
new ActionRowBuilder()
.addComponents(
new SelectMenuBuilder()
.setCustomId(`${client.user.id}_cloeHelpMenu`)
.addOptions([
{
label: `What are JSON Embeds?`,
emoji: '🗄',
value: 'jsonEmbeds',
},
{
label: `What features does Cloe have?`,
emoji: '💫',
value: 'features',
},
{
label: `Why Cloe don't give roles? (AutoRole & ReactionRole)`,
emoji: '❓',
value: 'roles',
},
]),
),
line 45 is .addComponents
(You were answered)
Not supported in discord.js now, you need to use "ts-ignore" to do that in typescript
holo
[antiCrash] :: Unhandled Rejection/Catch
TypeError: (intermediate value).setColor(...).setTitle(...).addField is not a function
at Object.run (/root/cloepremium/SlashCommands/moderation/giveaway.js:307:18)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5) Promise {
<rejected> TypeError: (intermediate value).setColor(...).setTitle(...).addField is not a function
at Object.run (/root/cloepremium/SlashCommands/moderation/giveaway.js:307:18)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
}
What is wrong with that?
const Giveaway_Embed = new EmbedBuilder()
.setColor(globalcolor)
.setTitle(`${getPrize}`)
.addField("Time Remaining", `Not started yet.`, true)
.addField("Hosted by", `${getHoster}`, true)
.setFooter({
text: `${getWinners} Winner${getWinners > 1 ? "s" : ""}`,
iconURL: client.user.displayAvatarURL({
dynamic: true
})
});
```` ?
<EmbedBuilder>.addFields
And addFields take an array
.addField is 1 to 1 the old methode from djs xd
Removed on discord.js@dev
As I said its 1 to 1 the old method
const { EmbedBuilder } = require('discord.js');
module.exports = Object.defineProperties(EmbedBuilder.prototype, {
// Append users' ranks to guild
addField: (name, value, inline) => {
return this.addFields({ name, value, inline });
}
});
Ok but addFields take an array
they thinks its easier for beginners to pass an array instead of rest parameters
Idk if its easier but for me it isnt since I know need to rewrite over 14 categorys and many functions
To be most generic
setFields take an array so addFields too
Same for setComponents and addComponents
v13 dont use an array
This isn't the v13 channels though
The plan is to add back support for both I think? It's not clear
Is there a posible to add a attachment into a modal?
No I mean like a modal submit e.g. Send your proof here: then you can send a pic
No
I think its so really cool if djs add it lol
We don’t make the features, Discord does
Ok where I can suggest?
They have their own website for suggestions/feature requests
Any links?
The last link
Why is this happening?
but it is there
and i even use that same line of code in another file and i have no issues
Well that's all that can throw an error on that line. Sure it's the right message?
I am above the bot, still the bot say me I must be above. Is this a bug of djs?
if (ctx.interaction.member.roles.highest.position < ctx.interaction.guild.members.me.roles.highest.position || ctx.interaction.member.user?.id !== ctx.interaction.guild.ownerId) return ctx.interaction.reply({ content: `${process.env.FAILURE_EMOJI} | You must be above me to use this command.`, ephemeral: true });
Do you have a higher role than it
yep
guild.members.me is the bot itself I assume right
yes
are you the guild owner?
no
Thats why it’s not working
I want the cmd to work if a user have higher role than bot as well as if the user is guild owner
Well the way you did it doesnt work
Cause ur using an or operator
Can I use like this?
if (ctx.interaction.member.user?.id !== ctx.interaction.guild.ownerId && ctx.interaction.member.roles.highest.position <= ctx.interaction.guild.members.me.roles.highest.position) return ctx.interaction.reply({ content: `${process.env.FAILURE_EMOJI} | You must be above me to use this command.`, ephemeral: true });
using an && should work
Yeah an && would work
okay
Actually @green plume what if the owner has like no roles
actually that why I have added ctx.interaction.member.user?.id !== ctx.interaction.guild.ownerId
cause owner doesn't require roles to ban someone
Exactly
the first one is false but the 2nd one is true technically cause the owner has no roles
He wants them both false
Owner can have roles
You could flip it to be a positive pass on owner
But it's fine with them both false
I want anyone of them to be false, that's why I used ||
But the || wouldn’t work for you, the person who’s not an owner
Doesn't work like that
That's why you use &&
Is there a thing where the owner is already classified as the “highest role”
No
well that means both have to be false. right?
No, both have to be true
Oh okay
Because if one condition isn't true, it won't return
Yeah exactly
ya
I was thinking as if both had to be false
So wait since the builders are gonna be in the actual api
How would I be able to access the builders
Oh so its the same package name?
for the re-exported ones yeah
doesn't discord.js export builders now? or am I tripping
So I could get the SlashCommandBuilder from discord.js
I see
should probably take a look at source
From the looks of it SlashCommandBuilder is in discord.js, but the course isnt updated
course or guide?
guide I meant
guide still uses builders
oh nevermind
I think I checked the wrong one
Hi, can sb help me?
(05.06.2022 10:06:03) [ERROR]: TypeError: TypeError: component.toJSON is not a function
import { ColorResolvable, Message, Util } from 'discord.js';
import { ActionRowBuilder, ButtonBuilder, EmbedBuilder } from '@discordjs/builders';
import { Client } from '../../classes/client';
import { ButtonStyle } from 'discord-api-types/v10';
export default async (bot: Client, message: Message) => {
if (message.channel.isDM() && !message.author.bot) {
const buttonHelp = new ButtonBuilder()
.setCustomId(`ticket-${message.author.id}`)
.setLabel('Potrzebuję pomocy!')
.setStyle(ButtonStyle.Success);
const buttonCancel = new ButtonBuilder()
.setCustomId(`ticket-${message.author.id}`)
.setLabel('Anuluj!')
.setStyle(ButtonStyle.Danger);
const buttonHelpRow = new ActionRowBuilder()
.addComponents([buttonHelp]);
const buttonCancelRow = new ActionRowBuilder()
.addComponents([buttonCancel]);
const helloEmbed = new EmbedBuilder()
.setColor(Util.resolveColor(<ColorResolvable>bot.colors.green))
.setDescription(`Witaj ${message.author}!.`)
.setFooter({ text: `Ticket - ${message.author.id}`, iconURL: message.author.displayAvatarURL() });
await message.channel.send({
embeds: [helloEmbed],
components: [buttonHelpRow, buttonCancelRow],
});
}
};
full error?
Try passing just the button on the addComponents, not an array
Also i don't think your bot can be sent a dm by your bot, right?
They seem to take an array on the latest commit. You sure this is updated?
okay, I deleted an array and it works
Make sure it's updated then.
but is it possible to put buttons inline?
Add them to the same row instead of seperate action rows
No? I don't understand the question
What's wrong here
Oh it doesn't match the jsdoc
Well one of them is wrong I guess
oh, ok thx
I want to send an embed in the voice text channel when a new voice channel is created but I don't know how to send it
would be good
which one? jsdoc or typings? 
<VoiceChannel>.send
like in a TextChannel
can I use select menu in modal ?
no
You can but is not supported by discord.js yet
iirc you can send them
when selectMenu in modal will be announced by Discord yes
idk, but you need to catch error when you send a message in voice channel because is not activated in all servers
It's a private bot for a unique server so i don't need I think
How can i show a modal?
<Interaction>.showModal()
thx
is it possible to use Attachment for create an attachment or we have to use AttachmentBuilder ?
the latter, that's why it exists
why we can contruct Attachment if AttachmentBuilder is a thing i dont understand it
the constructor is private
can I keep it if Attachment still work?
idk if it works or not, but the constructor is private, so you should not be using it
but its showing in the docs i have show privates option disabled
it might work now, but it might not work at a later stage
#8009 in discordjs/discord.js by almeidx opened <t:1654435245:R> (review required)
docs(Attachment): remove constructor doc
📥 npm i almeidx/discord.js#attachment-constructor
good job
this.client.on("ready", async () => {
const commands = this.client.commands.map((command) => ({
name: command.name,
description: command.description,
options: command.options,
type: command.type
}))
await this.client.guilds.cache.get("960547412567539763").commands.set(commands);
})
Don't refresh commands
Are you using the correct ID?
yes
it work for single guilds?
works globally, but if only one guild is used, there should be no problem.
const applyModal = new Modal()
Error:
TypeError: Modal is not a constructor
huh?
ModalBuilder

Why does typescript complain when I try to define client.commands, I have a discord.d.ts file to silence it..
discord.d.ts file:
import { Collection } from 'discord.js';
interface ExtraData {
commands: Collection<unknown, any>
}
declare module 'discord.js' {
export interface Client extends ExtraData {}
}
is that .d.ts file included in the tsconfig
🤦♂️ i completely forgot. tysm lol never knew all I had to do was just that.
can i use discord.js to write a serverless bot?
No
anyone?
new ActionRowBuilder<ButtonBuilder>() iirc
Whats wrong with that?
TypeError: components.map is not a function
Code:
const applyModal = new ModalBuilder()
.setCustomId(`${client.user.id}_apply_${interaction.guild.id}`)
.setTitle(`${interaction.guild.name} Application`)
.addComponents(
new ActionRowBuilder()
.addComponents(
comps // Array of TextInputs
)
)
addComponents takes an array
Both?
yes
thank you!
New error
Expected the value to be one of the following enum values:
| Short or 1
| Paragraph or 2
at NativeEnumValidator.handle (/root/cloepremium/node_modules/@sapphire/shapeshift/dist/index.js:1666:66)
what is comps
an array of textInputBuilders
can you show the code for them?
let comps = []
guildDB.application.questions.forEach(entry => {
comps.push(
new TextInputBuilder()
.setCustomId(`${entry.ID}`)
.setLabel(`${entry.question}`)
.setStyle(`${entry.type}`)
.setMinLength(entry.min)
.setMaxLength(entry.max)
.setPlaceholder(`${entry.placeholder}`)
.setRequired(entry.required),
)
})
How can I implement a new description to a Message's embed
EmbedBuilder.from(firstLog.embeds[0]).setDescription()
damn, thank you
well entry.type needs to be a TextInputStyle
For context components returned from the api aren’t mutable anymore, they need to be converted to a builder
can I still do this:
<fetchedEmbed>.description = "test";
return <channel>.send({
embeds: fetchedEmbed
})
```?
If TS allows that it’s unintentional and needs to be fixed
I dont use ts
It doesn't
Ok well considering js allows you to do anything unsafe, there’s nothing we can do about that
Okay so this should still work?
const Embed = message.embeds[0];
Embed.fields[1].value = `**Approved** by ${modal.user.tag}!\n**Reason from ${modal.user.username}:** ${reason}`;
Embed.color = "#098A09";
Embed.author.name = `Approved ${Embed.author.name}`;
let error;
await message.edit({
embeds: [Embed],
}).catch(err => {
error = true;
})
Or do I need <Embed>.from()
It would but you shouldn’t be modifying the cache like that
why?
Bc if you modify the cache it’s no longer in sync. The cache should only be managed internally by djs
It’s like changing the .content of a recieved message
name: 'channel',
description: 'The channel to link the event log to',
required: true,
type: ApplicationCommandOptionType.Channel,
channelTypes: [ChannelType.GuildText]
}```
can some1 lmk why this is showing all channels instead of just text channels
If you're sending raw requests, you're using camel case
are u referring to me
yes
is it meant to be channeltypes
ahh ok
Is there anyway to get a property from a Builder? Like the opposite?
No
No idea, can you please make a bug ticket for that?
Which one is correct?
message.author.id or message.author.Id
id
👍🏻
I wish I could, but I don't currently have access to github on phone. Can you?
how am I supposed to paste it when im on phone :/
ok imma just go on laptop one sec
wat
const auditLogs = await ban.guild.fetchAuditLogs({
limit: 10,
type: AuditLogEvent.MemberBanAdd,
});
const findCase = auditLogs.entries.find((log) => log.target.id === ban.user.id);
do u mean this
Just noticed it's the same for every auditLogEvent
Now it sounds more like an issue with your TS server
So what I do is this
is there a way to limit a user to only 1 option from something like this?
those arent even valid option names
its an example
either use subcommands or a single option with choices or something
im asking something else
ok
choices dont take user input right?
not sure what that means
what's the modal fields limit
idk what you're asking exactly, but if you're asking the max amount of components in a modal, its 5
You can have the max amount of 4000 characters in a field
thanks
thats not exactly what I was asking but anyway thanks
Is a Modal just an ActionRow
why is that
Ok so I just got the dev build
but the GatewayIntentBits are not part of discord.js
theyre part of the discord-api-types
@forest elm do you look?
that's right, and they are re-exported in discord.js
what if Im using just regular JS
one or more of those emojis you're passing in the values was not found
is it fine to use discordapitypes then
yes
alright thx
you can just import the enum from discord.js and use it normally
in the final build will it be in discord.js by default?
oh wait nvm they appear in discord.js now
I just needed to refresh my vs code window
@velvet jasper Why AttachmentBuilder and Attachment have unknown toJSON type?
So I was going to the buttons page on the new guide
doesnt work
app.f3e620f8.js:7 TypeError: Failed to fetch dynamically imported module: https://deploy-preview-1011--discordjs-guide.netlify.app/assets/buttons.html.263d8360.js
That’s how it was set before so I just kept it
Message#attachments
A collection of attachments in the message - e.g. Pictures - mapped by their ids
With the latest dev releases, I'm unable to send attachments, with the following error:
at findName (/srv/cosmic_goat/node_modules/discord.js/src/structures/MessagePayload.js:240:17)
at Function.resolveFile (/srv/cosmic_goat/node_modules/discord.js/src/structures/MessagePayload.js:254:31)
at /srv/cosmic_goat/node_modules/discord.js/src/structures/MessagePayload.js:221:85
at Array.map (<anonymous>)
at MessagePayload.resolveFiles (/srv/cosmic_goat/node_modules/discord.js/src/structures/MessagePayload.js:221:56)
at TextChannel.send (/srv/cosmic_goat/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:174:50)
at leveling.update (/srv/cosmic_goat/modules/leveling.js:247:31)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
AttachmentBuilder
the latter would not work, but if you mean from previous versions, yes
the different is the former returns a User instance and the latter returns raw api data
the latter didnt work so I just tried client.users.fetch()
and it seemed to work
because client.api was removed
yeah I assumed so
and it was a private thing anyway, which you shouldnt be using
oh I didnt know that
Lol I'm an idiot.
If I wanted to use the raw api I would prob be using the actual rest api I assume
so now it isn't necessary to set the fetchReply option to true for get a Message object?
from the interaction reply
Let me try without it cause I didnt know that
didn't work ._.
Same here
How would I be able to pop up a Modal
Documentation suggestion for @jaunty comet:
ChatInputCommandInteraction#showModal()
Shows a modal component
Guys what can I do against this?
https://i.imgur.com/opo6pZz.png
ok thx
let component = new ModalBuilder()
.addComponents([
new TextInputBuilder()
.setCustomId("hello")
.setValue("TextInputStyle")
])
anyone know whats wrong with this
Error?
ValidationError > s.string
Expected a string primitive
Received:
| undefined
you didnt set the label of the textinput
however, you must wrap the textinput component in an actionrow
Ohhh
well I did this
let component = new ModalBuilder()
.addComponents([
new ActionRowBuilder().addComponents([
new TextInputBuilder()
.setCustomId("hello")
.setValue("TextInputStyle")
.setLabel("something")
])
])
didnt work
same error as last time
after some digging
I found the customId was the problem
I still dont know how to fix it so imma just find one
don't you need to set a style?
Didnt know what the options were
But I found SHORT
DiscordAPIError[50035]: Invalid Form Body
data.components[0].components[1][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
for what in the modal is this?
max 1 text input per row
lol
you can't put action rows into other action rows
scratch that, yes
ok thx
Is there a way to make a forEach or something like that with <modal>.fields ?
I need to forEach the inputs
yeah why not
Just add rows to the modal inside your forEach
Wait, do you mean the submitted fields?
[...<ModalSubmitInteraction>.fields.fields.values()]
Tc39 Iterator helpers proposal can’t come soon enough
yes
thx
Found the error
is it supposed to say this
cause I can grab the info the person submitted
but it says something went wrong
Not responding to the modal submit
You can do that
Also heads up if you're using the latest dev version the channel-based typeguards methods are removed instead you should just check the type of the channel:
-if (channel.isText()) { }
+if (channel.type === ChannelType.GuildText) { }
Is there anything for Direct Messages
Channel#type
The type of the channel
alr
channel.isDMBased()
ChannelType.DM works too it seems
it does too
@crude valley, Hi, what kind of font do you use?
It's a paid font, sorry
but the name is this if you want
Noooo
I used these methods
I used to use just regular text lol
How to check if a member is banned or not?
<Guild>.bans.fetch(<UserResolvable>) and catch the promise rejection
👍🏻
builder's new dev version wasn't released along with djs dev which imports RestOrArray from builder
The releases are automated, you need to wait
- Attachment('url', 'filename.jpg')
+ AttachmentBuilder('url', { filename: 'filename.jpg' })
right?
+ AttachmentBuilder('url', { name: 'filename.jpg' })
The typing is wrong in current dev version and the pr is merged
That's APIAttachment
when will the next dev version be released?
ah didn't see ._.
const { ActionRowBuilder, SelectMenuBuilder } = require('discord.js');
const row = new ActionRowBuilder()
.addComponents(
new SelectMenuBuilder()
.setCustomId('select')
.setPlaceholder('Nothing selected')
.addOptions([
{
label: 'Select me',
description: 'This is a description',
value: 'first_option',
},
{
label: 'You can select me too',
description: 'This is also a description',
value: 'second_option',
},
]),
);
console.log(row.toJSON());
``````js
TypeError: Found non-callable @@iterator
addComponents takes an array
there is something wrong with the typings of this commit: https://github.com/discordjs/discord.js/commit/349766dd6925e2d5e5597cc78c73e46f17c56eab#diff-cf0f0bd1759a85d7814ba3e340ab7d7a4e093ca44420c108e0888ef117ed910d
Shouldn't it be GuildMemberManager#fetchMe that instead of Guild#fetchMe?

hello excuse me 
how do i can fix this problem which suddenly came after I updated the discord.js@dev package??
this is solved now
Is there any ETA on this update release?
When it's ready™️ :)
why is interaction.guild.me undefined??
Cause it doesn't exist
It’s guild.members.me now
Check the guide in pins
i'm trying to create a select menu however typescript keeps showing an error, anyone know why?
Not getting that error
Which is?
14.0.0-dev.1654519696-fba9710
could it be due to this discord.d.ts file?
import { Collection } from 'discord.js';
interface ExtraData {
commands: Collection<unknown, any>
}
declare module 'discord.js' {
export interface Client extends ExtraData {}
}
i updated it because i heard there was a new update
so if it isn't published, i'm not sure
To be pedantic, it's not the version on npm nor the latest commit, which would be 86d8fbc
I don't know what you have... but it's probably why I can't reproduce this
Reinstall discord.js from npm and try again
alright ill try that indeed
nope gave me the same version, is there a way to downgrade to the version you mentioned above?
Hmm now I reinstalled it and I'm getting fba9710... that's from /builders it seems
hmm
But I still can't reproduce the error
i managed to downgrade to this version, and the error isn't happening
so i don't know my issue there
ty lol
no longer supported?
so you're telling me fba9710 did get published??
Old dev versions are deprecated
ah okay
You probably just installed the latest dev version again, not sure how all that works
all i did was this lol
Yeah I dunno, I can't reproduce your error
hmm
All is fine
Welp
don't merge this please https://github.com/discordjs/discord.js/pull/8027
care to elaborate?
That would be too logical a move
So wait is a text input builder the only component I can add to a modal currently
help
Is there a change log for v14, if so where can I find it
Your footer needs to be an object
deal ty
guide in pins
yes
Do they plan on adding more in the future
yes
Ok good
yo so like i have slash commands, when i run one of them, the others wont work and it says application did not respond here is my handler: ```js
const { REST } = require("@discordjs/rest");
const { Routes } = require("discord-api-types/v9");
const fs = require("fs");
const ascii = require("ascii-table");
// Create a new Ascii table
let table = new ascii("(/) Commands");
table.setHeading("Command", "Load status");
module.exports = async (client) => {
const commands = [];
const commandFiles = fs
.readdirSync("./slashCommands")
.filter((file) => file.endsWith(".js"));
for (const file of commandFiles) {
const command = require(../slashCommands/${file});
commands.push(command.data.toJSON());
client.slashCommands.set(command.data.name, command);
if (command.data.toJSON().name) {
table.addRow(file, "✅");
} else {
table.addRow(file, ❌ -> Not able to load);
continue;
}
}
const token = process.env.TOKEN;
const rest = new REST({ version: "10" }).setToken(token);
try {
console.log("Started refreshing application (/) commands.");
const {clientId} = require(../config.json)
await rest.put(Routes.applicationCommands(clientId), { body: commands });
console.log("Successfully reloaded application (/) commands.");
} catch (error) {
console.error(error);
}
// Log the table
console.log(table.toString());
};
Why not it’s not needed
how are you executing your commands
let row = new ActionRowBuilder()
.addComponents([
new ButtonBuilder()
.setCustomId('bang1')
.setLabel('Bang')
.setStyle(1)
.setEmoji('🔫'),
new ButtonBuilder()
.setCustomId('bang2')
.setLabel('Bang')
.setStyle(1)
.setEmoji('🔫'),
new ButtonBuilder()
.setCustomId('bang3')
.setLabel('Bang')
.setStyle(1)
.setEmoji('🔫'),
new ButtonBuilder()
.setCustomId('hunting-info')
.setLabel('What is Hunting?')
.setStyle(2)
.setEmoji('🤔')
])
I have an action row with buttons. How can I take a button from the action row, disable the button, and edit the action row into a message?
is there a specific button you need to edit
that like you know beforehand
I'm editing the button within a collector that's below.
Though, the button that needs to be edited depends on which of the first three is clicked.
The last one isn't relevant for what I want to do.
@velvet jasper
can you show your collector code?
for the record builders is kinda in flux there's probably going to be major changes soon
collector.on('collect', async (i) => {
row = ButtonBuilder.from(row.components[row.components.findIndex((c) => c.custom_id === i.customId)]).setDisabled(true)
await i.update({ compontents: [row] })
})
@velvet jasper
here is the confusing part
oh wait a minute wow
"compontents"
Xddd
Do you really need to access the array finding the index?
Isn't array.find just enough
i forget that some methods exist sometimes
Not to mention you're assigning a button to "row" which should be an action row correct?
i already changed ButtonBuilder to ActionRowBuilder
Okay is it all good now? Does it work?
hold on i was about to see
Hmm try without from, calling a constructor instead
It most certainly is, update and show the definition for it
Make sure it is imported from discord.js
ok
oh, would it be c.data.custom_id?
Maybe. Try it. Also split it up. Everything after the from call, move it to another line
now i'm getting this error
Did you move it to another line?
oh, i didn't
move everthing after find()?
Also if you still have issues, just describe it with as much detail as needed
Goodnight
oh, goodnight
anyway to acknowledge interaction.reply without actually replying
oh yea ended up using deferUpdate as deferReply ended up endlessly . . . waiting
er anyway to close modal automatically?
i.awaitModalSubmit({filter2, time: 10000}).then(modal => {
// some code
}).catch(e => {
// fail, close modal automatically
})```
you cannot close a modal
and you are not passing the filter to awaitModalSubmit correctly
it expects a filter option, and not filter2
rip
let Discord = require('discord.js')
require('../client.js')
module.exports = {
name: "interactionCreate",
once: true,
async execute(interaction){
const { client } = interaction;
let guildQueue = client.player.getQueue(interaction.guildId)
if (!interaction.isCommand()) return;
const command = client.slashCommands.get(interaction.commandName, interaction);
if (!command) return;
try {
await command.execute(client, interaction, Discord, guildQueue);
}catch (error) {
console.log(error);
await interaction.followUp({
content: "There was an error while executing this command!",
ephemeral: true,
});
}
}
}
InteractionCreate needs to be a .on
Otherwise it’ll only execute once, which happened to you
Np
When v14 will release?
when its ready
When it's ready™️
Okay
Why can't I edit reply after answering the modal, like when I reply to button interaction I can edit last reply, but when I'm trying to answer to modal and edit last reply message I cant
Are you calling update on the modal?
Documentation suggestion for @prisma kiln:
ModalSubmitInteraction#update()
Updates the original message of the component on which the interaction was received on.
oh, wait
It should work since the modal originated from a message component interaction
editReply requires that you alr called reply, update, or the defer variant of either
but the interface not contain update method for ModalSubmitInteraction
It’s documented
maybe I should update the package
Oof, it’s not in the ts types
lmao
Oh, it’s a different class name
ModalMessageModalSubmitInteraction
You get it by checking .isFromMessage()
oh, ok thank you very much
Refer to pins
ty
if(message.member.roles.cache.has("971537773444100146")) {
TypeError: Cannot read properties of null (reading 'roles')
message.member is null, which most commonly happens when the message was sent in DMs
but i have if(!message.guild) return;
what triggered that error? It may be that an application was added without the bot scope, so it's not technically a member of the guild
a lot of changes to be honest. how do I get СomponentType now?
const { ComponentType } = require('discord-api-types/v10')
``` this path does not give me anything
import it from discord.js even if this should work
ComponentType is there, what do you mean it doesn't give you anything?
found a bug in GuildInviteManager
when you try to force fetch guild invites it won't really work as force option does not really exist
only cache option does exists in fetch method
guild.invites.fetch({ force: true });
this code gives the error in the SS
docs says there is a force option while it does not work and as i reviewed the source of the method i couldn't seem to find any option with the name 'force'
guild.invites.fetch({ force: true }); I'm pretty sure this is not a correct overload anyway, there is no force option when fetching all invites
Because it's always forced
So it probably thinks you're fetching a singular invite but you didn't supply a code
Yep, if you provide force, for the FetchInviteOptions, code isn't optional
It's also not documented here
if its always forced why is there force option in the docs
What your code is doing and what you are looking at are both completely different
You're looking at the documentation to fetch a singular invite, but your code is fetching all invites
This is the fetch all one
https://discord.js.org/#/docs/discord.js/main/typedef/FetchInvitesOptions
oh wait got it there is literally 1 character difference
Yea, the plural
so if i do invites.fetch() without any options its already forced
What does it mean?? ModelType??
you did something wrong with an embed, can I see the code
don't you need to toJSON() an EmbedBuilder before sending it
No?
the label for buttons maybe?
they use Emojis
ah yeah
then it wouldn't point to data.embeds[0]
How to give donations?
why not
For it has not been a problem befor
wdym?
donations to discord.js or donations for your own bot?
and i don't json my embeds for i use the same way on other commands and it works fine
Looks like djs already does it for you?
i use array
doesn't look like it takes Array<EmbedBuilder>
:/
no need to call .toJSON()
just try
it's not going to explode your machine
at worst the error won't go away
EmbedBuilder should support Array
what?
docs seem to be outdated, types are correct embeds?: (JSONEncodable<APIEmbed> | APIEmbed)[]
interesting given how they refresh every time i open them, but sure

I can "reproduce" the error if I try to send embeds: [undefined], seems like your loop isn't working as intended
it's on you for providing an invalid payload
Let me check that out 
yea you had right its undefined weird
Name theme?
Aren't you importing directly from Discordjs? So you don't need the Util.resolveColor, right?
Perhaps they need to convert it
To a color resolvable
setColor(color) {
return super.setColor(color && Util.resolveColor(color));
}```no, it calls it internally
I see
What does that even return
It means that internally, Util.resolveColor is called
you don't need to call it yourself and pass it
And it returns the Embed Builder, and the resolveColor returns a number
The EmbedBuilder in the builders package only takes a number or an rgb tuple
the extended djs class takes in a color-resolvable, it resolves it internally to make it work for the builders' setColor
I installed the dev version when this channel has been created, so a lot of changes since his creation
Andromeda Colorizer
I added descriptionLocalizations to my Slash Commands but when I change the locale of Discord to this language ("fr") the descriptions are still in english
do u have localizations build?
I guess, because VSC suggested nameLocalizations
Idk if this build has localizations:
"discord.js": "^14.0.0-dev.1650931749-df64d3e",
They mean the discord build override to show localizations in the client
What is that ?
OH I see now
I haven't the override
How I can get it. I forgot where I got it
The override is invalid
maybe remove this from pins? ^
Did the rest thing get merged
also a new builders version https://github.com/discordjs/discord.js/releases/tag/%40discordjs%2Fbuilders%400.15.0
The fetch returns a Collection if there’s no id passed
But doesn’t seems wrong, do you have the GUILD_MEMBERS intent?
there is
And member returns what?
when receiving a message component interaction in a guild, when can member be an APIInteractionGuildMember?
I don't think it can?
also why can't a GuildMember object be constructed since the docs say ** member is sent when the interaction is invoked in a guild, and user is sent when invoked in a DM, so shouldn't a full guild member object be received?
@velvet jasper ^ :eyes:
you get the raw object when the guild isn't cached afaik
Actually looks like that wasn't updated
https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/Interaction.js#L60-L64
So yeah if it's in an uncached guild, it's the raw object
I'm pretty sure there was a pull request to always return discord.js instances though
only for messages
Oh
guild members have a direct reference to a guild, no getter
though that could probably be changed too
it looks like GuildMember relies heavily on the guild not being null so I'll just make sure its in a cached guild instead
someone renamed this channel
#analyse
Is there currently an issue with the messageCreate event? It's not firing on my bot right now.
AttachmentBuilder
Represents an attachment builder
How do you make dynamic choices like in /docs ?
its autocomplete
not choices
but it looks like choices
Do you have the guild messages and guilds intent?
I fixed the issue, it was my own fault after all.
Excuse me, everyone. I would like to ask for help, what function should I use? The expectation of this should be that the previous objects won't add up or stack up with each other but it should only display what the objects would only be. Here's a source code. Hope someone could help me with my problem.
const colsheads = () => {
let tempArray = [];
tableData.map((head) => {
head.list_attributes.map((columnheaders) => {
const tempObj = { field: "", headerName: "" };
tempObj["field"] = columnheaders.list_attr_data_key;
tempObj["headerName"] = columnheaders.list_attr_data_key;
tempArray.push(tempObj);
});
});
return tempArray;
};
However the outcome of this in my display would be like this.
How is this discord.js related
if any message is deleted in a voice channel then does it not emit the messageDelete event?
It should... why?
i tried doing so but it didnt work
when i did the same on a normal text channel it got emitted
I am unable to reproduce that. I deleted a message in a text-in-voice channel and the event got emitted.
do i need some intent or smth
ah, wait maybe i need to update to the latest v14
"discord.js": "^14.0.0-dev.1651147765-679dcda",
im on this one rn
yup it worked after updating the package.
what is the alternate for Guild#me ? since its removed in v14
iirc its now guild.members.me
okay thanks
Am I doing something wrong? I can't seem to tell whether a message is edited. I'm sending a message and storing it
const message = await channel.send({content: 'Hello world!'});
and later on (many seconds later), I edit it
message.edit({content: 'Good morning, world!'});
However, afterwards (many seconds later), editedAt and editedTimestamp are null, even after fetching it (even with force: true)
await message.fetch(true);
console.log(message.editedTimestamp); // => null
const message = await channel.send({content: 'Hello world!'});
setTimeout(async () => {
message.edit({content: 'Good morning, world!'});
}, 2000);
setTimeout(async () => {
await message.fetch(true);
console.log(message.editedTimestamp);
}, 6000);
try resolve Message#edit promise, await it
Ok, that seems to work...is there no other way to tell if a message was edited?
compare content, embeds, components with old message maybe? if you want other tricky way. the best to do is check for editedAt and editedTimestamp
awaiting edit only works if I can actually keep the return value of await message.edit(...)
if that was done in another context, editedTimestamp will still be null on the original message
const content = 'Hello world!';
const message = await channel.send({content});
setTimeout(async () => {
const editedMessage = await message.edit({content: 'Good morning, world!'});
console.log(`after edit: ${editedMessage.editedTimestamp}`);
}, 2000);
setTimeout(async () => {
await message.fetch(true);
console.log(`later: ${message.editedTimestamp}`);
}, 6000);
after edit: 1654663077932
later: null
Ahhh- message.fetch might not do what I think it does.
nope. I thought message.fetch might return a new message object, but the return value still has null for editedTimestamp
message = await message.fetch(true);
console.log(`later: ${message.editedTimestamp}`); // later: null
I have added this code in my bot to stop error when we try to unban someone who is not banned. But this I get this error
if (!ctx.interaction.guild.bans.fetch(user?.id)) return ctx.interaction.reply({ content: `${process.env.FAILURE_EMOJI} | The given user is not banned!` });
catch the rejection
huh?
#resources #useful-servers if you dont know them
cant you do a .then on the message
you need to catch the rejection, not resolving em
bans.fetch return a pending promise. This promise throw error when ban doesn't exists
👍🏻
i do await the fetch before attempting to access editedTimestamp, if that's what you're suggesting
No I meant after message is sent, you do a .then(), and then inside of it you do a setInterval that edits the message
ah, so the actual use case is that when someone clicks a button, the message is edited. The bot later needs to know if the message was edited or not, ideally without having to manually keep track of that myself
so the send and edit won't be done together, unlike the repro
In the .then you could add the event in it
And then make it so that if they click the button it edits it
I appreciate your input. I could, but I would consider that a workaround. I was hoping I could use the library for what I expected it to do
My first thought would be using the api but thats probably not ideal
So you can do something like:
let msg = await message.channel.send(message)
And then check if msg.editedAt exists
probably not what ur looking for but yea
yeah, that's pretty much what I'm doing right now, but editedAt and editedTimestamp are null even though the message was edited 😦
What if you yourself set a timestamp
like msg.editedTimestamp = Date.now()
Hello! And where can I see permissions in string?
PermissionsBitField.Flags outputs only bigint, and I want to see them in string
Are you using GatewayBitIntents
oh wait nvm ur doing perms
Documentation suggestion for @thorny haven:
PermissionsBitField#toArray()
Gets an Array of bitfield names based on the permissions available.
Would that get you what you want?
oh, you're trying to print out every permission? Try using PermissionsBigField.Flags
not too sure what you expected with a "new" permission bitfield
ofc that's gonna be 0
he said he wants to see the permissions as a string
pretty sure
You can take the keys of that object if you want just the strings
Just do Object.keys(Discord.PermissionsBitField.Flags)
actually if u wanted to do that
no, I understand that it is possible to do this, but before discord.js itself printed out the flags beautifully. by MANAGE_MESSAGES type
beauty lies in the eyes of the beholder
news = ""
for i = 0, i < len(flag) - 1, i++:
if isUpper(flag[i]) && i != 0:
news += "_" + flag[i]
else
news += upper(flag[i])
or sth like that
I understand that when creating a channel, string permissions from discord dev portal are supported
👏
I mean you have the option to create a channel using the api
permissionOverwrites supports allow with string type permissions?
this.permissions = [
{
id: "798867454205231124",
deny: ["VIEW_CHANNEL"]
}
]```I wanted to do something like this
You can just do new Discord.PermissionsBitField[deny[0]]
or something along the lines of that
use static flags lel
in your code, just use the enum
I believe strings are going away in v14
they still work for me if you do it like that
as in they give me the permissions bitfield
PermissionFlagBits.ViewChannel - clean and efficient
looks good to me
well, yes, it gave an error
wait I did it wrong
new Discord.PermissionsBitField(deny[0])
supposed to be a function
read what souji said
or just do this honestly
it is possible, but it takes a lot of lines if you change more permissions
what?
if you put each permission on one line, it would be the same amount of lines
you needed flag strings, now you need flag enum properties, i don't see the big difference, tbh
alternatively you can just one-time compute the thing and pass the bigint
I just wish it was like before, but apparently it's no longer available
then write your own util function to make it happen
like, programming, extend things to fit what you want them to do
well
function, pass in strings, return a single bigint with the combined perms
I was thinking of making it something like "ViewChannel", and then applying a .map on the array
can prob. even do that with dynamic property accessors
haven't tried yet, i usually use enums as enums, because they're great and verbose
but for other people lines of code is an issue, for some reason
for me I just read the stuff after the .
I prefer enums just in case the underlying value ever changes
for example that funny person that said eris is better because it has less lines of code
- but i'm getting off topic here
I used to like that discord.js gave 2 options, either bigint or string permissions. and option 2 suited me, but right now it was removed. and it became somehow dreary
okay, I'll try to make a bicycle so that the strings are converted into bits
As I said this would work:
new Discord.PermissionsBitField(string)
But up to you
I told you, it gave an error
https://thumbsnap.com/i/cLWMruut.png I will use this option.
That was cause I made it an array, not a function
But the other method is better anyway so use that
Wait nvm
@thorny haven https://discord.js.org/#/docs/discord.js/main/class/BitField?scrollTo=s-resolve
map the flags with that, should do the job
for some reason it doesn't show on PermissionsBitField but is directly inherited
-ev Discord.PermissionsBitField.resolve("BanMembers")
4n```• d.js `14.0.0-dev.1651493371-4ba0f56` • Type: `bigint` • time taken: `0.122831ms`
I think its cause he was doing VIEW_CHANNEL, which probably isnt on Discord.PermissionsBitField
Either way he’d have to use a different string format
Does anyone know how to get modal interactions custom id to work?
f(interaction.customId === "banappealModal"){
const reasonofappeal = interaction.fields.getTextInputValue("appealtext")
const emailofuser = interaction.fields.getTextInputValue("emailofuser")
console.log(interaction.customId)
as this dosent work
doesnt work how
Show the code above it, how do you get to here
it's fine til we drop support for v13, then you will have to update at some point 

how to force someone
WAIT WHAT! I JUST STARTED LEARNING USING DISCORD JS.GUIDE AND V14
nvm
updated version to v14 and dint even updated code

u bad bad
help! i cant get
: >
^
ReferenceError: Client is not defined
at Object.<anonymous> (D:\aayush\skeyush bot\index.js:5:16)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47```
sir you gave me alot of error
now help me :>
learn js #useful-servers
:> yeah i was thinking to learn js again
Hmm lets wait for v14 to realease again
till what time to wait
bruh i know js
if(interaction.isModalSubmit()) {
if(interaction.customId === "suggestionModal") {
const suggestionstitle = interaction.fields.getTextInputValue('suggestiontitle')
const suggestion = interaction.fields.getTextInputValue("suggestion")
const row = new ActionRowBuilder().addComponents([
Is there anything above that causing it to return
am i supposed to be able to re-fetch a message in order to update properties such as editedTimestamp?
What are your intents?
That was the reason
It works now
but do you know how to change the 16234324 timestamp thing to real time stamp, like 8. Juny 2022 11:42 am?
Some time (up to five minutes) after sending a message, determine whether or not said message was edited
Do you know what a gateway intent is?
Oh, those
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent,
Well from the list of intents, you are not looking for guild messages. Therefore, you are not receiving any updates
Yep
Jiralite, u know how to make so it dosent send out timestamp numbers, but shows the real timestamp?
These , i want em like 8. Juny 2022 11:46 Am
Like that instead of what it said
Ahh, so I'm missing GuildMessages then arent I
Yep
is that intent required to forcibly refetch a message too?
Think so
@uncut kelp (Sorry for piiinggg)
you could use native js date objects, but keep in mind that it will always use the system's tz
Documentation suggestion for @granite yacht:
Date.prototype.toLocaleDateString()
The toLocaleDateString() method returns a string with a language sensitive representation of the date portion of the specified date in the user agent's timezone.
check out Intl.DateTimeFormat as well
What?
Message formatting (mentions, timestamps, emoji, etc.): learn more
Whats intl?
nvm, just saw the screenshot
Documentation suggestion for @granite yacht:
Intl
The Intl object is the namespace for the ECMAScript Internationalization API, which provides language sensitive string comparison, number formatting, and date and time formatting. The Intl object provides access to several constructors as well as functionality common to the internationalization constructors and other language sensitive functions.
Intl.DateTimeFormat
The Intl.DateTimeFormat object enables language-sensitive date and time formatting.
by reading the docs. not djs related.
can someone explain the error to me? It seems like I'm doing something wrong with the action row, because when I send the message without the components it works
doesnt look like you set customId for your selectmenu
const member = interaction.options.getMember("user");
if(member.roles.highest.position >= interaction.guild.members.me.roles.highest.position) {}
Cannot read properties of undefined (reading 'roles')
i've been getting this error for a while now and i've never had issues with it
Try logging member and guild.members.me
Q: Am I correct that Channel#type is gonna get removed?
no
What made you think that
How can I get total count of users who have administrator permission in a server?
filter members by permission
👀 Okay, I will try
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS], partials: ['MESSAGE', 'CHANNEL', 'REACTION']});
^
TypeError: Cannot read properties of undefined (reading 'FLAGS')
at Object.<anonymous> (C:\Users\whes1015\Desktop\B-MPR\index.js:3:47)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Module._load (node:internal/modules/cjs/loader:827:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Node.js v18.3.0```
Is this correct in v14?
What's correct in v14?
check pins
Where is v14 Documentation?
pins
I was directed to the v13 documentation
use main branch
the link in the pins takes you to the main branch documentation
pls help
did you import gatewayintentbits from djs?
either import GatewayIntentBits from discord-api-types or use IntentsBitField
IntentsBitField (extends BitField)
Data structure that makes it easy to calculate intents.
no
Then i suggest you do it, it doesnt magically get imported
what is better to use? gatewayintentbits or intentsbitfield?
doesn't matter, IntentsBitFields.Flags is GatewayIntentBits
ah okay
ok, thx
bumping
just has some extra methods
Hi, how I can use autocomplete interactions ?
Wdym by “auto complete”
@jaunty comet
setAutocomplete(true) if you're using builders, in your slash command options. Though note not all accept autocomplete. Then just handle the interaction as usual in your interactionCreate event
