#djs-in-dev-version
35223 messages · Page 26 of 36
It works now
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.
I might be dumb, but isn't this redundant?
Keyword is "Based"
You can’t check if smth is TextBased, for example, with a single .type check
DmChannel, TextChannel, ThreadChannel, and VoiceChannel is TextBased
Oh ok, makes a lot more sense
how fix emoji?
give everyone the permission to use external emojis
no other way?
nope
Oh.... Okay, thx
default to a unicode emoji if you don't have the perms, i suppose
but at the end of the day app cmd responses are built on webhooks which depend on the at-everyone permission
I updated to the latest dev version and now I'm getting this, any ideas?
#8138 in discordjs/discord.js by Jiralite opened <t:1655774389:R> (approved)
fix(WebSocketManager): Correct error name
So I need to wait for the next update or what? 🤔
you need to wait for that pr to be merged and then the next release cycle after that
technically this error is causing because of a bad token no?
so he can just put a correct token?
no
ah
its a bug
How can I go the the last working version?
14.0.0-dev.1655640259-358c3f4 is probably fine
Hey, that worked, thanks! ❤️
I updated because I was getting this every now and then, is that also connected to that commit?
MessageAttachment in v14?
AttachmentBuilder
Thanks
Where can I see a list of dev releases? 🤔
pins
I might be blind, but I don't see that in pins :/
you mean every changes in the dev version right?
A list of releases, like how Almeida knew that 14.0.0-dev.1655640259-358c3f4 is a previous version
The last bit is the commit hash, so if it's not the current one, it's an old one
https://www.npmjs.com/package/discord.js
click the versions tab and enable "show deprecated versions"
and then what jiralite said
Perfect, thank you both! ❤️
Any ideas about my question here? 🙂
#djs-in-dev-version message
Seems like it's connected to this 🤔
https://github.com/discordjs/discord.js/issues/7964
I used to get that error but I haven't since it was fixed
might be because the forward port of that pull request was merged prematurely
That too
It might be because of todays downtime. Are you experiencing it regularly or only today? bcz I've got the same error today during downtime
I had it happen today and yesterday I think, and maybe around a week ago prior to that, never before that though 🤔
I got that error today too during the outage but that's just a one-off
Today around 6:20 UTC if that helps with anything 🤔
There was just an outage, that's expected
That screenshot is from before the forwardport happened btw. That line number doesn't go to anywhere relevant
So you weren't running on the version it was ever fixed
This might be a bit out of scope, but any idea why the bot did not resume/restart after that error? I'm running it with PM2. This is the full log of when it crashed I think:
Before the fix: https://github.com/discordjs/discord.js/blob/72577c4bfd02524a27afb6ff4aebba9301a690d3/packages/discord.js/src/client/websocket/WebSocketShard.js#L731
Relevant line
After the fix:
https://github.com/discordjs/discord.js/blob/23e183a9ac7aaa3bca2bc4eb8634d1738ec34a26/packages/discord.js/src/client/websocket/WebSocketShard.js#L731
Blank line
Conclusion: Wasn't running on a fixed version anyway
Ah, that might explain things, I hope I'm on the version that has stuff fixed now 😄
Thanks for the detailed explanation! ❤️
Looks like it did to me
Hm, but it wasn't running properly 🤔
a 500 on /gateway/bot, did that happen during the outage?
Possibly 🤔
So it restarted but then froze after the 500 🤔
Anyway, hopefully the version I'm on right now will prevent those issues 🙂
Thank you all!
Is it just me or do I not receive any message content anymore?
do you have the intent enabled
Yes i do
At the client and the dev portal
createMessageComponentCollector in v14?
Message#createMessageComponentCollector()
Creates a message component interaction collector.
i have use this:
const collector = interaction.channel.createMessageComponentCollector({ filter: menuFilter, componentType: 'SelectMenu', time: ms('60s'), max: 1 });
But it don't work
iirc you might need to use ComponentType.SelectMenu
thanks
Why I keep getting this error event if deleted all actual applications
And in my request there's no duplicate
15th command is duplicate name
what does the "cached" type variable do for the interaction types?
tells you if it's on a cached guide or not
if not, it contains the raw data
like if it wasn't cached, interaction.member would be a raw member object from discord and not a Discordjs.GuildMember
ah okay
so what's the best to use in this case? raw data or a discord.js object?
You can't just choose what object it will be, if you receive an interaction from uncached guild it will be a raw object
You have to use typeguards to know what the object actually is
Uh what's wrong?
#8138 in discordjs/discord.js by Jiralite merged <t:1655814917:R>
fix(WebSocketManager): Correct error name
install the latest @dev
Worked
Is discord.js v14 in an okay state for me to begin to update my bot?
For the past day or so, it crashed on launch. Does that answer your question?
Yeah, lol
Lmao
Is there anywhere to see the progress thats been made towards V14 being released? A roadmap or something?
You can always look at open issues and PRs on GitHub. But it’s a WIP until it‘s not. It’s done when it’s ready.
Ah, classic
oh fuck 97% thats scary
That doesn’t say much though. New PRs and such arise often, others getting merged at the same rate. So don’t believe that it‘s only those things and v14 will release after
Or you can look at this https://github.com/orgs/discordjs/projects/2
oh yea no worries, yall the best thanks for the help
does anyone know if in v14 Channel#setName() resolves/rejects when rate limited, cause in v13 it always just hangs if the rate limit was hit
Discord doesn't send that, I believe, so no
The default behaviour on all rate limits is to queue
seems like you're looking for RESTOptions.rejectOnRateLimit
Theres a ClientOption in v13, RESTOption in v14, rejectOnRateLimit, which lets you customise this behaviour
But that relies on Discord having that rate limit properly separated if you want to target it specifically
yeah, thats alright thanks
i just check to see if it worked after a few seconds
I just updated my discord.js today, but......
util.destroy(socket, new ConnectTimeoutError())
^
ConnectTimeoutError: Connect Timeout Error
at Timeout.onConnectTimeout [as _onTimeout] (/mnt/c/Users/Kay/Desktop/KayBotTypeScriptJDA/node_modules/discord.js/node_modules/undici/lib/core/connect.js:108:24)
at listOnTimeout (node:internal/timers:561:11)
at processTimers (node:internal/timers:502:7) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
you have a connection problem then
This is a little bit weird......
🤔
In Ubuntu docker on other's server:
🤯
I input this and my console outputed "up to date"
npm ls discord.js and show the output
@tame gazelle
yeah, you can't use discord-together, whatever that is
with v14
though it is irrelevant to your error
theres a PR open to fix it as it seems
👌
TypeError: interaction.isCommand is not a function
what can i do?
Hey, any fix for that?
0.options[0].type[BASE_TYPE_REQUIRED]: This field is required
0.options[1].type[BASE_TYPE_REQUIRED]: This field is required```
```js
new SlashCommandBuilder()
.setName('ticket')
.setDescription('Manages channel permissions.')
.addSubcommand(subcommand =>
subcommand
.setName('add')
.setDescription('Adds user to an order channel!')
.addUserOption(option =>
option.setName('user')
.setDescription('User')
.setRequired(true)),
)
.addSubcommand(subcommand =>
subcommand
.setName('remove')
.setDescription('Removes user from an order channel!')
.addUserOption(option =>
option.setName('user')
.setDescription('User')
.setRequired(true)),
)```
how are you deploying your commands
I'm clicked buttons and got error
should i post the whole code?
guild.commands.set
(That doesn't help)
Do you see what happens when you press the buttons?
no errors
Discord services are buggy atm
Interactions and audit logs as far as I've seen
so how can i solve this error?
i was saying why is it not working the API is wrong
here's whole function
const guild = client.guilds.cache.get(guildId);
guild?.commands.set([
//@ts-ignore
new SlashCommandBuilder()
.setName('ticket')
.setDescription('Manages channel permissions.')
.addSubcommand(subcommand =>
subcommand
.setName('add')
.setDescription('Adds user to an order channel!')
.addUserOption(option =>
option.setName('user')
.setDescription('User')
.setRequired(true)),
)
.addSubcommand(subcommand =>
subcommand
.setName('remove')
.setDescription('Removes user from an order channel!')
.addUserOption(option =>
option.setName('user')
.setDescription('User')
.setRequired(true)),
)
])
}```
Yeah it's issues from the API, you can't do anything except waiting
did any1 catch DiscordAPIError, called 'Object'?
P.S. when trying to edit message
Hey, I get this Error: ```js
ExpectedConstraintError > s.number.lessThanOrEqual
Invalid number value
Expected: expected <= 25
Received:
| 26
when executing these lines of code:js
//Define Server Info Variables
for(let i = 0; i < server_amount; i++) {
let name = servers[i].attributes.name
let trimmedName = name.substring(0, 25)
server_embed.addFields([{ name: Server #${i}, value: '' + trimmedName + '', inline: true }])
}```
The Error happens in line 5 of the code bit
I have no Idea what could have caused this
you are adding more than 25 fields to the embed
ahhh ok. lol. thanks for that info
do select menus also have an upper limit of 25 options?
For use this i must me use client.rest.on
lmao
use type checking
i think it should work
That is a TypeScript error
typings error
But I'm pretty sure that method doesn't exist anymore
So idk what the issue is
if (channel.type === ChannelTypes.GuildNews /* or something similar*/) ...
?
yes
you must use client.rest.on if you want handle these events
thanks. shitty TS error
it didn't bother to say "this exists on none of them" 🙄
TIL.
bad typings i think
That's literally how TypeScript works
yes ofc
client.on('apiRequest', (request) => {
console.log(request)
})
It don't work
i have try request
but it don't work
Did you add rest?
Instead you should access these events from Client#rest
did you follow this?
yes
show
Now work
can the color of an embed no longer be a string?
if you import embed builders from djs, it resolves the strings
but then you can use Colors.Red and so on when Color is a djs exported enum
I'm clicked delete button and i got error
You try to delete a reply before sending one at least that‘s how your code looks
I'm fixed
only "DiscordAPIError[40060]: Interaction has already been acknowledged." got error
but buttons working
• DiscordAPIError: Interaction has already been acknowledged
• [INTERACTION_ALREADY_REPLIED]: The reply to this interaction has already been sent or deferred.
You have already replied to the interaction.
• Use <Interaction>.followUp() to send a new message
• If you deferred reply it's better to use <Interaction>.editReply()
• Responding to slash commands / buttons / select menus
I'm doing musical player with "real-time" time bar of song's playback duration. I'm editing a player message every 3 seconds to not to get rate limited. But, after 40-50 mins of editing message, finally i'm getting rate limited... I tried to search info about message edit per hour rate limits, but found nothing... Can anyone help me, what's the reason?
What reason are you looking for
What you do is simply not allowed neither feasible
Ah, i see, thanks!
Any reason all of channel types are strings rather than actual ChannelTypes? I'm having trouble comparing channel.type to the ChannelType enum. EnumResolver has been removed as well in a semi-recent merge.
Am I meant to check by keys, is there something else that I'm missing, or is this an oversight?
Any reason all of channel types are strings
What
Channel classes types have their type property defined as a specific string corresponding to the type name rather than id, compared to ChannelType enums associating by ID.
i.e.
That's version 13, you want #djs-help-v14
Huh, this is why I asked here rather than making an issue. Somehow my packages installed wrong even though I specified the dev build. Thanks for the highlight
Oh okay. Then yeah, that's what happened
Is there a way to get the number of messages sent by a user in a guild?
No

Unless you just keep count in a db every time they send a message
okay
How do I add a select menu in Modal?
You dont, its not supported
Ah, cool
you can do this but discord.js doesnt support it because its unreleased
That equals you shouldn't do it, so not worth mentioning
Can you show me where it is in discord docs in dms, kinda curious
There's no in the docs. It's not released yet.
That’s what I thought
They’d have made an announcement if it was a real thing
There's no any docs, but you can use it. And you won't get any help from us.
Well I use a different method of making my bot so yea
It don't ping role
to ping role <@&roleid>
thanks
"because its unreleased"
but added to api already
Show
is there a library or guide for v14?
Check the pins
thanks
is it possible to get shard id of current logged in client?
i dont have any proofs
but select menus CAN BE ADDED to modals, it's only undocumented & unreleased & probably unfinished and bugged
Ok now thats true
Theyre workin on it however
how do i get the info from Promise { <pending> }
await it
await message return content = ''
yeah you need MessageContent intent to receive msg content in api v10
on dev portal
it is enable
did you enable it in your client constructor
it is my
Is this deprecated in @dev ?
// Client creation
presence: {
status: 'online',
activities: [{name: "Premium Server", type: "WATCHING"}],
},
Does GuildMessageTyping sound like MessageContent? No?
Correct, its wrong.
The way you do it, yes.
You should pass an enum value to type.
ActivityType.Watching In your case.
ah thanks
IntelliSense tells me that SlashCommandBuilder doesn't exist when trying to import it from discord.js but when I do console.log(new Discord.SlashCommandBuilder()) it's logging the correct thing
are types missing?
they are not, restart vscode, you probably have old types cached
ah yeah ._.
Does Util still exist on v14? I want to use the Util.splitMessage() function
iirc they removed that
yeah splitMessage() is removed
ooh
Did i do this right?
DiscordAPIError[50035]: Invalid Form Body
components[0][COMPONENT_TYPE_INVALID]: The specified component type is invalid in this context
Components are composed of up to 5 action rows, and each action row can have up to 5 buttons
It looks like you skipped the action row part there
ah, thought it got removed :p
Am I doing anything wrong here?
The select menu doesnt send
Dont think there is anything wrong with it, message.content returns nothing, so the embed and select menu wont send :/
I got the right intents and all that
Hey, I can't figure out why exactly I am getting this error. DiscordAPIError[50035]: Invalid Form Body\ntype[NUMBER_TYPE_COERCE]: Value "activity" is not int.
If anybody can tell me why I'd really appreciate it lol
You talking about activity types? ActivityType.Listening and etc
I'm lead to believe it comes from my command.
I think it's from options.
options: [
{
type: 7,
channel_types: [2],
name: "channel",
description: "The voice channel to play the activity in.",
required: true
},
{
type: 3,
name: "type",
description: "The type of activity.",
required: true,
choices: [
{
name: "youtube",
value: "880218394199220334"
},
{
name: "poker",
value: "755827207812677713"
},
... and so on
]
}
]
v14 must have changed something here
I don't see anything wrong there
Same here.
Then maybe it doesn't come from there
Here lemme show the stack rq
It comes from this line: await this.application.commands.create(newCmd, process.argv.includes("--dev") === true && "763803059876397056");
(When I create the slash command)
It's one of your commands then
Why type guard methods are removed?
because they were "useless"
message.content is just an empty string, the bot got the right permissions and intents
Wouldn't that mean you don't?
That's quite the contradiction
Well, i think i got the right permissions and intents :p
What are your intents?
GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.DirectMessageReactions, GatewayIntentBits.GuildMembers
Missing the message content intent

Thought GuildMessages would be enough, thanks
Hi
Is they an easy way to see breaking changes from v13 to v14 ? Or need to test everything to see what break ?
Pins
Oups mb
will automod event(nodejs) come in v14 ?
Yes
nice
exist the member guild hash banner?
since this as mentioned in the of site https://discord.com/developers/docs/reference#image-formatting
hey discord.js will only update @discordjs/builders to 0.15.0 in v14? really need bug fix from there
Yes
being more specific, the name_localizations and description_localizations being null when fetching it
dm_permission: false doesn't really work in dev version ...why so
I am trying to make the commands guild only
Be more specific: how are you trying to set it and how do you check it it works or not?
should it be
interaction.channel.permissionOverwrites.edit(interaction.user.id, {
"allow": [PermissionsBitField.Flags.SendMessages]
})```
or
```JS
interaction.channel.permissionOverwrites.edit({
"id": interaction.user.id,
"allow": [PermissionsBitField.Flags.SendMessages]
})```
tomi, uuuuii
interaction.channel.permissionOverwrites.edit(user, {
"allow": [PermissionsBitField.Flags.SendMessages, PermissionsBitField.Flags.ViewChannel]
})``` Ive been trying to give permissions, and remove but doesnt work
why cant I add a string to .setColor() on EmbedBuilder
interaction.channel.permissionOverwrites.edit(user, {
PermissionsBitField.Flags.SendMessages : true,
PermissionsBitField.Flags.ViewChannel: true
})```
Oh..
Invalid json tho
Oh, it was actually
interaction.channel.permissionOverwrites.edit(user, {
SendMessages: true,
ViewChannel: true
})```
interaction.channel.permissionOverwrites.edit(user, {
[PermissionsBitField.Flags.SendMessages] : true,
[PermissionsBitField.Flags.ViewChannel]: true
})```
you can use this
This worked
this work too
I can't see any content in messages, it's only an empty string. I have tried adding the GatewayIntentBits.MessageContent however, it gives me an error on login:
Error [DisallowedIntents]: Privileged intent provided is not enabled or whitelisted.
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildVoiceStates
]```
Turn it on in the Dev portal too
you need to enable that intent in developer portal
I have some weird question in mind guildMemberManager.me is nullibe in which case the client member isn't cached?
if you manually remove it, sweep it or limit the member collection size
and don't have the guild member partial
So you could recieve the client member as a partial?
no, if you have the partial the property isn't nullable but will construct a minimal member (with the user id) iirc
Still don't get it how could I recieve client member missing some data
Wasn't cached then a presence update occurred maybe
So if I don't mess with chaching it wouldn't happen even if I don't have the guild members intent?
yes, you get your bot's member with the initial guild payload
interaction.guild.me.voice.setSuppressed(false)
Cannot read properties of undefined (reading 'voice')
me was moved to guild.members
embeds[0].color[NUMBER_TYPE_COERCE]: Value "#1fa9ff" is not int.
Anybody know why this won't work?
I set the embed color to "#1fa9ff"
use 0x1fa9ff (without quotes) or import EmbedBuilder from discord.js (if you are using it)
Oh alr.
Thanks.
Does Modals not support select menus yet? As I've notice we can add them to it but when you try to call upon it using getFieldInput it says Field with custom id "color" is of type: 3; expected 4. or am I somehow not understanding stuff
It will be supported when it’s officially released by discord
const embed = new EmbedBuilder()
.from(interaction.message.embeds[0])
(intermediate.value).from is not a function..how to fix?
EmbedBuilder.from()
It's a static function, drop the new
Doesn't work
Doesn't work
Of course you're on latest dev version?
Yep, now I fixed it
Note that it must be the imported from discord.js
otherwise the from doesn't exist
Which of these do I need to use to know if the interaction is just a normal slash command
isChatInputCommand()
ty
!message.guild.me.permissions.has
right?
guild.members.me
I'm leaving this here since it helped me
PSA for people who used AnyInteraction to perform type reductions.
Type AnyInteraction was removed in the dev build.
Change AnyInteraction back to Interaction again.
bless
❤️
Hi i have again my Error : Error [InteractionNotReplied]: The reply to this interaction has not been sent or deferred.
My script:
await i.deferReply({ ephemeral: true });
i.editReply({ content: 'test'})
console.log(i) -> replied : false
Why ? 🥲
It was deferred, not replied
Replied means .reply was used
Ok so,
i.reply({ content: 'test'})
console.log(i) -> replied : true
?
You need to await the reply
IDK how to do EmbedBuilder.from();
const embed = EmbedBuilder.from(interaction.message.embeds[0]);```
```js
embed.fields[1] = { name: 'Status', value: 'ACCEPTED' }```
i came back from a long pause developing my bot and i get this error on the dev package
didn't have yet time to read all of the changes, can u help real fast pls?
isCommand got removed
you should use .isChatInputCommand
thx
and i suppose this got removed too right?
interaction.guild.me.voice.channel
- interaction.guild.me.voice.channel
+ interaction.guild.members.me.voice.channel```
i previously got the color as color: '0xA800F6', but i saw that no it got a resolvablecolor function and the old .setColor function gives me an error
how does that work
interaction.guild.me got moved to interaction.guild.members.me
this error
show your code pls
gives error on that
Embed class doesn't have method .setColor
you should use EmbedBuilder
instead of Embed
got it
that changed too, interesting
thx a lot
no problem
v14 changed a lot
oh thx
<MessageEmbed>.setFooter() and <MessageEmbed>.setAuthor() now each take an object:
- embed.setAuthor('This is an example text', 'https://example.com/icon.png', 'https://websiteofauthor.com')
+ embed.setAuthor({ name: 'This is an example text', url: 'https://websiteofauthor.com', iconURL: 'https://example.com/icon.png' })
- embed.setFooter('This is an example text', 'https://example.com/icon.png')
+ embed.setFooter({ text: 'This is an example text', iconURL: 'https://example.com/icon.png' })
how do you check if the invitation is the same as the server?
and about format?
extension
?
ah got it
Is that a BaseCommandInteraction? Typeguard it to be CommandInteraction (either by changing the passed type or isChatInputCommand() )
didnt understood
Which part?
the type conversion
Well, you use TS so you should be used to that.
doesnt work or maybe i am doing wrong
<Client>.fetchInvite(…)
lol sorry, the fix is const lang = (interaction.options as CommandInteractionOptionResolver).getString('language').toLowerCase();
is normal that if I go pass the MessageManager#fetch({ messsage: possibleNullOrUndefined }) method, I get the message collection?
if you don't pass a MessageResolvable it'll fetch multiple messages
Suggestions how to investigate what's wrong?
Trying to check if the GuildMember has any of the roles specified in an array.
const roles = ['917080707807977492','930607303470743613','963165204894588948','963165552174571550','963165332854407198','963165407433326755','963165452568260729'];
const hasRole = newMember.roles.cache.hasAny(roles);
>hasRole: false
I'm certain the IDs are correct, and the member indeed get's one of the roles in the array. I still get false.
Collection#hasAny() does not take an array
a, I misremember then x)
Gotta re-check
A rest param?
Yes
- const hasRole = newMember.roles.cache.hasAny(roles);
+ const hasRole = newMember.roles.cache.hasAny(...roles);
TypeError: MessageActionRow is not a constructor
const row = new MessageActionRow()
.addComponents(
//......
);
About buttons in v14?
… and ActionRows
Is there a way to make the section to choose a channel in the slash commands only show text channels and not voice channels or categories?
Yes, addChannelTypes
Documentation suggestion for @kind pulsar:
SlashCommandChannelOption#addChannelTypes()
Adds channel types to this option
Thanks
I did this, but when choosing a channel everything still appears as it is in the screenshot I sent
(It should be noted that I do not use the SlashCommandBuilder)
channel_types
I'll try
So it’s not JSON meant to be sent directly via REST but options meant for ApplicationCommandManager?
Hmm, yes
In that Case channelTypes would be correct indeed. Did you redeploy the respective command?
Yes, like 3 times
Reload your discord app maybe?
I already did it, and it still doesn't work
this happens when I send an image
const attachment = await new Attachment(
await captcha.png,
"captcha.png"
)
return interaction.reply({
files: [attachment],
})
Documentation suggestion for @dusky agate:
AttachmentBuilder
Represents an attachment builder
thx
might be a stupid question, but what's the correct type for a MessageComponentCollector
any expectations when its docs will be done? or when will it be released?
v14 docs? they're already there
look in pins
the link which i have its old one, it only has changes from v13-> v14
let me see
if it redirects you to the stable branch, click on the dropdown menu and click on main, which is v14
ohh you meant the guide.. here: https://deploy-preview-1060--discordjs-guide.netlify.app/interactions/modals.html
ahh thank you so much
np
i found what to use, now i get this error??
Because of your optional chaining
fixed
to what got the verification gate renamed?
https://c.lunish.nl/h9Yu.png
Use the enum GuildFeature
i'm telling you to use the enum, includes(GuildFeature.MemberVerificationGateEnabled)
yes but why doesn't a string work :hmmm:
Because that's the wrong string to provide in the first place?
The types only allow you to specify this enum, it seems, so...
I even fix it to the right one here
I thought at the beginning that you changed everything to pascalcase so I tried that out with pascalcase as well
I think it's just how includes() works
But in any case, one shouldn't be using magic strings :eyes:
the type says GuildFeature[]
so of course you can't just use whatever you want
it's not really consistent trough the package that like permissions work with strings an enum's, but guild features only with enum's lol
well permissions are a bitfield, there's something to resolve, this is just strings
Well, discord itself isn’t consistent in that guild features are strings but other flags are Bitfields.🤷♂️
¯_(ツ)_/¯
just thinking that it would be easier for the average user
True. Let‘s remove the string versions for permissions
lmao no then I have to rewrite my whole bot again
And there you have the reason for inconsistency
why use dev then 🤨
the only thing I want to say that I don't think it is hard to also allow strings in the guild features
since you don't like rewriting i mean
It also isn’t hard to hardcode all intents as default for all bots. Doesn’t mean it’s the right thing to do
why isn't it a good thing lol
also hardcoding all intents as default is bad because of performance, but allowing a string.. don't think that this would use a lot
is v14 close to final?
In my eyes magic strings are as bad as magic numbers. If there are only certain strings that are valid they should be an enum. If I had any say in it I‘d remove the string versions for permissions etc. too. But since permissions and intents are something that the average Joe would need for almost every bot there are legacy strings so everybody will be able to update to v14
As close as always
But as soon as you use TS instead of JS you aren’t that average Joe anymore so the typings can be stricter
ah yes TS
the arch linux of javascript
i can't find where i'm going wrong
Seems the select menu option builder is not correctly passing its data
What exact version of djs (and builders) is this?
14.0.0-dev.1656158629-c4653f9 and i'm importing directly from discord.js, don't have @discordjs/builders installed as a dependency
Yeah it's only an issue with discord.js and not builders
We override those methods
referencing this channels topic, will v14 release today at "00:00 and 12:00 UTC"
or is it just referencing that it will release on github and update on npm at those times
This, v14 isn’t releasing today
Yeah upon reading it again that makes more sense
Hey i have a question, i try to send a message with my Bots in Threads and Text-Voice-Channels, / commands working in both channel types, but in threads my bot says me that he has missing accsess, but i ping him so he is at the right in the tread and he has Admin Perms, in Voice-Text Channels he dont reakt, so how can i do it, that he respond/ send messages in the channel types?
ok, never mind, the bot has not the perms to write im threads, but why the Text-in-Voice Channel not working is a question
but i ping him so he is at the right in the tread and he has Admin Perms
So the bot doesn't?
Text in voice are not threads though
No no, threads are now working, but my Bot doesn’t send message in Voice Text Chats
I know, sorry for my bad English
You need to be able to connect to the text-in-voice channel, view it and send messages in it to be able to send messages to a text-in-voice channel
Ok ok, and how do i do that? Give it a side in the Documentation/Guide or in the GitHub?
o,o huh
Hey, is there a method on BaseInteraction i can see if it is a modal?
Thanks
Any idea why on each message, the "content" property is an empty string ?
Did you specify the MessageContent intent?
Ooh there is a specific intent ?
Yes, MessageContent
You also need to enable it in the dev portal
Yeah ok I see, maybe I really need it lol
Is that a new intent ?
Yes
And if I have a verified bot, I guess I have to apply for it ?
Yup
Hmm ok, thanks
And without a good reason you wont get it
I know, but I think counting characters is a good reason
What
Counting characters??
My bot is used in roleplay servers, and they don't care if you write lots of message, rather if you can write long and detailed actions, so the experience you get is based on the length of the roleplay actions users write
Yeah I doubt thats a valid reason
But you can always try
Somebody told me it was a good reason, so I don't know x)
anyone know this error's reason
now works but i really don't know the reason
you got connection timeout
probably temporary network issue
as long as you can somehow make it work with slash commands they rather likely won't give it to you
Hm.. Well kadybat told me that it seems to be ok when I talked about that in the discord api server, the problem lies in explaining everything x)
Hi, any ideia when the version 14 go to stable?
Pins
<message>.guild no longer available? Only able to access the guildId
shall i get the guild from the cache?
are you using the Guilds intent?
yes
message.guild gets the guild from the cache
its a getter
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent,
],
});
These are my intents
ill check my code for any typos thanks
If you have a solution to make it work without the message content, I'm listening xD
hello pls how to make threads
TextChannel#threads
A manager of the threads belonging to this channel
ThreadManager#create()
Creates a new thread in the channel.
@hoary fox #app-commands
@uncut kelp
T_T
bro thats straight cap
@hoary fox explain urself
typeguard type === 0
What's the issue?
Trying to create a text channel
how did u created it (code)
isTextBased?
const channel = await interaction.guild.channels.create(
`ticket`,
{
type: ChannelType.GuildText,
permissionOverwrites: overwrites,
parent: data.config.categoryId,
position: 1,
},
);
no, check channel type
now it takes one object
GuildChannelManager#create()
Creates a new channel in the guild.
Ok
?
!==, not !.type ===
interaction.channel.type !== <type>
that's a typescript feature
Ah he’s using typescript
Using TypeScript but not enums? O_o
Yeah weird
plz answer why it no work
What is your issue
look up tf
No need to be rude
i cant make threads
No tf
no thread thingy
Probably due to the non-null assertion operator
no
Yes
Yeah, it is due to the non-null assertion operator
Which you shouldn't be using anyways unless you are certain that the data you're getting is defined
why is that messing with the intellisense tho
I think that's the intended behaviour of non-null assertions
You aren't supposed to be using them in most cases
Because you aren't ensuring that the data you're asserting is actually present in any way
Think of it as saying "trust me" to the compiler, which you are not supposed to do in most cases
I am getting Property 'getSubcommand' does not exist on type 'Omit<CommandInteractionOptionResolver<CacheType>, "getMessage" | "getFocused" | "getMentionable" | "getRole" | "getAttachment" | ... 6 more ... | "getSubcommand">'.ts(2339) when using Interaction.options.getSubcommand(), any way to fix this?
I am running the latest dev version
I am using the CommandOptions type for Interaction
You have to assert if the interaction is a command interaction
Im already doing this in another file, do I have to do this in each command too?
Well if you are sure that your code is receiving the right interaction type, then you can just change the type of that interaction to ChatInputCommandInteraction
Thank you so much 👍
any idea why I would be seeing this error when I'm 99% sure the type is correct...
I don't see why it wouldn't exist
the type is not correct, threads are text based too and can't have webhooks, as the error tells you
oop
does anyone know any way to check if there's an error 429 response
im using replit to host
is the Status enum missing some properties? the enum is missing 3 properties from the type on the docs: https://discord.js.org/#/docs/discord.js/main/typedef/Status
yes, it is
#8179 in discordjs/discord.js by almeidx opened <t:1656365575:R> (review required)
types(Status): add missing members
nice thx
i'm getting a "Invalid string length" error when adding an option to a chat input command
what would be the reason for this? is 153 characters too long?
Yes
Descriptions are capped at 100
Shard class' spawn and death events are missing the Worker thread option in the types according to the docs as well. also is there an enum for the shard events?
ah
ShardEvents
they don't match tho, that one's for the websocket shard events
~~also that has an extra type that isn't in the docs: https://github.com/discordjs/discord.js/blob/main/packages/discord.js/typings/index.d.ts#L4346~~
right, seems like there is no enum for the Shard class events
btw, if you know how and want to fix those you can submit a pull request
is there an enum i can import for thread types? (private, public)
ChannelType contains the thread types
ohh
ok ty everyone just 1 final thing. is there a way to make the bot not annoucne this? or to have the bot delete it right after its sent
yeah, fetch a few messages after creating the thread, filter by Message.type and call .delete() on it
thanks
the type you want is MessageType.ThreadCreated
👍
i would but nvmyarn build doesn't want to work
How can I log a message that is deleted?
messageDelete event
TypeError [ColorConvert]: Unable to convert color to a number.
.setColor('RANDOM')
it's Random
;-;
what
before everything worked in capitals lol
yes things change
you're in the dev version
What about to take the message content?
what about it
And the partials?
what's new in v14?
Read the pin, it tells you.
Modals are in v13
Nothing

Read the rest of the pin besides the first thing, it tells you the rest of the changes
Hey, I’m getting Property 'createdAt' does not exist on type 'Role | APIRole'. Anybody know how can I fix this? I am currently using RoleObject.createdAt
I have now fixed by doing js declare module "discord.js" { interface APIRole { createdAt: number, } }
u can check interaction.inCachedGuild()
I’ll try that, thank you
Hello,
In v14 i try to import Intents like this :
const { Intents } = require('discord.js');
But the Intents constant is undefined whereas in v13 it works...
Do the import changed in v14 ?
IntentsBitField (extends BitField)
Data structure that makes it easy to calculate intents.
ohhh thx 🙂
this is not a fix as it's completely incorrect
you have to ensure your role is a discord.js Role
It always is tho
it might not be, that's why the types are like that
if your guild is cached it is
I’m already checking if the guild is cached in another file
then the check didn't carry out to that file, you have to give it the proper types
Alright, I’ll check that now. Thank you
if (user.roles.highest.position > message.guild.me.roles.highest.position ) return
TypeError: Cannot read properties of undefined (reading 'roles')
it's message.guild.members.me
um did you seriously name a GuildMember "user" uhhh don't, it's easily confusable since they're both distinctly different types
:-:
user = args[0];
anyone know how i can get my channel to update its name from info pulled from another API? not sure if that makes sense
So user is a string? That won’t work at all then…
I will change the variable hahaha
Get the info from the API, then call <Channel>.edit(…) with the name you got from the API …
When will djs v14 stable version be released?
the answer to that is in the pinned message
Why does this field require a string ? What am I supposed to put here to make it show the current date ?
if it's an APIEmbed an iso date string, the date class has methods for that
Oh okay something like new Date().toISOString()
I get error when trying to fetch a channel saying missing access
I have these intents js intents: [ process.discord.GatewayIntentBits.Guilds, process.discord.GatewayIntentBits.GuildMessages, // process.discord.GatewayIntentBits.GuildMessageReactions, ]
It would imply you're fetching a channel the bot is not in
what's new in v14 👀
Read the pin
Thank you
when the select menu/ button coming in modal ?

no idea
Because I saw on Discord Developers someone using the select menu in a modal
not officially supported yet
Oh okey
developers are generally advised to not use it until it's documented, even if it technically works if the respective data is sent
Ok thanks
Tag suggestion for @scarlet tangle:
Sending and editing now takes only a single object parameter!
- channel.send(embed);
+ channel.send({ embeds: [embed, embed2] });
- channel.send('Hello!', { embed });
+ channel.send({ content: 'Hello!', embeds: [embed, embed2] });
• Full migration guide: learn more
DiscordAPIError: Cannot send messages to this user
Your bot is trying to send a DM to a user, but failed to do so:
• The user has DMs disabled or the bot blocked
• The user no longer shares a guild with the bot (make sure to send informational DMs before banning/kicking)
• The bot is trying to DM itself or another bot
Note: You cannot check if you can send a DM beforehand but have to handle the rejection case
Invalid interaction application command:
• After updating a global command Discord prevents you from receiving stale data until the update rolled out
• Refresh your commandlist to receive the updated command and try again
• Websocket intents limit events and decrease memory usage: learn more
• See what intents you need here
how to change bot nickname i d.js v14?
guild.members.me.setNickname(…)
i am getting DiscordAPIError[50013]: Missing Permissions
bot has the required perms
log guild.members.me.permissions.toArray()
[
'CreateInstantInvite', 'Administrator',
'AddReactions', 'Stream',
'ViewChannel', 'SendMessages',
'EmbedLinks', 'AttachFiles',
'ReadMessageHistory', 'MentionEveryone',
'UseExternalEmojis', 'Connect',
'Speak', 'UseVAD',
'ChangeNickname', 'UseApplicationCommands',
'RequestToSpeak', 'CreatePublicThreads',
'CreatePrivateThreads', 'UseExternalStickers',
'SendMessagesInThreads', 'UseEmbeddedActivities'
]
it has admin hmm
Could you show the error stack trace?
this?
DiscordAPIError[50013]: Missing Permissions
at SequentialHandler.runRequest (D:\Discord\bots\xd\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:740:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (D:\Discord\bots\xd\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:552:14)
at async REST.request (D:\Discord\bots\xd\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:986:22)
at async GuildMemberManager.edit (D:\Discord\bots\xd\node_modules\discord.js\src\managers\GuildMemberManager.js:316:15)
at async D:\Discord\bots\xd\web\routes\api\Change-Username.js:19:4 {
rawError: { message: 'Missing Permissions', code: 50013 },
code: 50013,
status: 403,
method: 'PATCH',
requestBody: {
files: undefined,
json: { nick: 'test', communication_disabled_until: undefined }
}
}```
Guild 000 with member 000
Log guild.id please
ok
in d.js v12 this shit works
Did you edit the error message to not show the endpoint url anymore? How do you expect us to help if you remove crucial information?
Hello, Parogo_72#8847 try to help me with my code he or she said to me "thats a weird error, your code should work", can someone just help with that bug here is document : ( Error ; My Code ; replace error ; discord.js version )
Tried a reinstall?
i think this has been resolved in #991627158134984795
@knotty plover fixed he did not have a package.json and his deps were all fucky wucky
quick question, i installed @discord.js/builders and discord.js@dev and when i wanted to import SlashCommandsBuilder vs code auto completed from "discord.js", is that how it works? does builders complete discord.js or something?
Dont install the builders if you install discord.js it will automatically install builders
well don't, uninstall them both and just install discord.js@dev, and the djs exported builders are usually just the builders with additional features on top of them
ohh, thats it then, that prob explains why i got dev version on it too
thanks for clarifying!
export default {
name: 'guildMemberAdd',
async exec (client, message, d, member) {
const channel = message.guild.channels.cache.find(ch => ch.id === "991506128972304414");
channel.send(`${member}`).then(d);
}
${member} undefined
very out of context, what is what?
guildMemberAdd doesn't have a message, it only gives you a member
check your params
you forgot a "=>", im surprised it didnt error
But it works like this "-" the error is the member that comes undefined in v13 it worked and in v14 it continues?
my question is: is this valid js syntax? I literally cannot remember
it's really hard to help you without any additional context, like how do you call the method etc
i havent coded in so long
yes, it's not an arrow function, it's a method
okay
'-'
hey, so i have some name localizations i set but for some reason, when i change my discords language they still doesnt change to that language
i have my discord set to spanish right now
discord.js is a monorepo now, all the builders from @discordjs/builders are now in discord.js. so its best to uninstall @discordjs/builders
i alr did, thanks!
idk if they released it already, try it with the build override
ah ok, no problem!
yep, that worked, thanks! didnt know it still hasnt been released
It is on mobile, but not on desktop apparently
interesting
well, weirdness like always 👍
That’s discord🤷♂️
TypeError: Cannot read properties of undefined (reading 'guild')
const channel = member.guild.channels.cache.find(
(ch) => ch.name === 'wel');
that means member is undefined (or doesnt have a guild)
Xd was about to say i had to grab google translate
lol weak internet
I've been trying for hours :( without success
Hello what is the problem?
Please don’t cross post
will there ever be a way to put videos into embeds
Doubt Discord will add them anytime soon
Any one can help me?
You tried to specify a privileged intent that isn’t enabled in the bot app page
Where?
Where is what?
I have to do a property or what?
You have to enable it in the bot application page, or just don’t specify intents ur not permitted to use
Does anyone know what interaction.isModalSubmit() looks like in the @dev version?
interaction.type === InteractionTypes.ModalSubmit I think, not 100% on the enum naming

I'm on version: 14.0.0-dev.1656158629-c4653f9
Got this again yesterday ~22:40 UTC, don't remember having this issue on non-dev releases, any ideas?
c4653f9 in discordjs/discord.js by didinele committed <t:1656147738:R>
feat(util): parseWebhookURL (#8166)
that looks like it should be fixed with https://github.com/discordjs/discord.js/pull/8150 unless i'm missing something, but that was merged before your commit, 8 days ago
Anything I can do to help resolve this? 🤔
hm
perhaps I'm being dumb, but I can't follow that stack trace
nevermind, I got it
so you're hitting this
this.helloTimeout = setTimeout(() => {
this.debug('Did not receive HELLO in time. Destroying and connecting again.');
this.destroy({ reset: true, closeCode: 4009 });
}, 20_000).unref();```
Preferably I'd avoid this whole part overall:
I'm aware what you mean, I'm just trying see why this happens
since we explicitly rolled a fix out for this
Curious, not sure why it still happens then 😦
yeahhh I'm not quite sure either, I assume you weren't listening to the debug event either?
Nope, that screenshot is all I've got sadly 😦
👍 just open an issue with what you have and we'll try to look into it again
How do I do that? 🙂
Submitted I believe 🙂
What missing is needed to fix this??
What is actually causing the error?
well biryani, perhaps it's you trying to create a channel and trying to give a role/user the manage roles permission, which you can't if you don't have admin
now note that you didn't send the code where you do in fact create the channel, i had only the error to work with 😦
//overwrites
const overwrites = [
{
id: guild.roles.everyone.id,
deny: ['ViewChannel'],
type: 'role',
},
{
id: client.user.id,
allow: [
'EmbedLinks',
'ManageChannels',
'ManageMessages',
'ReadMessageHistory',
'SendMessages',
'ViewChannel',
],
type: 'member',
},
{
id: user.id,
allow: [
'AttachFiles',
'SendMessages',
'ViewChannel',
'ReadMessageHistory',
],
type: 'member',
},
];
//channel
const channel = await guild.channels.create({
name: `ticket-${(data.ticketCount + 1).toString().padStart(4, '0')}`,
type: ChannelType.GuildText,
permissionOverwrites: overwrites,
parent: data.config.categoryId,
position: 1,
});
So, does your bot have MANAGE_CHANNELS permission? Does it have the other permissions you try to add in the overwrites?
yeaaaaa, soo what you want to do is check if your overwrites include setting the manage channel and if so, check if the bot has admin perms beforehand
@steel haven she checks for mannagechannels beforehand ya
In line 19, while the error is in line 195. I stopped assuming that that code is even called without knowing the full code
use the enum here type: 'role',
OverwriteType
Not sure, someone is using my bot and the console is getting spammed with these errors
OverwriteType.Role?
yea
also for member
Then put in a catch there and console.log the bots permissions in that guild in it (along with the error)
How would I check what permissions my bot is having in that guild?
guild.members.me.permissions
Don't understand what logging the bot permissions would do.
It would print them to the console 
what she doesn't understand is the reason why we're logging
and in case you do log, perhaps you'd want to use toArray to make it readable
how to react to a message sent by webhook?
and if you want true/false formation use .serialize()
Fetch the message and call react on it, the same way as any other message. Unless I misunderstood the question
i even tried ....send(...).then(a => a.react(...))
still, react is not a function
Fetch the Message (from the channel) not the WebhookMessage
when i console.log message id of webhook message it logs an id which can be only used by fetchMessage, its not same and message id which i see when i copy message id myself
Is your bot in that guild?
wait no
Then you won’t get a Message, only APIMessage which is plain JSON
well that might be it. i am using test bot and not production bot. i cant have test bot in same guild because double slash command
i tried to disable slash commands of 2nd bot from discord->integration but didnt work
well thank you! i'll add the bot and than see.
that should do the job lets see
@steel haven sorry if you are busy its alright, but if free look at this, now after above code still now, here's message js { id: '992086011209338892', type: 0, content: '', channel_id: '768858049338540062', author: { bot: true, id: '992019259192508436', username: 'RconCraft Testing', avatar: '5d61ded016c8bf74c749e713cc088384', discriminator: '0000' }, attachments: [], embeds: [ { type: 'rich', title: 'Feedback:', description: 'sdfg', color: 2383529, timestamp: '2022-06-30T15:15:35.997000+00:00', thumbnail: [Object], footer: [Object] } ], mentions: [], mention_roles: [], pinned: false, mention_everyone: false, tts: false, timestamp: '2022-06-30T15:15:37.139000+00:00', edited_timestamp: null, flags: 0, components: [], webhook_id: '992019259192508436' } now atleast message id and webhook message id are same but how will i react to it without message inetnts
You don’t need the intent to fetch the Message. <TextChannel>.messages.fetch(messageId) and call react on the resolved Message
really? thats so good than, tysm
It won’t have any content, but you don’t need the content to react
yep
can i use deleteMessageDays if i'm banning a user who isn't in the server?
yea
wait, deleteMessageDays isn't even working
What I specify on permissions argument? I tried an array like this:
const perms = [
{ id: 'ID', type: 1, permission: true }
]
but got errors
this 🥺
the default member permission is not the same as that
its a single permission bitfield
to create permissions like the ones on your second screenshot you need a bearer token from a user
bots cant create those
hum
heres an example of how you can run the method you were asking about .setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
Yeah, I think I understood
Maybe I need specify '0' on the argument and then set permissions manually in server settings
const { createdTimestamp, guild, guildId, options, user: moderator } = interaction
const days = options.getNumber('delete_messages')
await guild.members.ban(user, { deleteMessageDays: days, reason: `${moderator.tag} (${moderator.id}): ${reason}` })
days isn't doing anything here.
should work
It doesn't.
I've been at this for a while now and I have yet to understand why I'm experiencing this issue.
do u have lastest dev?
Yeah, I do.
so idk
Hi, can you tell me what the problem is?
const getSimpleModal = (opts: isSimpleModalOpts) => {
let textInput = new TextInputBuilder()
.setLabel(opts.label)
.setPlaceholder(opts.placeholder)
.setValue(opts.default)
.setCustomId(opts.id + "-field");
let row = new ActionRowBuilder<ModalActionRowComponentBuilder>()
.addComponents(textInput)
let modal = new ModalBuilder()
.setCustomId(opts.id)
.setTitle(opts.title)
.addComponents(row);
return modal;
}
async pencil(interaction: ButtonInteraction, channel: VoiceChannel, activeChannel: ActiveChannels) {
let request = getSimpleModal({
id: 'name',
title: 'Enter channel name',
default: channel.name,
placeholder: channel.name,
label: 'Name'
});
await interaction.showModal(request);
const filter = (interaction: ModalSubmitInteraction) => interaction.customId == 'name';
let result = await interaction.awaitModalSubmit({ filter, time: 120_000 })
}
I upgraded to the latest version of discord.js@dev and started getting this error
whatever you pass as channel does not seem to have a name
I figured it out, but thanks for the help)
actually, probably doesn't have to be "value" 
Yes, the problem was in the variable itself with the channel
DiscordAPIError[50006]: Cannot send an empty message
return Util.default.sendError(author, 'Timely', `You **have** already*taken the **temporary** reward! You can **get** the following via ${timelyString}`, interaction);
static async sendError(member, title, desc,interaction) {
console.log(interaction);
const error = new EmbedBuilder()
.setColor(`#FF0000`)
.setThumbnail(member.user.displayAvatarURL({ dynamic: true }))
.setTitle(title)
.setDescription(`${member.toString()}, ${desc}`);
await interaction.reply({
embed: [error],
fetchReply: true,
ephemeral: true
});
}
embeds
aaaaaaaaa
Is anyone experiencing issues when fetching the topic of a channel where it adds ' to the end?
please don't crosspost, especially when you've been answered
When will v14 be released for stable build
say it with me
when it's ready™️
Oki
we don't work with ETAs, it just releases whenever, it's easier that way
Fair
to set the bot activity is like this?
client.user.setActivity
ClientUser#setActivity()
Sets the activity the client user is playing.
Does this event requires GUILD_MEMBERS intent ?
No, it requires GuildVoiceStates intent
Oh cool
Discord mobile bug, not djs
What does setAgent mean?? And what does it do??
Sets the undici Agent used for requests
Ahh okej
The send property disapeared or what ?,
Cannot reproduce
lastest dev 😂
npm ls discord.js what's the ouput?
I restarted my pc
That works now
See pinned upgrade guide, refer to bit about intents
Absolutely not
Because we don't write code for people here, as per the server rules
Help how?
what is that embed?
ah, 2 hours later lol
Prob bc it’s empty
mhm
How do I fix this?
const Buttons = new ActionRowBuilder()
.addComponents([
new ButtonBuilder()
.setCustomId('suggest-accept')
.setLabel('Accept')
.setStyle(ButtonStyle.Success)
])
.addComponents([
new ButtonBuilder()
.setCustomId('suggest-decline')
.setLabel('Decline')
.setStyle(ButtonStyle.Danger)
])```
type the action row as ActionRowBuilder<ButtonBuilder> iirc
new ActionRowBuilder<ButtonBuilder>()
I even tried:
let panels = new client.discord.ActionRowBuilder().addComponents(new client.discord.SelectMenuBuilder()
.setCustomId("panels")
.setPlaceholder("Select a panel to edit...")
.setMaxValues(1)
)
for (let p of foundPanels) {
panels.components[0].toJSON().options.push({
label: p.name,
description: "",
value: `${p.id}`,
});
};
But panels.components[0].toJSON().options stiill returns an empty Array.
just use .addOptions() instead of this hacky stuff
Does that work in a forLoop too?
Nope!
for (let p of foundPanels) {
panels.components[0].addOptions({
label: p.name,
description: "",
value: `${p.id}`,
});
};
look like it takes an array
I found an alternative.
let options = []
let panels = new client.discord.ActionRowBuilder().addComponents(new client.discord.SelectMenuBuilder()
.setCustomId("panels")
.setPlaceholder("Select a panel to edit...")
.setMaxValues(1)
)
for (let p of foundPanels) {
options.push({
label: p.name,
value: `${p.id}`,
})
};
if(options.length) {
panels.components[0].addOptions(options)
}
are there v14 events that are similar to v13's apiRequest and apiResponse events?
I believe it’s in the rest package
There is response event in REST, but no request event afaik
only invalidRequestWarning
And restDebug
There’s also response
Docs doesn’t display it atm
List of events is defined here
How could I covert PermissionsBitField to readable array of permissions strings?
.toArray() ?
PermissionsBitField#toArray()
Gets an Array of bitfield names based on the permissions available.
Are you using version 14
Are you using version 14 too
Read the update guide pinned. Lots of it is old
I got the intent sooo x)

hey, does the Embed.setDescription etc. still exist in dev version?
no, you now use EmbedBuilder for all the setting
and the docs are usually not wrong so check those for questions like this
yeah the docs dont mention the functions anywhere and my intellisense doesnt suggest anything so i assume its not there anymore?
Embed only holds received api data
to construct an embed you have to use EmbedBuilder
welp, i had it then removed it, thanks!
Why .voice doesn't exists ?
typeguard the interaction
use the inCachedGuild typeguard or type interaction as cached if it is
CommandInteraction#inCachedGuild()
Indicates whether or not this interaction is both cached and received from a guild.
I see, thanks
how I can get styles for textinputbuilder?
you can import TextInputStyle from discord.js
what discord.js are you using? npm ls discord.js
Already working...
webstorm just did't display it from autocomplete
thnks
I'm about to lose my mind, anybody wanna help out
/home/container/node_modules/discord.js/src/rest/RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Invalid Form Body
embeds[0].description: This field is required
at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async Client.<anonymous> (/home/container/index.js:112:9) {
method: 'post',
path: '/channels/992756088376147989/messages',
code: 50035,
httpStatus: 400,
requestData: {
json: {
content: null,
allowed_mentions: { parse: [], repliedUser: true },
flags: null,
embeds: [
MessageEmbed {
type: 'rich',
title: null,
description: '',
url: null,
color: null,
timestamp: null,
fields: [],
thumbnail: null,
image: null,
video: null,
author: null,
provider: null,
footer: null
}
]
},
files: []
}
}```
if(message.channelId === "992756088376147989") {
let log = client.channels.cache.get("992542980261032006");
await log.send("```Nápad od " + message.author.tag + " (" + message.author.id + ') "' + message.content + '" bol úspešne vytvorený!```')
var embed = new MessageEmbed()
embed.setDescription(message.content)
await message.channel.send({ embeds: [embed] }).then(function (message) {
message.react('✅');
message.react('❌');
message.startThread({
name: message.content + " - Diskusia",
autoArchiveDuration: 4320,
});
});
message.delete();
}
That message probably doesn’t have a content
It does
Strangely enough the embed sends and the description is there
the thread however, is only the second part
Then the error stems from another place
but what could it be
You delete the message before you react to it and start the thread with it… nvm, didn’t see the await🤦♂️
different messages
But that's outside the function. And it did that even when commented out
the message was sent to 992756088376147989
that's the correct channel
it tried sending an embed with an empty string as the description
I'm gonna show you what it does
are you 100% sure the error is coming from that code?
The error comes from your log send (which you didn’t show us) not the thread
This is what happens. The second reaction doesn't get added. After this it just crashes. The embed used to be created with just " - Diskusia" but it does nothing now.
are you ignoring messages sent by the bot?
Well, this is the whole code. Can't send because code blocks don't work well inside code blocks
Do you have a messageReactionAdd event?
huh?
Nope
is that in a messageCreate event?
Yes
and are you ignoring messages sent by bots
something like if (message.author.bot) return
Wait a moment
Well I am now.
that doesnt stop the message.channel.send()
Still the same error tho, except the thread gets created in a half assed way
..is there some new API method for preventing messages being sent? I haven't developed anything in the Discord API for almost 2 years (If that's what you're refering to)
it tried sending an embed with an empty string as the description
the bots message does not have content
and you're not ignoring it
and how the hell do I do that
god the new API is so overdefined
that's here
I like to check just for the single bot due to level up messages
unless you're cropping something after the if condition, no its not
this is not new
why not?
because the problem is in message.channel.send()
Ok
so what do I do? You lost me a bit
- your bot sends a message with an embed containing the content of a message
- your bot will receive the message it just sent, which does not have content, just the embed
- it tries creating a new embed with the content that doesnt exist, and sends another message, and fails
Ohhhhhhhhhhhhhhhhhhh
That makes a lot of sense
well shit
Thanks man. Would've never thought of that lol
Although the thread name is still a bit wacky
that's another story, i was solely trying to tell you why you got that first error
And what's the story about
show the updated code
here you are mate
if(message.channelId === "992756088376147989") {
if(message.author.id === client.user.id) return;
let log = client.channels.cache.get("992542980261032006");
await log.send("```Nápad od " + message.author.tag + " (" + message.author.id + ') "' + message.content + '" bol úspešne vytvorený!```')
var embed = new MessageEmbed()
embed.setDescription(message.content)
await message.channel.send({ embeds: [embed] }).then(function (message) {
message.react('✅');
message.react('❌');
message.startThread({
name: message.content + " - Diskusia",
autoArchiveDuration: 4320,
});
});
message.delete();
}
Async nature of node. The second react and thread creation happen while the second message gets handled, so all only happened half when the bot crashes
It doesn't crash anymore, but message.content seems to be non-existent in the thread
Oh nevermind, I see it now
no content, again
Because you override message in that scope
I see, nevermind
Fixed
what's the cache meaning inInteraction<cache>
whether or not it was made in a cached guild
if it wasn't cached, you'd have raw data like the raw guild member object instead of a GuildMember
all guilds are cached, aren't they ?
ohhh, I get it thanks
Bots don’t have to a member of the guild to receive slash commands and other interactions
Like when we paste a large text in discord chat it suggests us to send the text as an attachment, how todo it in bot?
guide/ docs?
you do it yourself, write message to file, send file
and whats new name of messageAttachments?
i was hoping a way where i dont need to make a temporary file
found it, AttachmentBuilder
@paper sparrow "temporary file" as in "in your file system"?
there's no need for that, you can send buffers as attachments
like AttachmentBuilder("text here") ?
Buffer.from("text here") and keeping in mind that newlines are best \r\n in files
Hmmm Thanks for letting me know!
strings are interpreted as path/url https://discord.js.org/#/docs/discord.js/main/typedef/BufferResolvable
now how will i reply to interaction? .reply({attachments:[attach]})?
files, not attachments
but yes
alright!
When is it releasing?
Idk
Same
Relatable
Does anyone know the full list of user flags?
These are the only ones I know atm.
const badges = [
"HypeSquadOnlineHouse1",
"HypeSquadOnlineHouse2",
"HypeSquadOnlineHouse3",
"CertifiedModerator"
];