#djs-in-dev-version
35223 messages · Page 21 of 36
Well, fuck it, its alr,
now that work, with channel set
on the bright side, less work when new features only release to v14

Im mad.
Did they really do it? We can't use HEX color now?
import the builder from discord.js
oh, yeah, didn't see. thanks.
Does anyone know how to use canvacord in djs v14
this is the code
error
worked on djs v13
you're passing 1 as the first argument to the Attachment constructor
how i fix doe?
1 is certainly not a bufferresolvable
maybe data ? ._.
wat
how it went to 1
because you put it there
Still
since the error is coming from canvas, it probably is failing at rankcard.build(), or even before that
then what do i do to fix?
¯_(ツ)_/¯
doesn't seem related to discord.js
Hm, what can i use instead of canvacord?
Canvas
alr
what is wrong
btw i reseted token
how should we know
can i pls get help
im bad at js
The key of your token is the token itself? That looks wrong
what do i need to do?
just pass the token to the client.login() function
k htanks
how do I fix this
you are passing a builder where an array of builders is expected, most likely add/setComponents
for the second one ActionRowBuilder takes a generic
any guide for the dev branch?
There's an unreleased guide for v14, yes
https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html
okay thanks
Wait, for real?
Is there a reason for no announcement about that?
is SlashCommandBuilder#setDMPermission working correctly?
yep
I use it and it works
embed.from effectively clones the embed right
make the input embed mutable, yeah
yes
you can only check if they boosted your server
I mean you could check if they have a banner, they can only have one if they have nitro
right
you can only check if they boosted your server
everyhing else is oauth2
Not how it works
Not afaik
can u limit visibility of commands to permissions
SlashCommandBuilder#setDefaultPermission() DEPRECATED
Sets whether the command is enabled by default when the application is added to a guild.
miss click i mean .setDefaultMemberPermissions(...)
why is interaction.options.getMember("user").avatarURL({ extension: "png", size: 512 }); logging null?
does they have avatar?
member has no avatar
surely it just gives their user avatar if there's no guild avatar?
Use displayAvatarURL()
if guild avatar is null?
yeah avatarURL returns guild avatar
displayAvatarURL returns guild avatar, if none, user avatar, if none, default avatar
Such as?
you don't
Anything that was removed is probably because Discord removed it or bots weren't meant to see it or something
discord undocumented them
What even was a sync id
I don't remember the details but I know Spotify integrations changed
I still see it on the docs for main though so
It doesn't look removed to me

#7844 in discordjs/discord.js by almeidx merged <t:1650925845:R>
refactor(Activity): remove undocumented properties
i would know that they were removed
Maybe mine didn't refresh then
when did i say discord or spotify removed it?
not really
We're not going to add undocumented things back to discord.js
Dude stop
It's not in discord.js, we're not adding it back to discord.js, it's not up to us to find hacky broken solutions for you
Hi guys, just a quick question.
Is permissions v2 fully complete yet?
My default_member_permissions and dm_permission properties don't seem to be taking affect and I don't see these properties in the command transformer in djs.
if you use @discordjs/rest to deploy your commands it should work
the latest dev version of builders has support for them too
"don't seem to take effect" by?
the UI currently shows
at-everyone for default perms set
but the effect of not being usable by people not having the perm persists
for discord.js itself
I've always used the application command manager to deploy them
there's a pull request for it
#7857 in discordjs/discord.js by ckohen created <t:1651099837:R> (changes requested)
refactor(ApplicationCommand): permissions v2
📥 npm i ckohen/discord.js#perms-v2
In DM channels I can still see the commands even though they're set to false.
Additionally, other users can see commands which have default permissions higher than the perms assigned to the members.
you'd need to set the fields after finalizing the builder, i suppose
(so after the #toJSON call)
using them at the correct endpoint should still work
builders already has support for the new properties
oh, we're in at-dev, right
I build my commands manually using json
at least for default member permissions i have tested them and cannot reproduce any issues with them applying, apart from the GUI in server settings
they use the djs manager to create the commands
guess we don't transform the snake case then?
the command object creation is hardcoded if that makes sense
"unknown" properties arent passed to the api at all
ew
if you don't want to wait for the PR you could always use the rest route directly, i guess
I'll look in to that, even to just bulk set all my commands as a quick fix until the PR is merged.
Then it is wrong
Or its ephemeral
Or its already been deleted
Something seems fishy here. You're getting a unknown message error but you're saying the message id isn't wrong :thinking:
Oh right, nice Promise chain
well that code is incorrect
But yes, its coming from the fetch, because the id is wrong
or not in that channel or something
Couldn't you just do ButtonInteraction#message#delete()?
Is that the message id
The error comes from Discord so... something is wrong
I really cant see any reason you wouldnt be able to fetch that message if the id is actually correct
Does the bot have READ_MESSAGE_HISTORY permission?
That'd probably be a missing permissions error
Is it even in the same channel? :thinking:
Not a DM channel is it?
Yup well we're really only back to one possibility. The only reason Discord would return a 404 Unknown Message is if the id you provided doesn't match a message
and how is it stored in your code
as what column type
Looks a bit like a number
Needs to be stored as TEXT or VARCHAR or whatever mysql calls it
Unless theres some weird shit going on where slash command response messages cant be fetched using regular message fetching, which I'm definitely not aware of there being any such limitation
no
const member = interaction.options.getMember('member');
const userFlags = member.user.flags.toArray();
error:
Property 'user' does not exist on type 'GuildMember | APIInteractionDataResolvedGuildMember'.
Property 'user' does not exist on type 'APIInteractionDataResolvedGuildMember'.
if (!interaction.inCachedGuild()) return;
??
??
i gotta add that below the member constant ?
at the top of your code after interaction is defined
can explain how this works ? it's a weird one
you can receive interactions in a non-cached guild and get a the API GuildMember object
also is it better to use a type guard return object or ? when object is null ?
dunno
alr thanks
? use 3x memory than &&
Dang, nice
full code?
and what line is the error
are you deferring within 3 seconds of receiving the interaction?
if it’s on the first then you are deferring too late as Squid said
hello, I have a little problem with the dev version of discord.js
what problem
I can't use options in my / commands
Maybe you didnt add them
show code
import {
ApplicationCommandType,
CommandInteraction,
GuildMember,
InteractionResponse,
} from "discord.js";
import { BaseClient } from "../../client/BaseClient";
import { Command } from "../../utils/structures/Command";
class Emit extends Command {
constructor() {
super({
name: "emit",
description: "Emit event.",
type: ApplicationCommandType.ChatInput,
options: [
{
name: "eventName",
description: "Name of the event",
type: 3,
required: true,
choices: [
{
name: "test",
value: "test",
},
],
},
],
});
}
run(
client: BaseClient,
interaction: CommandInteraction
): Promise<InteractionResponse> {
console.log(interaction.options);
const eventName = interaction.options.get("eventName")?.value;
switch (eventName) {
case "guildMemberAdd":
client.emit("guildMemberAdd", interaction.member! as GuildMember);
interaction.reply({
content: "guildMemberAdd event emit with success.",
ephemeral: true,
});
break;
case "guildMemberRemove":
client.emit("guildMemberRemove", interaction.member! as GuildMember);
interaction.reply({
content: "guildMemberRemove event emit with success.",
ephemeral: true,
});
break;
}
return interaction.reply({ content: "DEBUG FUCK DISCORD !" });
}
}
module.exports = Emit;
logs of my commands collection
first command is not available in my server, second is available but I don't have options
I just have the last reply when I execute the command
I'm too lazy to read
then why do you answer
I'm trying to understand what he wrote but I don't understand
@vapid agate well, it seems like everything should work according to the code
I can't figure out what the problem is yet
me too
and the command is not being created or what?
in fact, commands with options are not register in my server
it happens that the command is not visible to you, but it has already been created. go back to discord or if you have already done this, check that you have not created it globally, because there is a limitation there
all commands are register only in my dev server, not globally
console.log(client.commands.size); // 3
console.log(devGuild?.commands.cache.size); // 0
try creating a command manually
I don't understand why the second log returns 0 because I have 2 commands actually available in my server
Well did you fetch the guild commands?
guild.commands.fetch()
with fetch method, I see 2 commands
options of the second command (emit) is empty
so that's your answer why you don't see the options
but why ? 🤔
you prob registered the guild commands without options
when i start the bot, commands are registered again
guild commands or global ones
problem is : I can't register commands when they have options
I use only guild commands for dev
well the code should be working fine
which djs version are you on
"discord.js": "^14.0.0-dev.1652702635-5e9b757"
I discover this bug with the emit command :
in a first time, i try to register command with options : command does not appear in my server (not register)
I remove options => no problems, command is register
I retry with options => command is register and appear in my server but without the options (because the options array is empty)
Seems like option name must be all lowercase
it's works but not really
my bad, it's works ! Thanks
😭 just for a lowercase
interaction.guild.me do not exist anymore?
it does
it's now interaction.guild.members.me in v14
thanks bro 🤝
you forgot to close the bracket after fetch()
and its client.users not client.user
This shouldn't even work at all
It should be a different error
TypeError or SyntaxError
what is this err?
dont see an error
so what is it?
you tell me
Looks like a get gateway bot log
you should know what you are logging
Why are you using type?.stack instead of just type (it's a string)
Also multipleResolves is deprecated actually
Promise.race() can trigger a 'multipleResolves' event
Event: 'multipleResolves'
The 'multipleResolves' event is emitted whenever a Promise has been either:
Is there any replacement for Util.splitMessage?
No
yes
String.prototype.split()
The split() method divides a String into an ordered list of substrings, puts these substrings into an array, and returns the array. The division is done by searching for a pattern; where the pattern is provided as the first parameter in the method's call.
why you remove splitMessage() 😠
have a thread <#976027159288221706 message>
I thought it already did that
It doesn't look like it's set there?
Do you guys think it's worth opening a PR to have the return type set to
numberif required is set to true
isnt that what required already does
hmm
This line should be doing that already
I can't reproduce that
You clearly arent setting required though, yeah
uhhh.... I dont know what that line is, you've wrapped it in your own function?
...where
this is not set to true
....no
Doesn't that overload say if it is not there, then it is number | null? It looks like it's working as expected to me
Its showing you both possible overloads
Thats not how that works
It doesnt know what option you defined in a JSON builder
Its telling you that the method takes two parameters, the second one being a boolean
Which you did not provide
So its false
.getNumber('amount', true)
Gonna ask you not to use that word, but glad the issue is fixed
Wrong guild id, or bot not in guild
So logging above gives you the name?
That doesn't make sense
return null
Then this error isn't coming from this fetch. Also why u need to fetch a guild. Iirc All the guilds are cached anyway
full error so we can know what is it missing access for
discord.GatewayIntentBits.Guilds,
^
TypeError: Cannot read properties of undefined (reading 'Guilds')
at Object.<anonymous> (D:\Other\Coding\discord\ChatBot\ChatBot Alpha - (v2 testing)\V14-DJS\index.js:15:28)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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:81:12)
at node:internal/main/run_main_module:17:47```
Is it not `Guilds` anymore?
IntentsBitField (extends BitField)
Data structure that makes it easy to calculate intents.
oh nvm it seems i installed d.js v13 when trying to install some other package 💀
mb
Can I somehow retrieve the customId I set for a ButtonBuilder, I used to just get it from the ButtonComponent but it's constructor is now private, so I cannot use ButtonComponent anymore
Builder.data.custom_id?
try that
not in the list
custom_id
intellisense is not documentation
Its Typescript
though im not sure builders are documented so
Well not all buttons have a custom id
So it's not going to show up unless it can narrow the types
Shouldve mentioned that sorry :)
Yeah I could cast it to APIButtonComponentWithCustomId but that's ugly
Its strange because
export declare type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
but custom_id is not one of the properties I can chose from even though the e.data is an APIButtonComponent
So I cant even narrow it :/ right?
Its because the types arent narrowed
custom_id is not available on url buttons
Its still a union, meaning it doesnt know which one of the two it is unless you check the type first
yeah but then custom_id would be undefined | string no?
no
That’s not how ts works
If a property doesn't exist (on a possible type), it's an error
So how could I narrow it if I cant check if the property exist? Cannot even ?. it
I can use the in keyword, never knew that existed, thanks Monbrey and KinectTheOctopus
Or you can use button.style !== ButtonStyles.Link
Why am I getting this error?
what is embed
show how you defined it
const embed = message.embeds[0]
EmbedBuilder.from(embed) returns a builder from the original embed, you'll have to use that instead, e.g. EmbedBuilder.from(embed).setColor()
ah
and don't you need to have EmbedBuilder imported from discord.js instead to use Builder.from?
how can i delete the content of the message and edit the embed?
try edit({content: null, embeds: [...]
i'll try, give me a min
worked, thanks
you're welcome 🤠
Hey all, is there a way to convert a permission string (any format) to a PermissionFlagBit?
show an example of a "permission string"
use the resolve method on the permissions class?
it can either be "SendMessages" or SEND_MESSAGES or tbh any format of a permission xD
you need to first convert to PascalCase then resolve
PermissionBitField.resolve(<PermissionResolvable>)
https://discord.js.org/#/docs/discord.js/main/typedef/PermissionResolvable
however the NON_PASCAL_CASE doesn't work anymore 😛
Got it!
let permissionResolvable = PermissionsBitField.resolve(command.permissions as PermissionResolvable);. I had to "typecast" the string array to PermissionResolvable since i'm using TypeScript
Thanks for the help :)
Hi, how can i check bot permissions in v14?
guild.members.me.permissions
thank you
I think .me has been removed. didn't work when i tried it today
it's guild.members.me
Uh sorry
Is textInput the only component that we can use in modals?
for now
new ActionRowBuilder<SelectMenuBuilder>()
how can i collect modals using a collector
CommandInteraction#awaitModalSubmit()
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
Do you know how I can start my bot (in typescript) with pm2, or is there an alternative ?
You should be compiling it to JS anyway
How can i fix this?
Documentation suggestion for @kind pulsar:
Channel#isText()
Indicates whether this channel is a [TextChannel](<https://discord.js.org/#/docs/discord.js/main/class/TextChannel>).
DiscordAPIError[10062]: Unknown interaction
at SequentialHandler.runRequest (C:\Users\ABHISHEK\Desktop\Celestial\node_modules\@discordjs\rest\dist\index.js:709:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\ABHISHEK\Desktop\Celestial\node_modules\@discordjs\rest\dist\index.js:512:14)
at async ChatInputCommandInteraction.deferReply (C:\Users\ABHISHEK\Desktop\Celestial\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:68:5)
at async Play.InteractionRun (file:///C:/Users/ABHISHEK/Desktop/Celestial/commands/music/play.js:50:13) {
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'post',
url: 'https://discord.com/api/v10/interactions/976736461518954506/aW50ZXJhY3Rpb246OTc2NzM2NDYxNTE4OTU0NTA2OjVPU29PN0ZHdjhOWGRsb1RQaXlIQUxMSWZPbEk5M1V3SmJ6OGlHVHpYT3VKNUNTanh2V2dYNnBNVnZJdzBKMFRUNzZwV0kxV1lVeVdyV0t0TmZSa3J5QXA0RFdKTTZ4VjJWYVJOcHVtZWk1MGhLNjlPbDJSNEFJS2lVbElqTmc1/callback',
requestBody: { files: undefined, json: { type: 5, data: [Object] } }
}
Im receiving this error on interaction.deferReply() the time it takes to execute the code before interaction.deferReply() ranges from 5-10 ms so I am sure that it does not cross the 3 second limit. and after it sends the error, the bot also sends a message using interaction.editReply() below in the code. Im not sure how interaction.deferReply() creates an Unknown Interaction error but proceeds to send an reply using editReply() right afterwards.
does anyone know whats happening?
also if i try doing interaction.reply() after interaction.deferReply() it shows this error
DiscordAPIError[40060]: Interaction has already been acknowledged.
at SequentialHandler.runRequest (C:\Users\ABHISHEK\Desktop\Celestial\node_modules\@discordjs\rest\dist\index.js:709:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\ABHISHEK\Desktop\Celestial\node_modules\@discordjs\rest\dist\index.js:512:14)
at async ChatInputCommandInteraction.reply (C:\Users\ABHISHEK\Desktop\Celestial\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:110:5)
at async Util.error (file:///C:/Users/ABHISHEK/Desktop/Celestial/structures/Util.js:169:17) {
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'post',
url: 'https://discord.com/api/v10/interactions/976736461518954506/aW50ZXJhY3Rpb246OTc2NzM2NDYxNTE4OTU0NTA2OjVPU29PN0ZHdjhOWGRsb1RQaXlIQUxMSWZPbEk5M1V3SmJ6OGlHVHpYT3VKNUNTanh2V2dYNnBNVnZJdzBKMFRUNzZwV0kxV1lVeVdyV0t0TmZSa3J5QXA0RFdKTTZ4VjJWYVJOcHVtZWk1MGhLNjlPbDJSNEFJS2lVbElqTmc1/callback',
requestBody: { files: [], json: { type: 4, data: [Object] } }
}
but i dont understand how the interaction has been acknowledged if it errors on interaction.deferReply() itself?
would suggest you are trying to defer an interaction that has already been replied to
also if i try doing interaction.reply() after interaction.deferReply() it shows this error
that is expected. if you defer, you have to edit, not reply
if you reply that's an initial response, but defer is also an initial response, having two of those will result in "already been acknowledged"
Code
console.log(interaction.isRepliable(), interaction.deferred, interaction.replied)
Console
true false false
but then why does it error with Unknown Interaction?
unknown interaction would imply that the webhook token for that interaction is expired 
it takes 5-10ms
not more than 3seconds
do you get the red "interaction failed" in the client?
nope
it executes all the code
that suggests the interaction was acknowledged
so the unknown interaction error has to come from another interaction
let me check, I am further editing the message after replying to the interaction so that might cause the error
thanks, i fixed it after you said that its coming from another interaction i killed the terminal and tried it again
works now
thanks for help
@d.js docs#1083
**How to Get Your Game on Discord: **
read more
@obsidian thistle #app-commands
How stable is v14? Is it okay to be used in prod?
no one here will recommend you to use dev ver over stable for prod
true
So I Switched to v14 for my bot which I started developing 3 months ago. It is stable enough for the development and I assume v14 will become stable when I am done with the feature implementation. So if you already plan to do A major rewrite of your bot, I think you should at least have a look at the dev branch but for a complete production environment I would definitely not use it.
it's just that things can change unexpectedly
ahh yeah
sadly i just co-finished a major rewrite to v13 from python codebase I inherited 💀
yes and v13 is getting support a bit longer, v14 isn't released and v13 is apparently supposed to get updates
staying in v13 isn't a bad idea
not to mention that moving to v14 is a horrible idea
i thought 13.7 was the last release for v13?
so far yes
doesnt mean that will stay like that
When discord.js v14 will be realesed?
when its done
we dont do etas
discord v14 🤔
Discord.JS
@d.js docs#1083

why are you trying to ping the bot
How do I need to use GatewayIntentBits?
You can just import IntentsBitField from djs
IntentsBitField (extends BitField)
Data structure that makes it easy to calculate intents.
Okay thanks
what is this err for?
You tell us
looks like a missing perms error without having the actual error message
It looks like an internal server error, judging from the status code
Why does it tell me that TypeError: MessageEmbed is not a constructor? I am using discord.js@14.0.0-dev.1652918983-adf461b.
This is the code:
const { MessageEmbed } = require('discord.js');
const { SlashCommandBuilder } = require('@discordjs/builders');
const { NLD } = require('./parteien.json');
module.exports = {
data: new SlashCommandBuilder()
.setName('partei')
.setDescription('Zeigt Informationen über Parteien an.'),
async execute(interaction) {
const partei = "NLD";
const parteiEmbed = new MessageEmbed()
.setTitle(`Über ${partei.Name}`)
await interaction.reply({ embeds: [ parteiEmbed ] });
},
};
Its EmbedBuilder now
ah okay
Import ChannelType enum from discord-api-types and use ChannelType.GuildCategory instead of numbers
Ahh, i see thank you, nicer way of doing things
I think I have found a bug or is it just me with my bad coding skills, I tried to add fields but it just throws this error at me
you passed objects instead of an array
selectbox probably
aj
ah, I am stupid lol
Same error
then show your code
const parteiEmbed = new EmbedBuilder()
.setTitle(`Über ${partei.Name}`)
.addFields(
{ name: 'Name', value: `${partei.Name}`, inline: true },
{ name: 'Kürzel', value: `${partei.Kuerzel}`, inline: true },
{ name: 'Vorsitzende', value: `${partei.Vorsitzende}`, inline: true },
)
await interaction.reply({ embeds: [ parteiEmbed ] });
works fine without the .addFields() section
that takes an array as well
you didn't pass array array is []
Wait. I never passed an array there and it always worked flawless?
It was changed
oh
I mean you are using a dev version
changes happen all the time
yeah, the problem is I have to use the dev version just for one thing and that is interaction.options.getAttachment()
attachment options are in v13
I tried but it didn't work, in @builders there is already the option to add it as an option to your slash command but in the default library there wasn't a way to get it
its in 13.7
ah
Where is the typing for Message Payloads using EmbedBuilders?
cuz on Discord.MessageOptions Embed.data doesnt exist (since its an API Embed)
So you want to get the embed from a message?
yes
EmbedBuilder.from(apiembed)
afaik

wrong answer, i already have the embed from a message
i need the Message payload typing where <msg>.embeds.[0].data exists
EmbedBuilder.from(msg.embeds[0])
that gives you an embed where you can call .data on
or what exactly are you trying to do
i want to define typing
for TypeScript
but using Discord.MessageOptions TS errors with this
i think the type is Embed
I mean yes, there is no data property on apiembed
so why would you define it
im not trying to define embed.data, im trying to find the correct typing where embed.data exists on the payload
getting this error repeatedly, wasn't getting this in earlier releases of v14 (running Button.interaction.deleteReply, Button.interaction.update): DiscordAPIError[10015]: Unknown Webhook```
{
rawError: { message: 'Unknown Webhook', code: 10015 },
code: 10015,
status: 404,
method: 'DELETE',
url: 'https://discord.com/api/v10/webhooks/967521712931487754/aW50ZXJhY3Rpb246OTc2OTg1MjQ2NDI1ODMzNTEyOlNjczZFa0Y0ajkyeVZLYWpRSEoybzFkM0dyRHJFNWRPbXNuZmtkZFFBem04VEpDVzlYclZBZWhVQWsxclRvY2dhSnNOZEV5N3NkV0RTVnJlWHNkN0VZY1dRQXNRT2JnRHNOMjdBTFlld0xsQmJZenZrUTdXQngxejVYYm9tbzVw/messages/@original',
requestBody: { files: undefined, json: undefined }
}
this only occurs after the three seconds that the bot has to reply before the interaction times out
this only occurs after the three seconds that the bot has to reply before the interaction times out
Isn't that your issue then?
it replies with "unknown webhook" and it does this every single time
But... isn't that your issue?
You said it only occurs after the three second window. Why would it even work after that?
Attempting ```js
let guild = client.guilds.cache.get(guildCfg)
let member = await guild.members.fetch(user)
console.log(member, member.nickname)
Returns: ``@pine sentinel``, ``null``, Not really sure what's going on.
Cannot reproduce
Which version?
I could ask the same to you, since you didn't provide any (':
Running discord.js@14.0.0-dev.1652918983-adf461b
I'm on the same commit
Interesting
will also try to repro, hold on
Member fetching hasn't changed in version 14. You're doing something wrong
Are you sure the user has a nickname set?
Is that the concern? My concern was them logging the mention instead of the whole object
Holy shit
Apparently I am fucking dumb.
Using member.user.username worked.
You could’ve done user.username or member.displayName
T_T btw, logging member won't be the mention, I thought that was the issue you were having
This is also odd, considering I am not tostringing the member object
Did you override console.log?
Uwot
nickname is only set if the member changed it
displayName is nickname ?? user.username
ah
I looked in search history bc I thought I was missing smth
Felt like you guys have alr spoken before
i love discord js
cool
Cool, me too
Is there any guide about new permissions system and how can I use them in slash commands creation
currently a pr i think
k thx
TextInput aka modal is considered a MessageComponent?
no
so why is TextInput under ComponentType? is there a difference?
dunno why its ringing up as any
ig I found a bug in djs v14 :/
video soon
it's a component but not a message component
it showing up as any is an issue with your IDE, maybe cached typings?
oo ok ok, but it still has the componentType.TextInput as its commandType?
just to confirm^
if you want to add one to an action row then yes, that would be the type
thanks 👍
one more question,
so one of the ComponentTypes is ComponentType.ActionRow. and lets say i have an interactionCreate event on, would any interaction have a commandType of ComponentType.ActionRow?
Interaction#commandType is one of ChatInput, User or Message (the latter two for context menus)
Interaction#componentType is the component that triggered an interaction, either a button or a select menu
action rows are only container for components, they do not trigger interactions
ah ok, thanks
and with the included ComponentType.TextInput, im guessing that triggers with the ModalSubmitInteraction?
it should give the role when I dont have the role and if I have it it should remove it :/
the result of console.log
Code:
if (!mMember.roles.cache.has(selectedRole)) {
await mMember.roles.add(selectedRole).catch(e => console.log(e))
await interaction.editReply({ content: `Role ${selectedRole} be ${mMember} dade shod` })
return collector.stop()
}
if (mMember.roles.cache.has(selectedRole)) {
await mMember.roles.remove(selectedRole).catch(e => console.log(e))
await interaction.editReply({ content: `Role ${selectedRole} az ${mMember} gerefte shod` })
return collector.stop()
}
Full Code: https://sourceb.in/2b2xqGu6E8
any idea? 0.0
definitely not bug, your logic error
text input components are part of a modal which you can show to the user in response to an interaction, when the user submits it you get a ModalSubmitInteraction with the values the user filled out in the components, though d.js provides ModalSubmitInteraction#fields so you only need to know the customId of the components
alright, ty for clarification
selectedRole is of type Role, caches are keyed by id
tnx <3
Hi guys,
What can cause this problem ? DiscordAPIError[50001]: Missing Access
I'm trying to register a slash command in my guild.
Here is the ready event :
module.exports = {
name: 'ready',
once: true,
async execute(client) {
const guildId = await Config.findOne({ where: { name: 'guildId'} } );
client.guilds.cache.get(guildId?.value).commands.set(client.commandsArray);
},
};```
Here is my command handler :
```js
module.exports = (client) => {
client.handleCommands = async (commandFolders, path) => {
for (folder of commandFolders) {
const commandFiles = readdirSync(`${path}/${folder}`).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`../Commands/${folder}/${file}`);
client.commands.set(command.data.name, command);
client.commandsArray.push(command.data);
console.log(`✅ Commande ${command.data.name} chargée !`);
}
}
};
}```
And finally, a command :
```js
module.exports = {
data: {
name: 'relancer',
description: 'Permet de redémarrer le régent.',
type: ApplicationCommandType.ChatInput,
},
async execute(interaction, client) {
await interaction.reply({ content: `⚠️ Redémarrage en cours... ⚠️`, ephemeral : true }).then(() => {
process.exit();
});
},
}```
reinvite the bot with the applications.commands scope
ok thanks 🙂
you don't need to kick, just make an invite link and use that again
Works ! Thank you !
no thank you!
Anyone knows howto get random color in embed using Colors constants ?
before, i used .setColor("RANDOM") but now, we shouldn't use strings so...
you can use strings
Yup, .setColor('Random') works
what is this err for? 🤔
When you respond to an interaction too late
ok tnx <3
sorry for late response
my issue is that no matter what i do i ALWAYS get a response JUST after the period ends, making me think something is weird with the request being sent itself
Your replying twice
How can i change a specific field from an embed ?
I've tried this :
const { message } = interaction;
const embed = EmbedBuilder.from(message.embeds[0]);
if (!embed) return;
embed.fields[1] = { name: `⛔ Status`, value: `Refused` };```
```TypeError: Cannot set properties of undefined (setting '1')```
Documentation suggestion for @proud wigeon:
EmbedBuilder#spliceFields()
Removes, replaces, or inserts fields in the embed (max 25)
ohhh...
i'm not replying twice, i'm not even replying a second time -- i'm just running ButtonInteraction.deleteReply(), exactly as Monbrey had suggested/recommended a while back
ButtonInteraction#deleteReply()
Deletes the initial reply to this interaction.
while this method is also present on ChatCommandInteraction, the update method is not, and that method is also failing in the same manner (unknown webhook)
note that the contents for the ButtonInteraction.update() and ChatInputCommand.reply() are gotten via the same non-deterministic calls (they request a random post from a site's API using a custom wrapper I wrote), so contents of these messages should not be the issue
i've just tested using ButtonInteraction.followUp, same exact result. i'm starting to wonder where the Webhook tokens are stored for command replies
Hi, im getting this random error for some reason. I dont know why its happening, there is no was to find any my code.
Anyone knows how to debug this please?
It means that user is not in the server
Ye, i get that. But how can I know, where its happening
I have large bot
It's a fetch
I can't really say anything else because stack doesn't show it
Ok, i have commented one fetch that is not under tryCatch
lets see, thanks
just to humor everyone who's been saying ButtonInteraction.message.delete, I tried that. it works in servers but not in DMs, and I need this to work in DMs as well
using an empty ButtonInteraction.message.edit does not work either, as i get a 50006 "Cannot send an empty message" API error
and because it's finally gotten to the point where i cannot see a way forwards without it, code
// file "main.js"
import * as Commands from "./commands/commands.js";
import * as Buttons from "./buttons/buttons.js";
// ...
client.on("interactionCreate", async (interaction) => {
if (interaction.isChatInputCommand()) return handleChatInputCommand(interaction);
if (interaction.isButton()) return handleButton(interaction);
});
async function handleChatInputCommand(command) {
return await Commands[command.commandName](command);
}
async function handleButton(button) {
return await Buttons[button.customId](button);
}
// file "buttons.js"
export {new_random_post} from "./newRandomPost.js";
export {delete_message} from "./deleteMessage.js";
// file "deleteMessage.js"
export async function delete_message(button) {
return await button.message.delete();
}
so you want to delete the message attached to a button interaction? I am doing something similar in my bot with ButtonInteraction#deferUpdate followed by ButtonInteraction#deleteReply
that's actually precisely it, could i peek at the relevant portions of your code?
wait, deferUpdate? that's a new one
that is ridiculous
deferUpdate has just magically solved my problems
you need a reply to use deleteReply, and deferUpdate is just that
the weird thing is i never had to do that on earlier versions of v14
what if i wanted to check the ID of the user before doing an update, to verify it was the same user?
message.interaction.userId is a thing, but I'm not sure if the userId is part of the partial data
nvm that
user.id if at all
so something along the lines of button.message.interaction.user.id !== button.user.id?
yep, but dont know if the user is on message.interaction, will have to try that
return await button.deferUpdate({fetchReply: true}).then(async (reply) => {
tags = Tags.fromURL(button.message.embeds[0].url);
return button.update(ReplyBuilder.embed(await SiteApi.getRandomPost(tags)));
});/*
```this is giving me an issue of "reply to this interaction has already been sent or deferred". how do i un-defer it to reply to it?
would i use the reply parameter as `reply.update` instead?
or would i await and then reply outside of it?
Documentation suggestion for @hybrid crest:
MessageComponentInteraction#editReply()
Edits the initial reply to this interaction.
I feel dumb for not understanding the changes to actionrowbuilders committed 2 days ago, apparently .addComponents doesn't exist anymore?
still exists
last changes I see are from 29 days ago
even setting the type as a button builder <ButtonBuilder> it still complains
so frustrating
Have you restarted TS Server/VSC?
whats the name of the collector typing for the MessageComponentCollector
oh i guess its the InteractionCollector
dang, restarting vscode was it. ty
Yeah if you change a version of something and the typings are weird, just restart it first
what does this mean? Why cant i set inline to boolean or undefined
well whats inline defined as
a boolean.. at least it should be
Can you show it?
it loops through the fields of another embed and sets them on a new one
embedToUse.data.fields.forEach((...[name, value, inline]) => {
if (!embed.data.fields) embed.data.fields = [];
embed.data.fields.push({
name: name ? mod(name, { [option[0]]: option[1] }) : null,
value: value ? mod(value, { [option[0]]: option[1] }) : null,
inline: Boolean(inline) || undefined,
});
});```
Boolean() fixed it
PermissionResolvable why its doesnt work?
gonna have to give waaaaaaaay more detail than that
I mean to get all the permissions by autocomplete e.g. userPermissions: 'Administrator' it auto complete all permissions
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.
and also this I think this is a error from discord.js
It's not
It's from undici
I mean, its a core djs dep
But generally this just means your internet is down or something
Its not djs at fault
okay thanks
What is EnumResolvers now
Did it get renamed
removed
Then how
ButtonStyle?
If I do buttonstyle this happens
Thats not a button style
Thats not anything
ButtonStyle.Secondary
Nope
I defined
secondary
That should work, right?
Well that seems very pointless but okay, that would have been very relevant to know before
Its because youre not passing an array to addComponents
Oh
how do I get a autocomplete for slash cmd options?
specify autocomplete: true on string/number option
Not that
ApplicationCommandOptionData this?
not sure what you are trying to achieve
can you elaborate again
nvm
BTW how do I get a enums
PUBLIC ENUM
Is that a package?
idk it just randomly came into my mind after seeing "enum"
you require it from djs like
const {ButtonStyle} = require("discord.js"), read the guide and the docs
TS2339: Property 'me' does not exist on type 'Guild'.
it's <Guild>.members.me now
oh okay
TS2304: Cannot find name 'IntentsBitField'.
IntentsBitfield
oh- my bad
Frick even that changed
✨ Breaking Changes ✨
error TS2339: Property 'guild' does not exist on type 'never'.
is it member or members?
Property 'members' does not exist on type 'VoiceState'. Did you mean 'member'?
same thing
um ur using typescript ?
define the types of objects
he said guild not voiceState
VoiceState#guild
The guild of this voice state
Help
I mean for the activities like PLAYING, WATHING
ActivityType enum
How about this? #djs-in-dev-version message
you pass undefined in your setColor
Thanks
BTW IDK why I get that error but I use this hex color #ff0000
can u show it?
Uncaught DiscordjsError RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: GUILDS.
Help?
PascalCase:
Guilds
wdym
use GatewayIntentBits.Guilds, it's pascalcase
or intentbitfields, whichever you're using idk
Only Intents that I use are these
then use [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMessages, Discord.GatewayIntentBits.GuildMessageReactions] and so on..
in v14 you don't use strings or magic numbers, you use enums
oh ok
np
you can use them too
you can with pascalcase?
yep
intents: ['Guilds']
oh never knew that, thought everything got switched to enums 😂
btw is there a github page for v14?
There's a guide (wip) in the pinned messages
that isn't what I mean, I meant is there a github page to report bugs and issues?
Yes the GitHub, the dev code is based on the main branch
Where can I find the patch to see localized slash commands?
in discord developers server
do you have an invite link to that?
client.user.setActivity('text', { type: ActivityType.Watching });
```does not work
Works for me
<guild>.me was removed?
Yes
Use <Guild>.members.me if you want to get the bot as GuildMember object
ok thx
I don't get what's going wrong
let embed = EmbedBuilder.from(JSON.parse(json));```
```json
{
"title": "Embed Title",
"description": "Test Description",
"color": 16741839
}```
```data.embeds[0].description[BASE_TYPE_REQUIRED]: This field is required```
The embed of the message has no description
Yeah I got that memo too. Printing embed returns the following:
EmbedBuilder {
data: {
title: 'Embed Title',
description: 'Test Description',
color: 16741839
}
}```
EmbedBuilder.toJSON when sending maybe?
I'm not certain on builders
You could just send that json directly though too
I need to add my own value later on like adding a text field to the builder. Would that still work this way?
Yeah
That seems exciting
Will give it a shot, thank you
Is there a autocomplete for client events?
too much vague question. what are you trying to do?
I want to make a Event class and if I click ctrl+space I can see all client events.
There's an enum iirc
wdym?
https://thumbsnap.com/i/GH1MmmXT.png https://thumbsnap.com/i/51E7PGEt.png which of the is functions falls on interaction types 2 and 3?
I think it's User/Message ContextMenu
Is the method naming not self-explanatory?
They both trigger isContextMenu
Then there’s the more specific methods to target them individually
okay
isCommand should include chat input too
Yes, I already understood that the context menu, thank you
Hey, so I am making a userinfo command in which I am getting the user's custom status emoji but when i display it in embed, it says NaN
that'd suggest you are converting it to a number somewhere
for some reason, guild.commands.fetch() is running for a very long time
sometimes there is no response from this function at all
and where did EnumResolvers go in the latest version?
it has been removed
and where the message.guild.me method disappeared
Guys, how can i use EmbedBuilder.setImage() with a local file so that the image will be inside the embed and not outside like a normal attachment ?
Suggestion for @proud wigeon:
Popular Topics: Attaching images
You can then reference and use the images inside the embed itself with attachment://fileName.extension.
read more
thanks 🙂
why ChatInputApplicationCommandData doesnt contain properties for member permissions
Because that PR isn't merged yet
:(
but can I do it with builders ?
Dunno, I dont use them
i mean, just #toJSON and then stitch it onto the object
main builders has it https://discord.js.org/#/docs/builders/main/search?query=setdefault
please explain how to add options to addChoices() (SlashBuilder)
like embedfields
.addChoices(
{ name: 'name1`', value: 'value1`' },
{ name: 'name2', value: 'value2' },
)
.setRequired(true)```
const events = [
"Коднеймс",
"Шляпа",
"Своя игра",
"Бункер",
"Дурак онлайн",
"Крокодил",
"Кто я?",
"Монополия",
"Покер",
"Пазлы",
"Сломанный телефон",
"JackBox",
"Шпион"
]
new SlashCommandStringOption()
.setName("name")
.setDescription("Укажите название ивента")
.addChoices(events.map(x => ({ name: x, value: x })))
.setRequired(true)``` I wanted to do something like this, but the builder gives an error
and what is the error
in fact map should give .addChoices() like this -> [{ name: "", value: "" }, { name: "", value: "" }] but that doesn't happen
but in .addChoices() u should add only objects not array of objects
and through what should I add an array with objects
like this
.addChoices({name: "Коднеймс", value: "Коднеймс" }, {name: "Шляпа", value: "Шляпа"} ...)
not this
.addChoices([{name: "Коднеймс", value: "Коднеймс" }, {name: "Шляпа", value: "Шляпа"} ...])
btw how has guild.me changed in v14?
.members.me
ok thx
They changed it again? Lol
yes 
imo array of objects is better because y can do for e.g. sth like this
Why is client.user.setActivity not working on this version ?? it sends a response back with null on other client properties for activity and doesn't set it on status
Cannot reproduce
You can just spread the array
oh
ye so just add ... before events.map
new SlashCommandStringOption()
.setName("name")
.setDescription("Укажите название ивента")
.addChoices(...events.map(x => ({ name: x, value: x })))
.setRequired(true)
when i send an embed it give an error like that 14.0.0-dev.1653091711-fdeac9d
you're setting an invalid color in your embed
So they changed addChoices again... Fine. Did they changed EmbedBuilder.addFields() so that we can pass objects instead of array of objects ?
No.
Why your changing it again
is 14.0.0-dev.1653091711-fdeac9d the latest version?
for dev branch i mean
well, look at the branch https://github.com/discordjs/discord.js
oh alright ty 👍
thxss
When is v14 considered ready? Is it when their are comming less prs or when alot of the issues are solved or when crawl feels like it or what?
Their
i think when its done
there* 😭
Wow
It seems more likely to be the latter tbh
The reviewers have been kinda inactive too so when they feel like reviewing all the current prs ig
k
Hi! How can I have a member's banner?
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 banner of a member who is only on one server
not possible
oh, yeah that's not available
There really is no way?
they can send their banner in chat input command attachment option

for some reason discord lets you read the global one, but not the in-guild one
Is it possible to convert message.member.permissions to a collection and then apply hasAll?
use <Permissions>.has()
So I need to put an array of permissions into the function to check if this user has 2 or more of these rights at the same time
yes
Hey, I get TypeError: MessageEmbed is not a constructor when trying to create a new MessageEmbed().
Was this changed in the Dev Build?
Yes, a long long time ago
It now uses arrays right?
Does the ModalSubmitInteraction have a update method?
The docs appear to say they do:
https://discord.js.org/#/docs/discord.js/main/class/ModalSubmitInteraction?scrollTo=update
But the types don't have the prop:
https://github.com/discordjs/discord.js/blob/main/packages/discord.js/typings/index.d.ts#L1896
(im using ts)
How is the Constructor called now?
TypeScript doesn't know it came from a message
Read the update guide pinned
I did:
thats the guide for v13
That's not the update guide pinned
The Screenshot is from this URL
No it's not
Lol
Oh sorry my fault. It redirected me
Hey, I now get ```js
CombinedPropertyError (1)
Received one or more errors
input[0]
| CombinedPropertyError (2)
| Received one or more errors
|
| input.value
| | MissingPropertyError > value
| | A required property is missing
|
| input.name
| | MissingPropertyError > name
| | A required property is missing```
With this Code: js let server_embed = new EmbedBuilder() .setTitle(`:game_die: Server Manager`) .setDescription(`Du hast ${server_amount} Server! Verwalte die Server indem du den jeweiligen Server im Select Menü auswählst!`) .setColor(0x00FFFF) .addFields([ { name: 'one', value: 'one' }, { name: 'two', value: 'two' } ])
And the addFields Code is copied from the new Guide
whats your discord.js version
discord.js@14.0.0-dev.1649937833-b01f414
Hmm that's a ~month old
oh
ill run npm i
discord.js@14.0.0-dev.1653091711-fdeac9d
you can run npm i discord.js@dev ^^
thx. it works now ^^
Hello,
I have been trying for a while to send attachments from one message to another (for ticket support). However I still get the same error and I can't find a solution.
DiscordAPIError[50035]: Invalid Form Body
attachments[0].id[BASE_TYPE_REQUIRED]: This field is required
private convertAttachment = (attachment: DatabaseTicketMessageAttachment): Attachment => {
const discordAttachment: Attachment = new Attachment(attachment.attachment_url);
if (attachment.attachment_name) {
discordAttachment.setName(attachment.attachment_name);
}
return discordAttachment;
}
export type DatabaseTicketMessageAttachment = {
id: number,
ticket_message_id: number,
attachment_url: string,
attachment_id: Snowflake,
attachment_name: string | null
}
seems like you try to send them inside the attachments instead of the files array
I get them in the attachments of a message but I have to send them as a file?
if (message.attachments.size > 0) {
for (const attachment of message.attachments.toJSON()) {
await this.contactStaff.repositories.ticketMessageAttachements.create({
ticket_message_id: ticketMessage.id,
attachment_url: attachment.url,
attachment_name: attachment.name,
attachment_id: attachment.id
}, false);
}
}
files to send new attachments, attachments to edit existing ones (that's why the id is required)
oh ok thanks
would it be safe for me to run v14 and override rest and ws version to use api v9 until the end of august? or is there something that would actually break when substituting in v9? from my limited testing it seems to work fine
Why would you use api v9 on dev?
can't toggle message content intent on since my bot was previously whitelisted without it
message content intent will be enforced on all api versions iirc
You need to instead apply for the intent by going in the developer portal
i know that, but v10 is enforcing it already whereas v9 isn't, or am i wrong?
like if your bot was whitelisted without it, you basically can't use v10 and get message content without applying and being accepted for it even though it isn't required yet
because the UI prevents you from toggling it on
and with a bot that isn't whitelisted, you can just freely toggle it on and off
Hence, you should apply for the intent
Yeah but it will in the future, it's a really temporary solution, just apply for it
not really looking for a lecture, i understand the situation and was just asking a simple question
things which are on api v9 but are implemented in a different way in v10 can break djs v14
You can ask the discord dev server
Most api version changes aren't backwards compatible
the only change i've really seen is just the message content stuff, one message from advaith points to it possibly being backwards compatible so i figured someone might know if that's true or not
this
if advaith says it then it's probably fine
I trust him
yeah except he said that because discord.js apparently doesn't accept a ws version lol
So you can only change the API, not the ws
ah okay, thanks
which permission is required by bot to unban members?
BanMembers?
or none
yes, if you can do it, you can undo it
What if I used v10 on v13
How does timeout work in discord.js v14?
not too differently from before
GuildMember#timeout()
Times this guild member out.
GuildMember#disableCommunicationUntil()
Times this guild member out.
Then why do i get this error?
I use the package called ms
Any idea how to fix?
because you supply something that's not a number where a number is expected
Uhm what?
Think i found out why
now it changed from nan to the footer
Fixed
Yo
client.on('ready', async () => {
console.log(`Ready!`);
client.user.setPresence({ activities: [{ name: 'New Members :eyes:', type: 'WATCHING' }], status: 'idle' });
});
the name isnt loading but status loaded, why tho?
client.on('ready', async () => {
console.log(`Ready!`);
client.user.setPresence({ activities: [{ name: 'New Members :eyes:' }], status: 'idle', type: 'WATCHING' });
});```
Try this and tell me if it's working
Doesn't work either it shows idle but the activities isnt loading up
you have to use the ActivityType enum instead of a string
Btw i am using v13
this channel is for v14 support
just out of curiosity, are there major changes from the v13 code and commands or they are same but with new version of discord api?
wip guide in the pins
both, but 13.7 should have every feature up till perms v2 i think
hi so i have a messageCreate event and when i console log a message's content, it's blank
client.on('messageCreate', async (message) => {
if (message.author.bot) {
return
}
console.log(message.content)
console.log(message.content.toLowerCase().includes('w/l'))
if (message.channelId === '781682961556832326') {
if (message.content.toLowerCase().includes('w/l') || message.content.toLowerCase().includes('w/f/l')) {
await message.react('🇼')
await message.react('🇫')
await message.react('🇱')
}
}
})
i'm not sure what's up with that
You probably havent specified the MessageContent intent
ah, thanks. have a great one!
im confused , how do i set Streaming status ( yes i use Dev version and not v13 ),
loike i tried 1 as discord dev docs suggested for enum and its either says playing or none at all,
i pass thr url property, my twitch link btw i also tried 0,2,3,4 and i only got playing, watching, listening, thats all.
lmk if it changes or just me being dum. ping if reply
No worries, its just me being not patient, its update soo slow :/
its enum 1
how can i receive messages of a channel and all of its threads
i dont think so
in messageCreate u can check channel.id and channel.parentId
but not as collector
how can i find a specific message in a thread
<ThreadChannel>.messages.cache.get(id) <ThreadChannel>.messages.fetch(id) <- this is better
like in normal channel ^
and remember cache is unreliable
is this ok? <Thread>.messages.find(m => m.content === message.previous_message.text);
you forgot .cache after messages
ohhh
i had it like that but it didnt find my message....
maybe the message wasn't in cache
const msg = await webhookClient.send({ embeds: [embed], username: message.author.tag, avatarURL: message.author.displayAvatarURL() });
await msg.react("978724308610351154");
await msg.react("978724321092571186");
TypeError: msg.react is not a function?
99% its api message
Ye
Invite bot, screen shows null when done, how to show discord screen instead of blank page and null?
Not discord.js related
?
Why don't you use setPresence ?
hi, when i mention channel in message collector, bot doesn't see this channel. I tried log message content, all mentions, channels mentions and nothing. Do anyone know how to fix this?
Message.content is a string
yes yes, I got lost and wrote nonsense, that's the way it should be
and this returns undefined
although I mention the channel
Do you have message content intent?
yes
full code
you went back to the "nonsense"
m.content is a string, it doesn't have an id property
oh sorry, i tried log message content and this returns nothing.
is it possible to add a video from url to an embed?
Missing MessageContent intent activation or whitelisting
how do u do that rounded screenshot thing?
Missing MessageContent activation
sharex
is it a sharex theme
yes
i tried this but
discord adds white background to it
On Discord developers portal
this intent is activated
maybe later on dm, not here
k
You can use <TextChannel>.awaitMessages instead of message collector
https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=awaitMessages
But i really dont know why you get a blank message content if your intent is activated and whitelisted
Are you sure is the same bot?
yes
i'll try
LET'S GO
ty
Did collectors got changed in any way
Or await component stuff
no
https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html
and look for it, but i dont think if it`s changed
Btw, does await messageComponent still error if the time passed?
await message.channel.permissionOverwrites.edit('759445952452362290', { VIEW_CHANNEL: true, SEND_MESSAGES: true })
there isnt any err bot the code doesnt work any idea?
anyone?
when updating to TS 4.7.2, I started getting this error on the guildMemberAdd event
basically I have an array of objects which hold the name and the args of an event, typed using the ClientEvents interface from d.js, yet it's saying this, any idea why and how to fix this?
Can you show the relevant piece of code?
there you go, code and type definitions
- {
border-radius: 0px
}
?
how do you take round pictures like that
dm them or ask in general
Hi! How can I make the options of a SelectMenuBuilder remains selected after clicking on it?
set the default value to the option the user picked and unset it from the previous one
Just keep in mind, that changes what it shows to everyone who can see it
That why do this only if your select menu is displayed per user or if it is in ephemeral message
not passing an array
yes
how so?
Which are.....
Youre removing all the useful information
Thats still not really the useful part
Are you catching this error and console.logging it or is it unhandled
what would name.changedToAt be, a date?
Youd need to provide a string
yeah, a number then
Needs to be string
I have a question, what is #isFromMessage for in the modal options?
It checks if the modal was shown in response to an interaction from a message (button, selectmenu) rather than a slash command
Because that determines if you can use .update()
and, its in v13.7.0 dont exits? and why?
Because I didnt backport it properly 😄
Oh, and its possible create a pull request to add that?
Not to 13.7 no
Its already released
ok np, thanks and good nigth
what the field amount limit for modals
25 rows/fields
thats embeds not modals
its 5 in a modal
why when I click 3 times in a row on the selection menu it shows unknown interaction?
that clicking 3 times in a row makes it reply to the same interaction
is this normal 🤔
Documentation suggestion for @dim moss:
Attachment
Represents an attachment.
Are the new Permissions V2 options for SlashCommandBuilder() available in @ dev?
Not yet
I don't think the PR is merged
Thanks, thought i was going crazy, looked like they were in the doco lol
They are available in builders @dev
SlashCommandBuilder#setDefaultMemberPermissions()
Sets the default permissions a member should have in order to run the command.
Do i need to install builders separately? I just updated discord.js @ dev and cant get them working...
nope, they are included with djs 14
Strange, bot wont start with setDMPermission or setDefaultMemberPermissions
What changed in addOptions
That would cause Received one or more errors
String overflow
you need to pass an array
anyone know why since 4h or more i can't create roles anymore with my bot ? (I have permission, intents etc)
maybe rate limit
It was my first guess but there is no message and i waited 4h before retry
listen to client.on('rateLimit', console.log) and try to create a role
The role is not created and the event is not triggered
ahhh... im sorry once again i forgot this is the dev version, there is no ratelimit event there. Maybe listen to "debug" and "warn" instead

I got nothing related to a rate limit
Hm... can you show your code?
client.guilds.fetch(config.guild).then(async (guild) => {
console.log('pls work');
const role = await guild.roles.create({
name: this.name,
});
console.log('don\'t log because the promise never finish');
const cat = await guild.channels.create(`${this.name}`, {
type: ChannelType.GuildCategory,
permissionOverwrites: [
{
id: role.id,
allow: [PermissionFlagsBits.ViewChannel, PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.UseApplicationCommands],
deny: [PermissionFlagsBits.AddReactions, PermissionFlagsBits.SendMessages, PermissionFlagsBits.AttachFiles],
},
{
id: guild.id,
deny: [PermissionFlagsBits.AddReactions, PermissionFlagsBits.SendMessages, PermissionFlagsBits.AttachFiles, PermissionFlagsBits.ViewChannel, PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.UseApplicationCommands],
},
],
position: 1,
});
});
so it is safe to assume you have the guilds intent enabled, and the client is ready when you call this
Yep, this is my client if you want
const client = new Client({intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]});
``` role creation was working a few hours ago
oh wait in debug event what does that mean
Total: 1000
Remaining: 1000
``` is this a rate limit ?
no uh I think thats just the login information, you have a thousand logins per day so it might have been reset just now, but i think that is outside the scope of your issue, I honestly can't tell what is happening
, does this console.log('pls work'); get logged at least?
no this is why i put "pls work" here lol
okay so that means that the outside scope where this fetch call is is not being triggered either, what is before this? or inside what function are you calling this
v14's rest has a rateLimited event which you can listen to
🤔 i'm not sure to understand what you mean, the promise with role creation never resolve so the await is freeze forever that the problem
you mean like client.rest.on('rateLimited')? didn't know it got moved there, @hazy light try that one. And i meant that you have that code inside an event listener or something that is probably not being triggered either, unless the fetch is being called but never resolves
oh wait there is a misunderstanding the "pls work" get logged I didn't read your sentence correctly.
oh { timeToReset: 79442486, limit: 250, method: 'POST', hash: 'Global(POST:/guilds/:id/roles)', url: 'https://discord.com/api/v10/guilds/949615144894361620/roles', route: '/guilds/:id/roles', majorParameter: '949615144894361620', global: false } with client.rest.on('rateLimited')
I am getting this two error since I updated my package. It spams my whole console.
It was v14.0.0-dev.1651493371-4ba0f56
now I updated to ^14.0.0-dev.1653480262-68d5169
do you use <Guild>.me somewhere instead of <Guild>.members.me?
yes, in lots of places
should I replace it with guild.members.me?
yes
Thanks
How do you set a color into an embed?, a hex code returns an error?
22 hours of timeout, unless i did math wrong
yes if timetoreset is in ms
0xhexColor
if you use the reexported embedbuilder from d.js you can also use hex strings
apparently this goes here?
enable ts strict mode
are there any official tools to help me learn v14?
there's a wip guide in the pins and main documentation, other than that you have to look at the commits on github
0.options[0].name[APPLICATION_COMMAND_INVALID_NAME]: Command name is invalid```
```JS
code: 50035,
errors: {
'0': { options: { '0': { name: [Object] } } }
},
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/979506674052243477/commands',
requestBody: {
files: undefined,
json: [
{
name: 'convert',
name_localizations: undefined,
description: 'Converts executes to the new format',
description_localizations: undefined,
type: 1,
options: [
{
type: 11,
name: 'Attatchment',
name_localizations: undefined,
name_localized: undefined,
description: 'File to convert',
description_localizations: undefined,
description_localized: undefined,
required: true,
autocomplete: undefined,
choices: undefined,
options: undefined,
channel_types: undefined,
min_value: undefined,
max_value: undefined
}
],
default_permission: true
}
]
}
}```
no capitals
oh.
Lol, thank you!
What is difference between log_one.entries.first() and log.entries.first()?
variable names i assume
Okay. Thanks
What is the permission bitfield of Manage Guild?
Okay it says when a user lefts the guild or has been kicked. So what should be the event for prune?
1n << 5n
Ty
I think its still that event, just... lots of them
I’ve only encountered it once but from what I recall it emits the guildMemberRemove event for each member pruned, unless Discord changed it
Okay
I get this error sometimes while using a interaction. How do I fix this?
Maybe your interaction token is expired
An interaction token is valid only for 15 minutes
by optimizing your code and reply within 3s
If you can't reply within 3s you can defer the reply (you can edit reply after defer within 13s)
Okay