#djs-in-dev-version
1 messages · Page 35 of 1
Also you don't need to install /builders yourself as discord.js comes installed with it now
nothing has changed
i have no idea
huh. the line numbers do not align they do, i'm blind
https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/util/Util.js#L411 that should def. resolve that.
i actually have to try really fucking hard to even get that error...
Any chance of you posting a sample embed?
it has to be letters that are not in hex and no numbers at all
I just ran that code and the embed colour worked, so...
-ev new Discord.EmbedBuilder().setColor("z")
Error:```xl
TypeError [ColorConvert]: Unable to convert color to a number.
-ev new Discord.EmbedBuilder().setColor("f")
EmbedBuilder { data: { color: 15 } }```• d.js `14.0.0-dev.1657325401-33ae7df` • Type: `object` • time taken: `0.839895ms`
I'd log in the source and see what it thinks the colour is really
or actually follow the stacktrace instead of assuming things, might help too, because that aint it
You mean for this
collector.on('end', collected => {
menumsg.edit({ embeds: [EmbedBuilder.from(0).setDescription(`~~${EmbedBuilder.from(0).description}~~`)], components: [] })
});
``` or not?
0 is not an Embed instance, no
Ughmm...
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()
collector.on('end', collected => {
menumsg.edit({ embeds: [EmbedBuilder.from(setDescription(`~~${menumsg.embeds[0].description}~~`))], components: [] })
});
Like this?
you have to pass menumsg.embeds[0] to EmbedBuilder.from()
that will return an EmbedBuilder, which you can call .setDescription() on
Although all intents are open in the bot, I can't get the message content, it sends an empty string
Are you sure that’s all intents?
Although all intents are open in the bot
One more reason to not use magic numbers. Because 3244031 does not contain them all
No, it's
[
'Guilds',
'GuildMembers',
'GuildBans',
'GuildEmojisAndStickers',
'GuildIntegrations',
'GuildWebhooks',
'GuildInvites',
'GuildVoiceStates',
'GuildPresences',
'GuildMessages',
'GuildMessageReactions',
'GuildMessageTyping',
'DirectMessages',
'DirectMessageReactions',
'DirectMessageTyping',
'GuildScheduledEvents'
]
my source is ||https://intents.cf ||
oh sorry maybe I shouldn't have fully trusted this site, can you give me the link to the right source?
I don’t think Discord has an official intents calc
I’d just specify intents manually w/ an Array
Every time a person uses all intents, a puppy dies
Don’t
why
Bloats your bot, slows it down, unneeded load on the API, unneeded death of puppies, …
data economy
how should I do
List out the ones you actually need
slowing down the bot doesn't matter that much, it doesn't make a big difference for me, the server is a private bot
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
check pins
Many breaking changes as usual 
thats what a major release is for
hey AttachmentBuilder second argument takes in a apidata thing but i don't get it is a object or smth
when i see api docs it takes me to the attachment object https://discord.com/developers/docs/resources/channel#attachment-object
You usually don’t pass that argument at all when calling it yourself. That‘s for internal handling with AttachmentBuilder.from(…) mostly.
But if you want to you can pass an object containing any of the keys like in the linked ddocs
yea tried but seems like my typescript wont let me i'll have to ignore that part ig
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 ; -;
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]})
},
};
its PascalCase like Aqua or Link
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
You can type your user and command into your bot's cache and then check your cache as soon as the command is triggered, delete your cache when the process is finished
But if your waiting time is long, I do not recommend using cache.
it's a random number between 0 and 300000 milliseconds, is that fine?
Is the particials for message is it Particial.Message?
Cuz that doesnt seem to work woth the dev 14
add a cooldown to your command
do you mean Partials.Message if so, yes.
Well that one does see to be working
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],
cannot replicate, how are you importing Partials
const { Client, Collection, GatewayIntentBits, Partials} = require('discord.js');
what version are you on
the version 14 dev
npm ls discord.js
the exact version
you aren't
thats not @ dev like I told you plenty of times before
you're using 13.8.1
apparently not.
I literally had it installed

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
}```
did you update to @dev
whatever you passed at index.js line 13 is undefined
yes, they are all wrong
PascalCase
Is there any way i can get all the GatewayIntentBits ntents? Like the Guilds, Messages etc
no, you pass the ones you need
Whats the intent for the Guilds messages
you need Guilds GuildMessages and MessageContent if you want... the content
Activity#type
The activity status's type
How do we query perm
What perm?
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.
This is the final version of the code that came out after many attempts.
appPermissions is on the interaction, not the guild
interaction.guild.members.me is what you’re looking for
appPerms is preferable, already has overwrites calculated and everything
the new, cool, kid on the block
Oh, right, my bad
is there a list of every permission available in PascalCase?
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
Slash commands don't require intents
whats the equivalent to, interaction#isContextMenu, i know its smth like interaction#type === InteractionType#MessageComponent ?
What does this means?
You can have up to 5 buttons per row
Oh okay
isContextMenuCommand
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
Doesn’t look like the intents are the issue. Show your messageCreate handler
Also what made you switch to v14 dev version?
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`)
}
}
}
Just like everyone did and i mean to also get everything updated in terms of coding in javascript
Everyone did not update to a dev release that isn’t yet finished and will need you to change your code regularly when more breaking changes will happen. And from what I‘ve seen from your questions on here I‘d highly refrain from using a dev release
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
Who did? I saw you got told to not tag your posts as dev when you‘re not on dev version, but didn’t see anyone suggesting to use dev version
Let me get you the message link
Has this been released to djs yet?
This is dev channel?
Not in a stable version
So it’s in the dev-dev version?
What's that? O_o
Like the development of the development version
We have no such thing. It's just in dev
So if I do npm i discord.js@dev I should be able to use it?
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?
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
Thanks
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 :/
MANAGE_MESSAGES permission
Or ManageMessages in CamelCase
I do it this way too, just like in v13 times, but it gives an error
if(!interaction.member.permissions.has("MANAGE_MESSAGES")) return
PermissionsBitField.Flags.ManageMessages
Where exactly should I write this?
Instead of the "MANAGE_MESSAGES"
as the error said, define it
I don't think it needs to be defined.
it is, import it from discord.js
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.
oh thank you, but do you have a list of new perm names?
Documentation suggestion for @scarlet tangle:
PermissionsBitField (extends BitField)
Data structure that makes it easy to interact with a permission bitfield. All [GuildMember](<https://discord.js.org/#/docs/discord.js/main/class/GuildMember>)s have a set of permissions in their guild, and each channel in the guild may also have [PermissionOverwrites](<https://discord.js.org/#/docs/discord.js/main/class/PermissionOverwrites>) for the member that override their default permissions.
PermissionFlagsBits actually, go discord.js.org instead
PermissionsBitField is valid
alr
[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?
That isn't an error?
nah
events
but then what does it means
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
any reason why a webhook would be firing locally but not be firing on my server?
What do you mean by webhooks firing?
sending a message
Any errors while trying to send from your server?
How could i get an user id and store it in a json file
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
if you don't have message content intent the content will be empty string
and the rest of the message obj will be existing because of the GuildMessage intent
anyone knows why this doesn't work when member was kicked nor does the join event
Do you have sufficient intents?
oh shoot, what is the intent
GUILD_MEMBERS
On Dev it's GuildMembers
I like how this screenshot has 50% useless decoration
it just auto captures my code and adds that
Are you not able to use string intents anymore? Or are you supposed to use the enum
Use the enum
Ctrl + C captures my code without adding anything 
true
Ok nvm, how do I revert back to v13?
npm uninstall discord.js and npm install discord.js
Not sure how you ended up on dev then lol
No worries
Sorry for all the trouble, kind of new to this stuff
all good
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)
Nah its just a warning
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?
embeds and webhook messages (and therefore interaction replies)
oh okay thanks
Why was interaction.isCommand/interaction.isAutocomplete type guards removed?
They only checked one thing, not necessary
We kept the ones that check multiple conditions
okay but checking for interaction.type doesn't 'automagically' make the interaction a CommandInteraction or a AutocompleteInteraction, it was kind of nice..? :p
<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
aah
right, okay - I missed that renaming :D
are the types not up to date btw? I still see isCommand() and isAutocomplete()
Are you on the main docs?
I'm just using the typings that (I hope) came from installing discord.js@dev
Because I see the new ones
Uhhhh
The types are fine, are you sure its installed properly?
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
└── discord.js@14.0.0-dev.1657411900-f0b68d5
Is that the only version you have installed?
in this project, yes
yup no idea
should I see a type called AnyInteraction now/still or is it gone?
Okay, I had some old cached data or something 🤦🏿♂️. Fixed
Seems it's renamed to just "Interaction" now 👍🏿 nice
Where can I see the current status of discord.js v14 on GitHub?
Please ping me when someone has the answer
Why is it returning undefined?
`\`${i + 1}\` | ${ctx.client.users.fetch(r).username}#${ctx.client.users.fetch(r).discriminator} | <@${r}>)`
fetch returns a Promise
also why are you fetching twice instead of once, resolving it to a variable and using that
this issue is from a select menus options right?
You can put only 1 select menu in action row
oh
okay, and max 5 rows per message right?
Yes
kk
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? 🤔
yes, you have to specify the generic type of the action row, e.g. ActionRowBuilder<ButtonBuilder>
Oh okay, thanks.
hi
hi
In V14 the way to check permissions is this right?
if (interaction.member.permissions.has("ManageMembers")) {
well, try it and see
It works, but are there newer way?
yes, use the flags
PermissionsBitField (extends BitField)
Data structure that makes it easy to interact with a permission bitfield. All [GuildMember](<https://discord.js.org/#/docs/discord.js/main/class/GuildMember>)s have a set of permissions in their guild, and each channel in the guild may also have [PermissionOverwrites](<https://discord.js.org/#/docs/discord.js/main/class/PermissionOverwrites>) for the member that override their default permissions.
How can I use it?
PermissionsBitField.Flags.ManageMembers
import it from djs
Can you give me example for usage?
Why do you need an example, you just pass it to .has()
Ok I got it
how do you save data to the cache? for example i'm trying to disable using a command for an amount of time.
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
changed to which one in v14?
Check if <Interaction>.type equals to InteractionType.ModalSubmit
How do I get highest roles in the guild?
interaction.guild.roles.highest.position << Doesn't work
how does it not work?
Works now interaction.guild.members.me.roles.highest.position
And the error: TypeError: Cannot read properties of undefined (reading 'roles')
thanks
that is not the highest role of the guild, but the highest role the bot has
Oh
why ChatInputCommandInteractionData doesn't exists anymore ?
Do you mean ChatInputApplicationCommandData, because I don’t know the other one
Yes
Even ApplicationCommandData
It’s prob using the one from the discord-api-types package now
I don't get it, really
When you compile, does it actually exist
This is weird but webstorm does not reconize it
WebStorm (':
Like when I push ctrl and hover the import it do not act as a link anymore
All I hear from that is typing issues lol
It's not a problem with us or our typings just the IDE itself
So VSC is better ?
Well, it seems optimal. My only knowledge of that IDE is that people keep reporting issues about the typings
Hey, when I use a context menu command, i get this error, and I can't figure out where is the error 😅
So what's the code that's causing the error
looks like line 22 of events.js is where it hits your code
Line 22 of events.js is litterally a .setDescription for an embed
The error traces back to the discord.js => @discordjs/builders => @saphire/shapeshift
ButtonBuilder.from(button).setDisabled(true)
doesn't disable the button?
<ButtonBuilder>.from()?
???
What are u trying to do? Disable a button that's have been clicked or on the message creation?
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
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
yes
else you can lock up your code forever, because you will never know if they dismiss the modal
It needs to timeout eventually
Then set an padronized customId (Or use a something to store the id) and listen to the model in the interactionCreate
Like Collection<id, function(ModalInteraction)> an then call the function with the modal interaction
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()]
});
Yeah, that's not gonna work
ButtonBuilder.fromisn't a thing
You are passing the buttons as components outside of an ActionRow
ButtonBuilder.from is a thing tho, its in the v13-v14 changes, its in the docs too
but thanks for the lead
type: 1 is the ActionRow
I can't find it, sorry
I was reading the @builders docs, srry
Well, wrap your button in an ActionRowBuilder and pass it to the update
And it should work
ah they moved the @discordjs/builders into discord.js library so you shouldn't have it installed fyi
yeah okay thanks
Does the model support only 5 input fields?
yes
No wonder
Can I add more if I split them into different rows?
No, 5 rows, one input each
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
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
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 😛
Where did you get ChannelType from?
I tried importing it from both discord.js and also discord-api-types (when I was debugging)
You should use the one from d.js
yeah that's what I'm using
Could try ChannelType.GuildText as const
oh that also suppresses the type error
The inferred type is ChannelType, which includes non-guild types
but in any event the value is just a 0 so that should be unrelated to the command failing I guess
The type it wants are the specific ChannelTypes in the union
Heh, union
I hope that makes sense
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
oh I just tested it with an object, you're right
I guess my misunderstanding was with how object property types are inferred
I recently learned what as const actually does
yeah I read through that code for like 2 hours but I had that fundamental assumption that it would know which particular value I used
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
You prob could’ve just typed channelConfig as GuildChannelCreateOptions now that I think abt it
oh, so as const forces the inference engine to not widen literals, TIL
I actually had it in-lined in the function call before but pulled it out to debug that runtime issue, I'll probably throw it back inline to avoid the unnecessary syntax though
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
25
and there's no select with channels yet, right ?
right
Hey, sorry but I still didn't find why I get this error
uncached everyone role, either the guild is unavailable or you are missing the Guilds intent
thanks so much
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 🤔
What is Embed?
Builders are no longer returned by the API like they were previously. For example you send the API an
EmbedBuilderbut you receive anEmbedof the same data from the API
EmbedBuilder.from()
thanks !
???
What happens if message.embeds[0] is undefined and you chuck it into that from() method
an embedbuilder is returned
hence
why are you changing everything 😭
what
Just change the if statement to check if embeds at index 0 is nullish
And put the if before the EmbedBuilder.from
?
Yes
now I get this
I think I have to do Embed.setFields() but I don't know what to put in here
you can use spliceFields(1, 1, newFieldData)
EmbedBuilder#spliceFields()
Removes, replaces, or inserts fields in the embed (max 25)
I never used embedbuilder before, I always declared them as const embed = new MessageEmbed()
That technically was the v13 embed builder
is v14 gonna be as big as v13 was... it took me forever to update everything 🤣
It took me 2-3 hours for my large project if that helps
i just remade the whole bot from scratch 
Why this not working
allowedMentions: {
parse: [ ],
repliedUser: false,
},
partials: ['MESSAGE', 'CHANNEL', 'REACTION'],
``` I changes for v13 to v14.
those are not valid partials
But how off tag?
I mean for this.
For v13 works for this line
allowedMentions: {
parse: [ ],
repliedUser: false,
},
that is how
But it's not working.
partials: [
Partials.Channel,
Partials.Message,
Partials.User,
Partials.GuildMember,
Partials.Reaction]
show the reply code
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] })
can you show the full client constructor?
index.js?
if thats where you're constructing the client, sure.
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)
you're not setting the allowedMentions?
Nop.
adding allowedMentions: { repliedUser: false } will disable the mention on the reply
either to the client options or to message.reply()
Ok.. I have no words 😄 Maybe me fault not saving index.js file.
@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()
],
})
Red not RED
what is wrong here?
you didn't provide intents to client constructor and put login() below ready event listener
intents?
read this guide https://discordjs.guide/popular-topics/intents.html but its v13 guide so you need to update the code to v14 https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html
the position of client.login and client.on doesn't really matter because client.login is asynchronous
Does <ChatInputCommandInteraction>.options.resolved.attachments return a collection of the attachments that were sent with the interaction?
Yea, that’s what the docs say
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?
channel.permissionsFor(client.user).has(PERMISSION)
is v14 out ??
Does it look released
no ??
exactly
yea
what is interaction.options.getSubcommand() this in v14?
that's what it is
you have to typeguard interaction
https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html#removal-of-method-based-type-guards
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?
oke
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
What version of Node.js does Discord.js v14 require?
v14 requires Node 16.9 or higher
Thanks i added it, but it just shows interaction failed for someone without perms. Is there a way to change that message?
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
ahh thanks does it only work on the main command or can i do it differently for sub-commands
What is the alternative to dynamic in <User | GuildMember>#displayAvatarURL()
It's already dynamic
Bot gets the cmd (I see it in the console)
But still does this: ?
https://cdn.upload.systems/uploads/OEictOGE.png
https://sean.does-co.de/sAvdzzUR
Something before that line preventing it from responding?
nope
I removed the code and copyed 1to1 the same code again
and now it works idk xd
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)
Log role.guild.roles.everyone
It logs undefined
Well, the everyone role doesn’t seem to be cached
Just Guilds intent
Oh I removed that-
You should enable it, otherwise d.js is rather useless
Better off using http interaction at that point
HTTP Interactions aren't supported on DJS are they 🙄
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
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
when the djs v14 is going to release? any ETA
When it’s ready
hm is there any handler for this? version
Not sure, but you could see this, https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html
Okie thnks
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?
ok sry
?
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
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
thanks @hoary fox x)
what is the latest dev release?
cant find it on either, only the stable releases
Ah thanks. I wasn't even looking in there
What is that home?
?
can i use slash commands in bot dms
Yes if they're registered globally
yes
When receiving Select Menus, how I can get the selected values ?
interaction.values
thx
SelectMenuInteraction#values
The values selected, if the component which was interacted with was a select menu
Did you know, posting code without any context doesn't help anyone?
sorry wrong chat
Short Question how do I do this in v14?
channel.permissionOverwrites.edit(interaction.guild.id, {USE_VAD: false}).catch(err => { })
change USE_VAD to UseVAD
thx mate
create() takes a single object look at examples https://discord.js.org/#/docs/discord.js/main/class/GuildChannelManager?scrollTo=create
and you need to use ChannelType enum instead of string
Yeah you cant acces 'member' if it was executed in dms.
get the member from cache using message.author id
- member might not be in the cache
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
And you are in a VC of that guild?
wrong guild id
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…
Hey, when I start my bot I get this :
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>" }))
})
maybe delete the allowedMentions: { parse: ["roles"] } part? I never use it and it works for me 🤷♂️
Doesn't work. Same thing https://i.xaliks.fun/9291f9.png
everyone role must have permission to ping this role because interaction replies are webhooks
thanks ❤️
please if someone can help me
That error doesn’t come from that code though
thanks I just realized that nearly no dependencies are working with v14
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?
yes
Thanks
u want to get channel member count?
so <voiceChannel>.members.size
and its recommended to fetch members before it
Anyone getting UNKNOWN unknown err: read coming from shapeshift? i am on djs ^14.0.0-dev.1657757514-fe34f48
Did you try console.log(interaction) to find out what it is?
[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
That is the risk with the dev version of this lib. If you want completely stable version you can use the latest update of v13
can I have a docs for modal?
thanks
and also example how to use it
look in the guide (also not directly v14)
But the features im using are only in the latest dev version
wdym?
Can't the djs devs just push something to update the enum
Go onto google or whatever search engine and find examples on how modals can be used
Surely they can if you found a bug and reported it
Ok
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 
Im preeetty sure I haven't missed anything
how do I get the types in modal e.g. ButtonStyle.Primary
Did you (re)deploy the command with NumberOption? Check if you can actually enter a 3.52 as value.
Nah I already found the issue
My type was set to integer but I used the getNumber function not getInteger
In the code you provided you had the type set to number though. So you didn’t deploy that command with that code
I am so confused, oldMessage.content and newMessage.content return the same value, but I am editing the content of this message
if you fetch old message it will be the new message
Oh right, so is there any way to get the old content of a partialMessage for messageUpdate loggings?
no
Oh okey
well, i turned off my computer last night and just turned it on again, its working 🤣
you are passing the array instead of the picked image to setImage()
Wdym?
I think the colour also needs to be one of these too
https://discord.js.org/#/docs/discord.js/main/typedef/ColorResolvable
yeah
Cuz if u explain easier itll be easier for me to understand
I suggest you take your time and learn JS.
If I explain it "easier" I would be spoonfeeding.
Nvm i got it
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?
also show the intents you're using
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)
}
}
}
Here is my code !
refer to this
Okay,
Guild_members and Guild_message
show the client constructor
const client = new Discord.Client(
{intents: ["GuildMessages", "GuildMembers"]}
);
you are missing Guilds
Oo okay!
In intents?
yes
no partials needed, unless you're expecting dm messages, but if you are you are also missing more intents
*not streaming I mean Ideal
Oo sorry, spelling mistake 😅
Okay
never use partials 😭

How do I fix this?
https://sourceb.in/2dQL36Drqx
https://sourceb.in/eyrWEvRpCI
to get the embed builder from embed you can do EmbedBuilder.from(Embed)
thanks
Now, why the error?
Would need to see the code before that point
In my interaction event, have this "isChatInputCommand()"
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
So, can't have subcommand?
Yes, it was just said, they can't have sub commands
I just updated to djs v14.0.0-dev.1657757514-fe34f48 and I get this error, does anyone else have problems with ESM?
what can i change it to???
Read the pins
where is the isAutocomplete method
you check the interaction type now for autocomplete
https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html you should read the changes
okey thx
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
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
is there any changes in client activity status? if yes please give the link to that topic as im unable to find it.
explaining the issue would help massively with finding the solution
im asking that is there are any changes in activity, status of the client in v14?
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
ok
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?
its the same in v14
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.
everyone not roles
ah alr
and interaction.reply() relies on @ everyone perms until the end of the month
the bot has admin, does it need more perms?
Like I said, interaction replies rely on the perms of @ everyone, since its a webhook
oh ok
I was recoding some stuffs and reading the changes but i came across this
Nvm i was using ChatInputCommandInteraction instead of CollectedInteraction
That error is correct an interaction can’t be both application command and a modalsubmit
Yeah it was just weird at first glance because it worked on the old version but was an issue on my side
Is it possible to get the role id of the booster role of a server?
RoleManager#premiumSubscriberRole
The premium subscriber role of the guild, if any
EmbedBuilder()
is there any way to check to see if my bot is getting rate limited? The client even for "rateLimit" doesnt exist anymore
client.rest has the event now iirc
ty
Question, any breaking changes between 27d8deb and the release version? 🙂
Also, any ideas how to get around this?
Hold

Is it supposed to be like this in the release?
But it's being fixed atm dw
Seems to be updating now 🙂
Shadow's issue is a different one
It's an issue caused by 14.0.0, it's fixed in 14.0.1
interesting
deploying guide, changing from deploy preview
click details and go website
or click new link
jeah
yeah that's what I did (clicking through the warning), just figured I'd mention it
What is the new link?
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
They haven't been removed
you need to use isChatInputCommand() typeguard not isCommand()
You havent typeguarded the interaction correctly, yeah
I'm talking about resolving optins
oh wait, I got it, thanks
Ahhh okay, the type changed, CommandInteraction => ChatInputCommandInteraction
To anyones knowledge, is anyone already working on updating https://discordjs.guide/whats-new.html, otherwise I can try and make a quick PR?
#1146 in discordjs/guide by lolollllo opened <t:1654279479:R> (review required)
Update v14 guide
Thansk
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?
not yet, there's a pr for automod though
Not yet, Discord has been really slow merging their documentation
And we dont merge features until the documentation is final
Yeah
oh 🤔
Will be supported once Discord finalises it
You can see there's still 2 PRs we're waiting on
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
isChatInputCommand
If you're going to update to v14 make sure you check the changes guide
I'm starting off at v14 lol, i followed an outdated guide ig
Last time I even touched a bot was v12, its so different now lol
Yeah most likely
Works fine :D
Is there docs for v14?
Yeah, the docs default to the main branch
bruh
where could I find the link to the docs?
ty
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
discord.js can only check the permissions of your bot if it knows it exists in the server
If it doesn't know it exists, it doesn't know its permissions, it won't know what to do
also how do I fix this
Fetch yourself
fetch via member id?
If you want
bro tysm
wait fetching returns a user, not a guild member
Seems you are not fetching correctly then
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
yeah so... not the client user
Client user needs to be cached as member to make sure thte user can be kicked
mhm
oh
He’s using member.kickable
so guild.members.fetch(client.user.id) ?
The bot is always cached as a member in every guild on ready, the only way it’s uncached is if ur uncaching it
I dont believe I am though
Did you enable the guilds intent?
Yea, you need at least the Guilds intent
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?
It’s now IntentsBitfield.Flags.Guilds
There’s also GatewayIntentBitfield.Guilds
Hopefully I spelled those correctly 
so do i do intents: [IntentsBitfield.Flags.Guilds]
Yea
Well, import it
do u know by heart how to, to save another tab from being opened?
import it from discord.js
global.client 
Is it BitField?
IntentsBitField (extends BitField)
Data structure that makes it easy to calculate intents.
Make Field capital
You have to change both of them…
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
yeah idk
GuildMember#kickable
Whether this member is kickable by the client user
It’s a getter
oh wait so after I fetch, I have to get it?
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
Suggestion for @scarlet tangle:
**Permissions: **
read more
Documentation suggestion for @scarlet tangle:
(static) Permissions.FLAGS
Numeric permission flags. All available properties: (more...)
Documentation suggestion for @scarlet tangle:
PermissionsBitField (extends BitField)
Data structure that makes it easy to interact with a permission bitfield. All [GuildMember](<https://discord.js.org/#/docs/discord.js/main/class/GuildMember>)s have a set of permissions in their guild, and each channel in the guild may also have [PermissionOverwrites](<https://discord.js.org/#/docs/discord.js/main/class/PermissionOverwrites>) for the member that override their default permissions.
Documentation suggestion for @scarlet tangle:
PermissionsBitField#has()
Checks whether the bitfield has a permission, or multiple permissions.
#app-commands if youre just looking stuff up for yourself
oh sry
Tomorrow
31st September 2022
blue>blur
hi, can sb help me?
Syntax error, just fix your JS
have you found the solution ?
Yes I found that I've to now pass as property of name
do you have an example for me please ?
v13: new AttachmentBuilder(Attachment, "image.jpg")
v14: new AttachmentBuilder(Attachment, { name: "image.jpg" })
oh thanks
thanks 
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?
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
so I have to make it rejoin?
i mean its not a big problem if it has to rejoin, its only in 2 servers lol
does anyone know hot to kick a bot from a voice channe using discord.js @13.1
voicechannel.disconnect() or something hold on lemme pull it up on the docs, also this is discord v14 not v13, go to that channel next time
ty
bru
i am new in this server i didnt noticed there're 2 chat for v13 n v14
Documentation suggestion for @fervent umbra:
VoiceState#disconnect()
Disconnects the member from the channel.
yea
@fervent umbra there u go
yeah ty
np
someone help plz
if you're pushing globally then try a guild scope for now, if that works then push global
Client (extends BaseClient)
The main hub for interacting with the Discord API, and the starting point for any bot.
Documentation suggestion for @soft maple:
Client (extends BaseClient)
The main hub for interacting with the Discord API, and the starting point for any bot.
#app-commands @soft maple
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
show the code
1 sec
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)
just the part that bans the member
Documentation suggestion for @scarlet tangle:
GuildMember#ban()
Bans this guild member.
its in the file
as the error told you, it takes an object now
and not the kick?
is the kick gonna take an object soon too?
kick doesn't because the reason is the only thing you can set
ohh icic
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
0-7
does the filter option on the collector still gets the interaction as its first input?
yea
I was wondering because the types just say its unknown and its more than 1 input, and the website is empty doesnt have anything on them
Website ref: https://discord.js.org/#/docs/discord.js/main/typedef/CollectorFilter
I wonder, is multiple choice coming to modals?
Nice!
Select Menus are coming "soon"
Ok, also will modals be able to read labels after a user submitted them? Rather than just IDs and Types.
Not sure what you mean
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.
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
Ah.
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);
ButtonBuilder
also EmbedBuilder
oh ty
yeah was gonna ask
and ActionRowBuilder
adn you can import PermissionFlagsBits from discord.js because discord.js reexports everything from discord-api-types
I also have the same problem, ok but how do I solve this now, how to add connection time

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?
^14.0.2
yeah, as above then
okay, thank you!
So now it's v15 ?
nah its v14 but with new features faster
Ah okay
14.1
or 14.0.x
depends 
Milestone is 14.1 tho
Apparently we always make milestones as minors
#998358469268754454 message
I assume the patches just gets picked out of them
If needed
Yeah if a patch release is needed it shouldn't be sitting in dev very long lol
Ooh mhmm
8311 can be released alongside it
is there a way to set the attachment type in slash commands? Because I don't want to accept everything, is crashing the bot
no
You can check the file type when you receive it
file.contentType is the MIME type of the file
yea byt u cant set file type to optiom
ok, I will just get the last chars after the "." of the attachment name and check the extension
yea but contentType did it for you
is there a list of the types?
idk google it but really much
ok ty
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
sus are sure that is it this client
How can ifix it
Oh wait
How are you```
#archive-offtopic for small talk
update nodejs



Popular Topics: Embeds