#djs-in-dev-version
35223 messages · Page 17 of 36
Is there a way to check if a message has been deleted? (I ask it because the .deleted method no longer exists in the version 14)
try and fetch it, if it fails, it doesn't exist
how can i fetch it?
message.fetch()
but like what, you're trying to delete a message? just call delete and handle the error
ok, thanks :D
How would I go through a list of users with the same name, then ban them if they have the same username?
Fetch all members and loop through the collection
await Promise.all([
members
.filter(member => member.user.username === 'someUsername')
.map(member => member.ban())
])
wouldnt it be member.user.username
Theres a rate limit on everything
So people cant abuse the APIs
yeah
can a GuildNews channel be a GuildText channel as well?
No
okay
Is the embed setFooter still broken?
Never was?
Or if it was it was too long ago for me to remember so no, is fixed
Hmm just adding a footer causes my embed to crash. Only thing I changed
likely just coded incorrectly
whats the crash
I actually opened a issue ticket in the discordjs github but wasn't sure if it's implemented in the recent discord.js@dev release
const secretEmbed = new EmbedBuilder()
.setColor('#e7cb04')
.setTitle('test1')
.setDescription('test2')
.setImage(`attachment://${test3.name}`)
.setFooter('testFail');
setFooter takes an object
setFooter({ text: "testFail" })
omg...
Ah right. I forgot my old issue ticket was about footer not taking attachments correctly
Looks like thats using the old error message though, I did do a PR to improve the output so its more meaningful
Thanks. Dumb error by me
in modals anyway to change the character limit per text box?
.setMaxLength / .setMinLength
ty
TypeError: Cannot read properties of null (reading 'id')
at InteractionCollector._handleMessageDeletion (C:\RolexBot\node_modules\discord.js\src\structures\InteractionCollector.js:214:29)
at RolexBot.emit (node:events:527:28)
at MessageDeleteAction.handle (C:\RolexBot\node_modules\discord.js\src\client\actions\MessageDelete.js:22:16)
at module.exports [as MESSAGE_DELETE] (C:\RolexBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_DELETE.js:4:32)
at WebSocketManager.handlePacket (C:\RolexBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketShard.onPacket (C:\RolexBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:22)
at WebSocketShard.onMessage (C:\RolexBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:304:10)
at WebSocket.onMessage (C:\RolexBot\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:527:28)
at Receiver.receiverOnMessage (C:\RolexBot\node_modules\ws\lib\websocket.js:1137:20)
at Receiver.emit (node:events:527:28)
at Receiver.dataMessage (C:\RolexBot\node_modules\ws\lib\receiver.js:528:14)
at Receiver.getData (C:\RolexBot\node_modules\ws\lib\receiver.js:446:17)
at Receiver.startLoop (C:\RolexBot\node_modules\ws\lib\receiver.js:148:22)
at Receiver._write (C:\RolexBot\node_modules\ws\lib\receiver.js:83:10)
at writeOrBuffer (node:internal/streams/writable:390:12) uncaughtException
``` is this a bug or smth it works properly sometimes after it stops and gives this error which results in a interaction failed message
it's a bug but it has already been fixed, update
alright thanks
does dev version have attachments?
do you mean to ask attachment options?
yes in slash commands
yeah we have that and it'll drop in version 13.7 too
i have a problem using flags in v14 and some ppl told me to change intents to IntentsBitField because it got renamed
but if i change intents to ... then i'll get more problems
like?
which problems? what is your new code?
read the guide for updating
it's called intents, lowercase
oh rly?
only the client option btw, not you still have to change Intents.FLAGSIntents.FLAGS to IntentsBitField.Flags
they didn't tell you to change the property, they told you to change the flag accessing
again, there's a guide for updating and it's pinned
ReferenceError: Intents is not defined Next error
read the guide for updating
again, there's a guide for updating and it's pinned
i try to fix that code for hours and i looked for so much information ;-; i just want help
so go to guide
i am and it didnt helped me
can anyone help?
code:
if(cmd == `!h`){
let channel = message.member.voice.channel
if(channel) {
channel = "**מחכה בחדר: ** <#" + message.member.voice.channel + ">"
}else{
channel = ':x: **לא מחובר לשום חדר** :x: '
}
var reason = args.join(" ");
if(!reason) reason = "לא צויינה סיבה";
const embed = new EmbedBuilder()
.addField( "**__ממבר__**:\n",` ${message.author} | **זקוק לעזרתך!**`)
.addField("**__וויס__**:", `${channel}`)
.addField("**__סיבה__**:\n", reason)
.setColor(`#11CCEE`)
.setThumbnail(message.author.displayAvatarURL({dynamic: true}))
.setFooter(message.author.username + "#" + message.author.discriminator, message.author.avatarURL)
.setTimestamp(new Date())
message.channel.send({ content: '<@&968138149429649469>',embeds: [embed] });
setTimeout(function(){
}, 20000);
}```
use addFields
Now saying Im not connected to voice, even when I am.
if(cmd == `!h`){
let channel = message.member.voice.channel
if(channel) {
channel = "**מחכה בחדר: ** <#" + message.member.voice.channel + ">"
}else{
channel = ':x: **לא מחובר לשום חדר** :x: '
}
var reason = args.join(" ");
if(!reason) reason = "לא צויינה סיבה";
const embed = new EmbedBuilder()
.addFields(
{ name: ` **__ממבר__**:\n`, value: ` ${message.author} | **זקוק לעזרתך!**`},
{name: "**__וויס__**:", value: channel},
{name: "**__סיבה__**:\n",value: reason}
)
.setColor(`#11CCEE`)
.setThumbnail(message.author.displayAvatarURL({dynamic: true}))
.setTimestamp(new Date())
message.channel.send({ content: '<@&968138149429649469>',embeds: [embed] });
setTimeout(function(){
}, 20000);
}```
you need GuildVoiceStates intent
Thanks. next time I'll just enable all the possible intents.
don't
Why not?
bad idea, just use the ones you need, easy way to know, read the guide
just use the ones you need
Easier to do isn't?
Cuz you get payloads you dont need.
Its not easier.
it takes like 3 minutes to learn, saves up a lot of resource use
How I can create an message component collector on a interaction reply ?
(How I can listen to button interactions on a interaction reply)
reply({fetchReply: true,.........}) will return a message (resolving a promise)
okay, thanks
and the it's simple, create a collector on the the message
You don’t need fetchReply anymore for v14 to use collectors
whaa
So I just have to resolve the promise without adding fetchReply
yeah await it
since when? how
and why'd the source button on the docs break again
#7623 in discordjs/discord.js by suneettipirneni merged <t:1650185976:R>
feat: allow createMessageComponentCollector without using fetchReply
But I get this error
The same as I tried to use interaction.fetchReply()
Are you on the latest dev version?
no
You’ll need to be on the latest dev version
This channel is for people on v14 dev
I am on v14
I am not at the latest commit
then just update..
I was*
Updated and the error still, but does this work with editReply ?
Oh edit reply always gives the message back anyways you just need to cast it as a message
i mean this one makes sense right? shouldn't you be using the inCachedGuild type guard?
thanks
(intermediate value).setColor is not a function what does this supposed to mean?
show the code
let emb = new Embed()
.setColor(0x2F3136)
.setFooter({
text: `Page ${page}/${Math.ceil(ctx.client.guilds.cache.size / 10)}`
})
.setDescription(description);
its EmbedBuilder
is the import from builders or djs?
both work actually
djs just adds more functionality on the builders one
ok
@urban belfry@woeful pollen both of you thanks for the help
and why'd the source button on the docs break again
Do you have an example area?
How can I put hex code in embed color?
like here
Or just use a hex string
When is v14 coming out ?
when its ready
we dont do eta's
Hi, can sb help me?
TypeError: components.map is not a function
const adContentModal = new TextInputBuilder();
adContentModal.setCustomId('adContentModal').setLabel('Treść reklamy').setStyle(TextInputStyle.Paragraph);
const firstActionRow = new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents([adContentModal]);
setAdModal.addComponents(firstActionRow);
await interaction.showModal(setAdModal);
This line returns error
setAdModal.addComponents(firstActionRow);
it takes an array
where
addComponents
takes an array of actionrows
oh, okay..
Thank you
You tell us, how did you register them
oopsie dayse
i accidently overrided my old files 😬
Hey, cannot figure out why this is happening
Not our package, not supported
update to latest dev version
Theyre not even using the dev version
how
Because I know they arent
It would be called ModalBuilder if they were
then install dev version @lavish snow
Also because I'd already spoken to them in another channel
i thought it was Modal in older versions sorry
algum br kkkkkkkkkk
?
no
Good morning.
Any ETA for when Discord.JS V14 would release, as in the date?
no eta
what is this
Smth expected an array
Show the stack trace
Looks like it expected a number and didn't get one
I believe it’s from a item.length constraint, where the item doesn't have a length property
ahh
client.ws.ping
cant this
what
npm 8.7
cant use client.ws.ping
🤔 where are the other get functions
oh nvm
it was CommandInteraction not ChatInputCommandInteraction
Is there an error?
use slash have this
You still haven’t showed the stack trace as requested earlier
have err ?
No
Unless ur using the latest dev version builders 
Please just show the stack trace
Provide arrays for addFields
.addFields([ { name, value } ])
oh
thx
what is MessageAttachment v14
Attachment
how can i install dev and will it break my v13?
Check the pins
And yes, it will break unless you update your code
do you have the message content intents in your code?
is there any error?
that slice (probably) returned an empty array
check for the length .options.length, an empty array is truthy
I got this
where is this code?
are you modifying your .token? calling destroy, anything?
that really does not help
i asked where it was, and for additional context
I'm not modifying .token, i'm not calling destroy
ah so maybe that's just undefined
but this shouldn't be connected to the code you've shown though
Yes that's why I find that weird
any other errors before this one?
like invalid token for a webhook?
A lot of errors like this
and at the start?
the stack trace shows minified code which means you are not on the latest dev commit, you should update
deprecation 👀
There's a high possibility that whatever lead to you getting those errors is already fixed, there was a fix for invalid webhook tokens resetting the bot token
ah
why does it appear like this? was fine before
TypeError: Cannot read properties of undefined (reading 'permissions')
log interaction
How do you make the bot's status member count of a specific guild in v14?
current code:
client.on('ready', () => {
console.log("online")
setInterval(() => {
const totalMembers = client.guilds.cache.map(guild => guild.memberCount).reduce((a,b) => a + b, 0);
client.user.setPresence({ game: { name: totalMembers, type: 'WATCHING' }, status: 'online' })
.then(console.log)
.catch(console.error);
}, 1000 * 60 * 5);
})```
pretty sure game.name expects a string
stringify the number from totalMembers
game is not a valid option
Then I am asking, how do I do that in v14.
same as v13 pretty much
except the ActivityType enum
Can't be simple as this?
client.on('ready', () => {
console.log("online")
client.user.setPresence({ activity: { name: `${client.users.cache.size} members` , type: 'WATCHING'}, status: 'online' })
});```
activities: [ { name: "name", type: ActivityType.Watching} ]
Idk if I made the enum correctly, I didn't really get to see how it is because docs don't link to it
it's fine
client.users.cache though, no that's not reliable really
your previous implementation was better
Wait so with this,
client.on('ready', () => {
console.log("online")
setInterval(() => {
const totalMembers = client.guilds.cache.map(guild => guild.memberCount).reduce((a,b) => a + b, 0);
client.user.setPresence({ game: { name: totalMembers, type: 'WATCHING' }, status: 'online' })
.then(console.log)
.catch(console.error);
}, 1000 * 60 * 5);
})
How do I involve what you sent in that?
replace game: {...} with that
right.
client.user.setPresence(activities: [ { name: client.users.cache.size + "members", type: ActivityType.Watching} ])```
now fix the syntax
you should still replace client.users.cache.size and fix syntax
Getting your bot's member count
• client.users.cache.size is unreliable because it will only return cached users
• The preferred method is using collection.reduce() on client.guilds.cache
client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
client.on('ready', () => {
console.log("online")
const count = client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
client.user.setPresence({ activities: [ { name: count + "members", type: ActivityType.Watching }]})
});```
looks fine, test it
Look at the bottom pic... that's the error I get.
ActivityType is not defined.
import it from djs then
import it from discord-api-types, I don't think djs exports it
actually, it does
okay.
Thanks, finally works.
👍
hey, how do I get v14 ?
check the topic of this channel
thanks, are there docs too?
thanks sir
const m = await cmd.reply({
components: buttons,
content: question,
ephemeral: true,
});
const buttonsCollector = m.createMessageComponentCollector({ time: 60000 });
buttonsCollector.on('collect', (interaction) => {
console.log(interaction);
});```
why is interaction not collected, is there a different way for collecting ephermeral interactions?
specify fetchReply: true on your reply option
will try
in v14 it returns an InteractionResponse object if fetchReply isn't specified
you shouldn't need to fetchReply anymore just to create a collector
that worked, thank you
this worked
@brazen knoll could you try and update to the latest commit first?
i did just yesterday
if this doesn't work, that's an issue right there
lemme do taht rq
nope only works with fetchReply
could you log m?
(i cut away client)
ping if u need more
i can't test it now, but well it is an InteractionResponse, maybe it being ephemeral is the issue
probably, well the fetchReply fixed it so im happy
new Builders.ModalBuilder()
.setCustomId(`suggestionReason_${i.createdTimestamp}`)
.setTitle('Add Details')
.addComponents([
new Builders.ActionRowBuilder().setComponents(
new Builders.TextInputBuilder()
.setCustomId('longReason')
.setLabel('Put long Text here')
.setPlaceholder('optional')
.setStyle(Discord.TextInputStyle.Paragraph)
.setRequired(false)
.setMinLength(0)
.setMaxLength(4000),
),
]);```
data.components[0].components[BASE_TYPE_REQUIRED]: This field is required
now im trying to do modal stuff but i cant figure out how to make it work
issue was .addComponents([]), shouldnt be given an array
Update, it should.
woh
but its not working with array
setComponents takes an array as well
bots cant delete ephemeral messages can they?
no

how to fix?
remove ...
on components ...
it must be array
ok
they made it accept arrays now
update node
addComponents takes an array
they made it work with arrays for some reason
Anyway to fix this?
<GuildChannel>.isText()
isText() is a typeguard, use it like one
Hey, my code doesnt log it
modalSubmit isn't discord.js event, use interactionCreate
Are we able to create confirmation modals like this?
no
How I can install discord.js v14 ?

npm install discord.js@dev
Is there a guide for modals?
yes
Yes, Check the pinned messages
You can't 🙂
That's unfortunate.. thank you though!
is slashCommandBuilder not integrated into djs 14?
no
it is re-exported though
ok i dikdnt know sorry
no worries, everything from builders is being re-exported nowadays
Why are these methods removed?
How do I get the name SubCommand?
because you can't get Message, Focused, Mentionable, Role, Attachment, Number, Integer, String, Channel, Boolean, SubcommandGroup or Subcommand from ContextMenuCommand
Interaction#isChatInputCommand()
Indicates whether this interaction is a [ChatInputCommandInteraction](<https://discord.js.org/#/docs/discord.js/main/class/ChatInputCommandInteraction>).
Any clue why this is happening? Pretty sure I'm setting the name?
Why did they leave only getUser and getMember? How do you get a Subcommand?
whats moveCmd.moveCategory
i think thats what you can get from commands
what typeguard did you use?
you would have to check if its ChatInputCommand
it has to be an array of objects, { name: 'Name', value: 'name' }
who else knows
what
@marble blade
read my message
its a function that narrows the type of the interaction
if (!<Interaction>.isChatInputCommand()) return
do this
what 
❌
I need subcommand
you can only get subcommand from chatinputcommand
you cant from contextmenucommands
because you cant add any options to contextmenus
hm
okay...
thanks)


how to fix?
what is action
const action = new Menu()
Menu isn't discord.js constructor unless you renamed it
i get it from here
I changed it to this but still getting the same error
this is official discord.js constructor
You need to put the menu in a Row
And provide the row when calling uodate
yes right i forgot
can i find out if a user has their DMs closed before doing a post request
NO
OH OKAY :(
No, only way to check is to catch the error from .send
it'd be nice of discord to add something to the user object where you can figure that out
would also lessen ratelimit possibilities
How can I remove the APIInteractionDataResolvedChannel type?
typeguard
I don't understand why it's needed at all.
how to fix?
Add if (!interaction.inCachedGuild()) return in command handler
Channel.isTextBased() ?
no this includes dm, threads and news
And define all interactions as Interaction<"cached">
Kind of confused as to why I'm getting this error
just channel.isText()
The first provided choice is malformed
It’s missing a string name, and a string value property
Guild#commands
A manager of the application commands belonging to this guild
This is malformed?
are you on the latest versions? because it used to take an array, and then rest parameters, and now an array again
Try spreading the Array
The current main branch takes rest parameters for addChoices
oh yeah what 
@velvet jasper is this intentional? slash command string/number/whatever options addChoices takes rest parameters
https://github.com/discordjs/discord.js/blob/df64d3ea382c07e66bc7cc8877ee430206c31d63/packages/builders/src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ts#L22
don't ping contributors... their busy people
No Vlad stated they would change at some point
How to use descriptionLocalizations correctly? I tried to set the Ukrainian text, but the description is still in English. How does it work?
how do you set rest parameters for addChoices then? never heard of that
.addChoices({ name, value }, { name, value })
i think you have to set your discord lanuage to ukrainian or you have to be in ukraine
It doesn't work
well did you enable the build overwrite for it?
afaik its not rolled out yet on clients
https://discord.com/__development/link?s=2mmZHcCA7EGY7gaDAtbp1HeVsA6KCu1VQNMZX6thh0w%3D.eyJ0YXJnZXRCdWlsZE92ZXJyaWRlIjp7ImRpc2NvcmRfd2ViIjp7InR5cGUiOiJicmFuY2giLCJpZCI6ImZlYXR1cmUvd2ViLXNsYXNoLWNvbW1hbmQtbG9jYWxpemF0aW9uIn19LCJyZWxlYXNlQ2hhbm5lbCI6bnVsbCwidmFsaWRGb3JVc2VySWRzIjpbXSwiYWxsb3dMb2dnZWRPdXQiOmZhbHNlLCJleHBpcmVzQXQiOiJUaHUsIDA1IE1heSAyMDIyIDIyOjE1OjE4IEdNVCJ9
wha
no array?
it should take an array as well
apparently it only takes rest parameters but I just get an error if I put in 2 objects like that with no array
are you using the latest version of builders? aka 0.14.0-dev.1650931748-df64d3e
because it takes rest parameters
wow, what is this?
I'm on 14.0.0-dev.1650931749-df64d3e
ngl I have no clue what rest parameters are but I put it in like that with no array and it just gives me an error. MDN docs didn't make much sense to me
again, it should take an array
build overwrite for slashy localization
okay)
thanks)
already tried that and got this error
It should take an array, but it doesn't
It’ll likely be changed in the future
"rawError": {
"message": "405: Method Not Allowed",
"code": 0
},
"code": 0,
"status": 405,
"method": "put",
"url": "https://discord.com/api/v10/applications/962304955971174440/guilds/626102413857652746/commands/permissions",
"requestBody": {
"json": [
{
"id": "965298369247453294",
"permissions": [
{
"id": "658779239117750285",
"type": 1,
"permission": true
}
]
},
{
"id": "964957793205514300",
"permissions": [
{
"id": "658779239117750285",
"type": 1,
"permission": true
}
]
}
]
}
}
const fullPermissions = [
// Ping - pong?
{
id: '965298369247453294',
permissions: [{
id: process.env.ADMIN_ROLE_ID!,
type: 1,
permission: true,
}],
},
// Mod Suggestions
{
id: '964957793205514300',
permissions: [{
id: process.env.MODERATOR_ROLE_ID!,
type: 1,
permission: true,
}],
}
];
if (!client.application?.owner) await client.application?.fetch();
await client.guilds.cache.get(guildId)?.commands.permissions.set({fullPermissions});
Known Discord issue
DiscordAPIError: Bots cannot use this endpoint
when setting command perms
Same issue
Okay
you can't set permissions...
Discord trying to roll out slash cmd perms v2
The whole point of permissions V2 is that you don't need to set permissions
how to fix it?>
The admins of the server do
maybe add this to faq because many people will try this
Using a UI
UI?
User Interface
Only a 30 min warning? 
Did Discord give an earlier warning?
not that I know
but does that matter 
no
Right, totally won’t affect bots that currently use it
so i delete the whole code setting perms?
yes
ok
Okay but can i set default perm for command?
its only in dev right?
Nope
It’s a present for everyone
unless your bot is in guilds that dont have permissions v2 yet
Which they're rolling out to all of them now
Okay thanks
how much time till the set method will be removed from djs docs?
curious
it will be removed in v14 probably
There will be way to set perms from API soon?
Question, is addComponent array or not? Some say its a rest param?
Prob when Discord removes it from their docs
its more of a urgent fix i think
addComponents should definitely already take array
Not rly
or add a deprication tag
Bots can’t just not use it
not every server has permissions v2
Alr 👌
do you turn on the perms v2 or does it happen for random servers?
thats automatic
Discord has to process all of the guilds
where to look on the guild to set the perms?
Discord heavily relies on the eventual consistency model
See blog post
It has instructions
Integrations and your application
or something like that
where?
ur looking at it
In Bots and Apps section
no commands tab seen
then its not on that guild yet
my client is getting the error and also doesnt see the commands tab on his server
again, they are rolling out perms v2, you will have to wait
do i shut down the bot till it appears?
you do what you wanna do
Does anyone see anything that is been changed? Cause I get a component.toJson error whenever I try to run this cmd
could you send the stack too?
and make sure all the packages are up to date
I mean i'm using the absolutely newest v14 version, could it be something with the package itself?
i dont see where you use showModal in this code
I don't, more or less getting the same error for every button I click
either way try updating builders to dev and djs to dev
How can I send components?
addComponents takes an array
now its good
Errors?
Alr well updating builder & rest package doesn't work, I assume its just a bug in the latest dev version
@marble blade #djs-in-dev-version message
if you don't show the part where you call ButtonInteraction#showModal we can't help you
Well it was just a button I clicked randomly, none of my buttons work but sure i'll show it
cannot reproduce the error with latest dev, is your builders package up to date? if you have it installed manually remove it, d.js exports re-everything from it
Its interactionCreate.js line 427?
Lemme see
Highlighted one is
That intent still exists
There's also MessageContent to access content
Guilds
not GUILDS
Its the same they just made it PascalCase
GuildMessages
don't do this it will slow down your bot
you can't use SCREAMING_SNAKE_CASE for things like styles anymore in v14 dev
see the changes/guide in pins
Create a new InteractionCollector
No
InteractionCollector (extends Collector)
Collects interactions. Will automatically stop if the message (Client#event:messageDelete messageDelete or Client#event:messageDeleteBulk messageDeleteBulk), channel (Client#event:channelDelete channelDelete), or guild (Client#event:guildDelete guildDelete) is deleted. (more...)
Modals arent message components
On the subject of modals, it is not impossible to modify the OG interaction once the modal has been shown, correct?
ModalSubmitInteraction#update()
Updates the original message of the component on which the interaction was received on.
Whenever I try to make edits to the original ephemeral interaction after a modal is shown, it tells me the interaction has already been acknowledged.
Hm
Let me give it the ole try
Or just interaction.editReply on the original
^ Now that I know fails
Why?
Already acknowledged means you're using the default reply again
editReply would work for up to 15 minutes
I really couldn't tell you why, but if I showModal() and then follow it up with editReply, then it fails. You're welcome to give it a quick shot on your end if you'd like
Been struggling with this all day
So uhh... what triggers the modal?
A button in an ephemeral message
So if a Slash Command triggers the modal, theres nothing to edit. Just reply to the modal
A button in a message, you should still be able to use ButtonInteraction.editReply I would have thought
But still, might as well use ModalSubmitInteraction#update to achieve the same thing
Let me give this a shot (ModalSubmitInteraction.update())
Since I need to do that on the modalSubmit event anyways
Suggestion for @scarlet tangle:
Popular Topics: Interaction collectors
read more
God fucking dammit.
No?
Maybe Discord is just being fucky with ephems then
No it worked perfectly.
oh good lol
I didn't think to do an update on the ModalSubmit interaction because I figured you can't update a Modal
I mean the verbiage Discord's API uses is weird. You're not updating the Modal, and a ModalSubmit stems from a modal interaction. Maybe I am just an idiot, but the wording is a bit strange.
A .reply() on a Modal makes sense to me, though.
all good yeah
Thats why we try to make it a bit clearer
Thank you
is there a bug on Guildmeber.displayAvatarURL in current dev version?
my code is iconLink: guild.members.cache.get(userid).displayAvatarURL({ format: 'png', dynamic: true, size: 2048 }), but it only return .webp url
format was replaced with extension, and the dynamic option was removed
oh thx
Hello,
I followed the instructions I found on https://discord.com/blog/slash-commands-permissions-discord-apps-bots but despite that I can't modify the permissions of my commands: when I click on "manage" on my bot line in my server's integrations list I don't have the part that allows me to allow or deny permissions for commands.
If it helps it's a certified bot on a partner server
That is not a DJS issue
Try restarting/updating your Discord client (not bot), and if that doesn't fix it, it may take a little time before the server gets the feature
Restarting my discord client worked, didn't think it was such a recent addition. Thanks
will djs14 use the permissions v2 system? and how will that work with updating the permissions since now bearer token from oauth2 is required?
The whole point of permissions v2 is so that bot developers dont have to update the permissions
Its unclear if we will or wont support the oauth endpoints but its would be up to you to get oauth bearer tokens to use with them if thats the case
but for developer commands, you want to set permissions programatically and restrict it only to few selected users
What do you mean by "developer commands"
Maybe commands like eval etc.
eval is a terrible command to have
Yep
But if you do have one
It probably shouldnt be global at all
Restrict default_member_permisisons
And then go into your server and add an override for yourself
Developer commands should only really be used on a single guild that you have strict control over. Any command you push globally will be usable by guild owners and anyone with the Administrator permission (and by extension anyone they allow access to that command to). That’s not something d.js can change
no not eval lol. like these (+ more)
Well those commands will be available to every admin/server owner
For guilds they're deployed to
will there be new commits?
on Dev branch
At some point in the future yes, a new commit will be on the dev branch
There are new commits every day
So as the new addFields() takes arrays, can I have multiple addFields() or just multiple objects in a single array?
both
okay
How can I extend the class CommandInteraction<"cached">?
whats the point of doing that, discord.js will not use your extended class
Is localisation already in v14 ? 0.o
yes
nice
how does SlashCommandSubcommandBuilder#setDescriptionLocalizations() work?
SlashCommandBuilder#setDescriptionLocalization()
Sets a description localization
I didn't for ask that
What do you mean by "how does it work" then?
when I change my discord language to french it still show me the text in english
Client-side, theyre still locked behind the experiment
what's the format to pass in it
Whatever the docs say, I dont use builders
But thats probably why its not working
The experiment
U can use localization override
it's only for discord website no?
not the application
web-slash-command-loc... ?
it means what I said?
try it and see
I tried and what I did still doesn't work ._.
Why do i get an Message out of Fetch ? after i updated ? Shouldn't i get an Collection of Messages ? Am i missing something ?
cannot replicate
rip
Thats just one of the two overloads
Which is why it says +1 overload
cannot replicate
what is wrong with this now?
message is null
it's not
I am quite confused, i see there is an overload but i cant seem to target that one because both use FetchMessagesOptions and i cant seem to specify it 0.o
Is there some kind of trickery ?
send full code in scrb.in
Okay, i just restarted VS Code and that did the trick
const { GatewayIntentBits } = require('discord.js');
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages],
bot not responding to commands
are you still using text command? you gotta need MessageContent intent as well
I write a bot for both text commands and slashes
const { GatewayIntentBits } = require('discord.js');
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent],
```?
i said 'as well'
yep
ths
TypeError: Found non-callable @@iterator
you passed rest parameters where you should pass an array
await command.execute([client, message, args]);
```?
this code has nothing to do with discord.js
Hello Admin & Mods!
Today, we have a new update for slash commands in your servers: Permissions! If you don’t know, slash commands are a new, easier way to use bots on Discord. You might already have some to use—type / to find out!
With this new system, you can:
dotControl who can use slash commands in your servers
dotControl in which channels commands can be used
dotSync or unsync commands like channels and categories, making mass management and special cases easy to handle
You can find these permissions in Server Settings → Integrations → Pick an app! If the app supports slash commands, you’ll see the UI.
warning If a bot you use has integrated slash commands, the old way of denying the bot Read Messages will not work to moderate commands usage. You’ll need to use this new system to control access.
Not sure if your bots support slash commands? Check out in Server Settings → Integrations, or just type /!
Check out our blog post to learn more and see a detailed walkthrough: https://discord.com/blog/slash-commands-permissions-discord-apps-bots
Does djs support it?
yes
In dev v14 or in v13 too?
in dev v14
We don’t support it yet
^
how
you can set default permissions
I think he's talking about this: https://github.com/discordjs/discord.js/pull/7857
The pr for perms v2 isn’t merged
rawError: { message: 'Bots cannot use this endpoint', code: 20001 },
don't use this endpoint
its disabled
do you know any alternative
yes you go to server settings and integrations and choose your bot and edit permissions
cant the bot set the permissions anymore?
in v2
no
only server admins
or members who have the ManageGuild permission dunno
the bot has admin perms
bots can't set permissions
ohkay
I wonder why would they remove the ability of the bots to add or remove permissions
That's not a discussion for here
also this https://github.com/discordjs/discord.js/pull/7857 will be available in 13.7.0?
or only v14
Ok so bots can't set slash commands permissions now, but what happens if we want to clear them? Like for example I have some commands that I allow me to have explicit access to them and I can't seem to clear that extra permissions. The integrations panel says I cannot manage this user.
unrelated to discord.js #useful-servers or #archive-offtopic
Well those explicit permissions where set through d.js so how is it unrelated?
djs doesnt manage those perms
are you removing those with djs?
https://discord.js.org/#/docs/discord.js/stable/class/ApplicationCommandManager?scrollTo=permissions
since bots cant set, remove or add permissions anymore then will this be deprecated?
no nono you can't do permissions with discord.js you have to go to servers settings and integrations and choose your bot and edit the permissions here...
let menuOptions = [];
commandDir.forEach(folder => {
menuOptions.push({ name: `${folder}`, value: `**\`${client.commands.filter(x => x.folder === folder).map(x => x.name).join('`**, **`')}\`**`});
});
embed
.setTitle(`${lang.titleNoArgs.replace('%bot%', client.user.username)}`)
.setDescription(`${lang.descriptionNoArgs.replace('%prefix%', guildData.prefix)}`)
.setColor(cfg.colors.good)
.addFields(menuOptions);
addFields takes an array
menuOptions.push
then idk
I have tried putting an empty permissions array through the endpoint which as expected gives out a "Bots cannot use this endpoint"
I am only asking for a way to clear those extra permissions. Through discord it can't be done, the API is now updated, how can I achieve that?
Edit: nvm figured it out
let menu = []
commandDir.forEach(x => {
menu.push({ label: x, value: x });
});
const row = new BeQuite.ActionRow().addComponents(
new BeQuite.SelectMenu()
.setCustomId('help_menu')
.setPlaceholder(`${lang.selectCategory}`)
.addOptions(menu)
);
here are 2 pieces of code in which i use arrays
addComponents needs array
but i dont know where is the mistake
oh, ok
ths
everything is working now
Those permissions are gone iirc
https://discord.com/developers/docs/topics/gateway#application-commands-permissions-update
this will be added as an event right?
How to fix? This channel id is correct
use await client.channels.fetch(id) for check if the promise is rejected
show your const channel
log channel
?
console.log(channel)
null
Just use a webhook
its worked
how to edit channel permissions?
on an existing channel
channel.permissionOverwrites.edit(...)
Could you please post an example instead of the ... part?
Documentation suggestion for @undone yew:
PermissionOverwriteManager#edit()
Edits permission overwrites for a user or role in this channel, or creates an entry if not already present.
thx
how to edit channel topic?
?
^
TypeError: Cannot read properties of null (reading 'roles')
at Client.<anonymous> (/root/Generaly/app.js:1026:36)
at Client.emit (node:events:539:35)
at MessageCreateAction.handle (/root/Generaly/node_modules/discord.js/src/client/actions/MessageCreate.js:26:14)
at Object.module.exports [as MESSAGE_CREATE] (/root/Generaly/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/root/Generaly/node_modules/discord.js/src/client/websocket/WebSocketManager.js:351:31)
at WebSocketShard.onPacket (/root/Generaly/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/root/Generaly/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/root/Generaly/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (node:events:527:28)
at Receiver.receiverOnMessage (/root/Generaly/node_modules/ws/lib/websocket.js:1137:20)
at Receiver.emit (node:events:527:28)
at Receiver.dataMessage (/root/Generaly/node_modules/ws/lib/receiver.js:528:14)
at Receiver.getData (/root/Generaly/node_modules/ws/lib/receiver.js:446:17)
at Receiver.startLoop (/root/Generaly/node_modules/ws/lib/receiver.js:148:22)
at Receiver._write (/root/Generaly/node_modules/ws/lib/receiver.js:83:10)```
what can couse this error is used to require a specific role to run a command only some times not all time if giving this eror
a message without a member. DM, webhook or system message
how i can fix it is used only to check if member have a role and if not to give another messege like u cant use this command
help
check message.member for null, use optional chaining, check Message#system, Message#webhookId, Message#channel#type, ...
Documentation suggestion for @undone yew:
BaseGuildTextChannel#setTopic()
Sets a new topic for the guild channel.
how to fix?
SendMessages
ok
When showing a modal, does it automatically defer the interaction?
Ah right right. I got confused with slash commands, thank you
// Code
const userEmbedOptions = [{...}, {...}, {...}];
new ActionRowBuilder()
.addComponents(
new SelectMenuBuilder()
.setCustomId('ViewUser')
.setMaxValues(1)
.addOptions(...userEmbedOptions)
);
// Error
TypeError: options.map is not a function
at SelectMenuBuilder.addOptions
what's wrong with my code?
in addOptions u must put array
since it says options.map is not a function i tried to remove the spread operator but it too resulted in an error
- in actionRow.addComponents put array too
so
.addComponents([new SelectMenuBuilder()])
like this?
yea
Any clue why this aint working?
put the textinput in an actionrow
and the actionrow in the modal
ty
still having problem with this, I checked the docs as well and it seems that addOptions and setOptions now take an array instead of objects
// Code
const userEmbedOptions = [
new SelectMenuOptionBuilder()
.setLabel('Overview')
.setValue('overview')
.setDefault(true),
new SelectMenuOptionBuilder()
.setLabel('Roles')
.setValue('roles'),
new SelectMenuOptionBuilder()
.setLabel('Avatar')
.setValue('avatar')
];
let x = new ActionRowBuilder()
.addComponents(
new SelectMenuBuilder()
.setCustomId('ViewUser')
.setMaxValues(1)
.setOptions(userEmbedOptions)
);
what am I doing wrong here?
addComponents takes an array
but im getting the same error even after giving an array in .addComponents
let userEmbedComponents = new ActionRowBuilder()
.addComponents([
new SelectMenuBuilder()
.setCustomId('ViewUser')
.setMaxValues(1)
.setOptions(userEmbedOptions)
]);
im getting the exact same error from .setOptions() line
im stuck with this for 2 hours now
this didnt have in the earlier versions of v14
i updated to the latest v14 version today
nvm i didnt read previous messages
..
can someone please help me this is really frustrating
edit the message manually
ButtonInteraction#message
The message to which the component was attached
showModal() is a reply to the interaction
no, show the modal and then edit the message manually
interaction.message.edit()
anyone..
// Code
const userEmbedOptions = [
{
label: 'Overview',
value: 'overview',
default: true
},
{
label: 'Roles',
value: 'roles'
},
{
label: 'Avatar',
value: 'avatar'
}
];
let userEmbedComponents = new ActionRowBuilder()
.addComponents([
new SelectMenuBuilder()
.setCustomId('ViewUser')
.setMaxValues(1)
.addOptions(userEmbedOptions)
]);
updated the code a bit
are you on the latest version?
that error message makes it seem like addOptions is expecting rest parameters
(and the latest version doesnt, it takes an array)
@tame gazelle looks like your problem might be fixed by https://github.com/discordjs/discord.js/pull/7862
It's 1. Use GuildDefaultMessageNotifications.ONLY_MENTIONS (the enumerable)
https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
GuildDefaultMessageNotifications.OnlyMentions
and you'd have to import that from discord-api-types as its not exported in djs
Ah thank you, that (:
I have a feeling that should be
yeah idk why some of the enums that have an EnumResolver aren't reexported
How can I use messageCreate when Im not getting its content?
MessageContent its blocked look like it
enable it in the dev portal
Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
If you are using the GUILD_MEMBERS, GUILD_PRESENCES, or MESSAGE_CONTENT intents, you need to enable them in the developer portal:
• Developer Portal > Your app > Bot > Privileged Gateway Intents
Ahh, there is something new
Thank you
• Websocket intents limit events and decrease memory usage: learn more
• See what intents you need here
emoji name is invalid
emoji is <:e_: 967169725090115704>
what would the name be
?
The error just said it’s on name
Are you sure that’s the only button?
yes
I hope it will be merged in the next dev release
in my threadCreate event, client returns true (the readyState, even though I'm not using that...), in the exact same usage in other events that work perfectly. it functions fine on v13. any reason why this might be?
yes exactly, i think there was some error in the latest commit because neither can I add rest parameters nor an array in .addOptions and .setOptions both
well not latest but the commit where these changes were made
I am on the latest version, made sure of that 2 times
"discord.js": "^14.0.0-dev.1651147765-679dcda",
Ill just open an issue then, since both rest parameters and array returns an error
where are the errors
nvm I see
Are you importing from discord.js or builders directly?
I just ran this code without any errors, can't replicate the issue
discord.js
Yeah, cant replicate that issue
i just ran the same thing again and I got this
I didnt make a single change in the code either
its the same one that i posted above
Can you show me the full output of npm why @discordjs/builders
okay 1min
I get this
@discordjs/builders@0.14.0-dev.1650672503-3617093
node_modules/@discordjs/builders
@discordjs/builders@"^0.14.0-dev" from discord.js@14.0.0-dev.1651147765-679dcda
node_modules/discord.js
discord.js@"^14.0.0-dev.1651147765-679dcda" from the root project
Its almost like it thinks theres a nested array?
@discordjs/builders@0.14.0-dev.1650240529-9ef7ffd
node_modules/@discordjs/builders
@discordjs/builders@"^0.14.0-dev" from discord.js@14.0.0-dev.1651147765-679dcda
node_modules/discord.js
discord.js@"^14.0.0-dev.1651147765-679dcda" from the root project
hmm so you have a different builders dev version
I wonder why
do i need to update them separately? I have just done npm i discord.js@dev
You shouldnt
Uninstall discord.js fully first, then run npm why @discordjs/builders and make sure it errors
Then reinstall
okay
it wont error
oh, nvm
removed @\dev
hmm its still installed from somewhere
oh did you fix it?
i tried to uninstall discord.js instead of discord.js@\dev and it got removed
okay cool
Just reinstall now then
its done now
that looks better, the builders tag matches the discord.js tag
let me try the code once
yup works
thanks @knotty plover
cool, no idea how they got out of sync
i dont either, I just remember that I had updated my dev version and thats it, the errors started coming up after i updated the version
receiving this error from one the fields but I cant figure out which
// Code
.addFields(
{ name: 'Sent By', value: `${target}`, inline: true },
{ name: 'Sent On', value: `<t:${Math.floor(message.createdTimestamp / 1000)}>`, inline: true },
{ name: 'Deleted By', value: `${executor}`, inline: true },
{ name: 'Message Id', value: message.id, inline: true },
{ name: 'Author Id', value: target.id, inline: true },
{ name: 'Executor User Id', value: executor.id, inline: true }
);
takes an array now
oh right
my bad
in the v13 to v14 switch guide that the functions have been renamed but isVoice()/isText() still exists and aren't even deprecated?
Yeah they got added back
What isText() used to do, is now isTextBased()
isText() now specifically checks the GUILD_TEXT type of channel
but what's the difference between isText() and isTextBased()?
TextChannel, DMChannel, probably ThreadChannel are all text based
NewsChannel
ohh
ty
https://discord.js.org/#/docs/discord.js/main/typedef/GuildAuditLogsFetchOptions
can we put more than 1 type in type parameter?
nope
then, how do we find which message was pinned or unpinned in channelPinsUpdate event?
this is a separate question
im trying to fetch pinned and unpinned events from audit logs
but since I dont know which event has triggered, unpinned or pinned i cant fetch the exact data from audit logs
const { executor, target, extra } = (await channel.guild.fetchAuditLogs({ type: AuditLogEvent.MessagePin })).entries.first();
const message = (await channel.messages.fetchPinned()).find(({ id }) => id === extra.messageId);
console.log(message);
this will return the message data if the message was pinned but will return undefined if it was unpinned since im searching for MessagePin Events and not MessageUnpin
fetch 2 times, first for pin and again for unpin, it isn't possible to fetch both at the same time as the api also takes an integer for the action_type..
any way to get the message that was pinned or unpinned from the channels? that way I could fetch the AuditLogs after wards and decide if type should be MessagePin or MessageUnpinned depending on the value of pinned property
i see
bump, is there any reason why this would happen?
Can you show how you are using it
I'll just paste it here as it is small:
const { ThreadChannel, Client } = require('discord.js');
const { logEmbed, getChannelInfo } = require('../../util/functions');
module.exports = {
name: 'threadCreate',
/**
* @param {ThreadChannel} thread
* @param {Client} client
*/
async execute(thread, client) {
logEmbed({ client, guild: thread.guild.id, channel: thread.parent, description: `A new thread, ${thread.toString()}, was created:\n\n${getChannelInfo(thread).join('\n')}`, title: `Thread Created`, color: 'Green', isEvent: true });
},
};
function logEmbed(input) {
const { client, guild, channel, description, title, color, thumbnail, attachment } = input;
...
client.channels.cache.get(targetChannel).send(attachment ? { embeds, files: [attachment] } : { embeds });
I can't see any issue with this at all, and nothing has changed since I migrated from v13
The second parameter isn't the client
I pass it through to each event from my events handler
client.once(event.name, (...args) => event.execute(...args, client));
In that case, the third parameter is your client
You are not using it
The second parameter is newlyCreated
https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-threadCreate
ah well that explains it– I didn't know that was updated–
This worked for you on version 13 because this did not exist in version 13
thank you so much!!
You're welcome
do you know if there were similar changes to any other events? (I'll look through anyway)
You can also access the client via thread.client, you know that right? Just curious why you're passing it
Might be best to look through the ones you are using and compare them to the documentation tbh. Some events got a new parameter but I know threadMembersUpdate's parameters changed
that– is a very good point I hadn't thought of that!
will do, thanks so much for your help again :)
[:
Tag suggestion for @scarlet tangle:
Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
If you are using the GUILD_MEMBERS, GUILD_PRESENCES, or MESSAGE_CONTENT intents, you need to enable them in the developer portal:
• Developer Portal > Your app > Bot > Privileged Gateway Intents
I want to change the permissions of the bot when joining the server, not the role, nor the permissions of the channel.
what should I do?
not the role?
not the role.
yknow permissions in the invite url are the permissions that are set in the bot role?
If a bot could change it's permission right after joining 
What are you talking about specifically
I want to avoid errors caused by removing permissions when a user invites a bot, so I want to set permissions again immediately after rejoining
you have to edit the bot role then
So I can't edit the permissions of the bot in the server, can only edit the role?
If there are multiple roles after the bot is added, how do I know which one I should edit?
(Some bots will add roles for newly joined members.)
permissions are based on roles
execpt for the server owner
OK.
how do I know which one I should edit?
you can find a role by the bot name and check it it’s managed
but two bots can have the same so it isn’t reliable
a bit of topic but do you need to cache mysql data for a pokemon bot
data must be accessed and changed quickly
since it's off-topic, #useful-servers
you can find the role by <Role>.tags.botId
there's also <Guild>.roles.botRoleFor(<User>)
how do i use status in v14
?
you can set the presence option when instantiating your client
?
type must be number
ok
32767 doesn't mean all the intents anymore 
nor should you be using all of them
well no you should use the ActivityType enum instead
magic numbers are not recommended
yea but this isn`t in docs so i sends discord docs
it's easy to explain
instead of it being in all caps, the property is just in PascalCase, ActivityType.Streaming for example
okey
Why content property is empty in messageDelete event?My bot is unverified btw.
so I have this: ```js
const row1 = new ActionRowBuilder({components:[
new ButtonComponent(new ButtonBuilder().setLabel('1').setCustomId('00').setStyle("Primary").toJSON()),
new ButtonComponent(new ButtonBuilder().setLabel('2').setCustomId('01').setStyle("Primary").toJSON()),
new ButtonComponent(new ButtonBuilder().setLabel('3').setCustomId('02').setStyle("Primary").toJSON()),
]}).toJSON()
and I keep getting this error, anyone know why?
it's coming from the .toJSON, and I have no idea why because I already have a label
why do you create a new ButtonComponent?
you can just pass the ButtonBuilder on addComponents
oh alr
is that the problem
yes
alr thanks
Please help
because it's deleted, the only thing that would be guaranteed would be the id, the channel and the guild if it exists since the three ids are all discord gives you
you getting the content solely depends on the message data being cached
i think if the message isnt cached it shouldnt fire the messageDelete event
is there a way to know if the User dms are open or closed?
attempt to send and catch err
any other way?
Ok but why is the content empty here
because the message is empty. did you send a file by any chance?
if it was cache or intent related then content would be null
its empty string if you dont have message content intent
has has it ^
oh I didn't know that, I assumed it'd be null as it just doesn't get provided to the client at all. good to know
Is it need if my bot is not verified?
yes
it doesn't look like discord.js to me
i choose current for node 16.9?
LTS is fine
If your bot is unverified you can enabld intents manually, il is a verified bot you need to ask to Discord support for intent enabling
okey starting my journey with v14 today
But all bots need intents
will i have to unistall earlier version of node i had?
or it auto remove older version
@narrow lagoon you can just use n
npm cache clean -f
npm install -g n
sudo n stable
actually idk what os u r using but thats what i use on ubuntu
i use windows
yeah then just use the binary on the website
i dont think its necessary to uninstall old node
const client = new Client({ intents: 32767 });```
does that still work?
yes
thanks
is there a method to check if an interaction is chatinput or user/msg contextmenu only? ( application command )
Documentation suggestion for @stuck fiber:
Interaction#isCommand()
Indicates whether this interaction is a [CommandInteraction](<https://discord.js.org/#/docs/discord.js/main/class/CommandInteraction>).
literal poggers
thanks
Is there any date on when model interactions will be available in the stable version of DJS? I’m sorry if this is a question you get asked regularly
no
Documentation suggestion for @stuck fiber:
Interaction#isChatInputCommand()
Indicates whether this interaction is a [ChatInputCommandInteraction](<https://discord.js.org/#/docs/discord.js/main/class/ChatInputCommandInteraction>).
ty, but i needed chatinput | ctxmenumsg | ctxmenuuser
Oh you wanted both ok
thats why I linked isCommand() 
@slender hull
don't ping them their busy people
are they?
do command translation gonna be in the v14 ?
Yes
nice
The v will be released when ? (if there is a date)
no date
ty
With perms v2 in effect, can I still deploy a bot in the next week or so that uses v14? Do I just forgo setting defaults, deploy it, then configure it on my server with the UI?
It's not a public bot so I don't have to worry about that. It's bespoke for just my server.
sure, you can't deploy "traditional" slash perms for users and roles anymore, that's it
OK great, that's what I figured. Then I can just remove perm updating from my framework for now.
there will be default member and dm permissions, which are not currently supported by builders, so you'd need to switch to raw payloads for your command deploying, if you need that
Oh! I already use raw payloads in my framework. I guess I can use the new default perms then.
sure, those are bitfields for required perms
side note: the UI is very broken and displays
on everyone, regardless
I saw those mentioned in #769862166131245066 but wasn't sure if that was a raw thing or a d.js thing.
Oh boy. 🙃
That'll be fun.
Doesn't seem like there's a choice since the new perms are fully released and the endpoint for setting perms is gone.
I saw a follow-up post on api-docs regarding the perms rollout. I guess that bug is probably one of the reasons.
Thanks for your help. Seems like I'll be good to go since I'm not using builders for my commands.
And thanks for the tip re: the broken UI, heh.
help please
interaction is undefined
what do you mean I already defined it
do you need my code?
Undefined doesnt mean not defined, undefined means its defined but it has no value
Ok
Actually I too used to get this error, is has something to do with the parameters.
why it says the option is invalid?
probably a discord slate v2 bug
ApplicationCommandOptionType.SubCommand I got an error using that
better to send the error instead of having that you have one
It's Subcommand not SubCommand
can I have a documentations for that?
Does .addField have any changes
It is showing an error for me
Yeah it takes arrays now, also .addFields()
addField is removed use .addFields instead
Hello. Recently I read that there can be only one text option inside an action row for models. But how many action rows can there be in a model?
Hi, anyone knows why that user tag on left side is not working as should? Its working sometimes but then its changed for its uuid form
latest dev version
your discord client didnt cache that user
nothing to do with djs
5
Hmm ok
So, can I somehow fix it? Or best I can do, is put there name instead of tag?
if you actually mention them in message content (not the embed) the message payload includes the member data so the client can resolve it
that's the only way to ensure it - and i doubt you'd want to actually mention the person for this use case
(unless the feature is placed in a locked channel that people generally can't read anyways (think modmail, for example))
Error: TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
Code:
const category_name = interaction.options.get('category_name').value;
const category = await interaction.guild.channels.create(`${category_name}`, {
type: 4,
permissionOverwrites: [
{
id: interaction.guild.id,
deny: ['ViewChannel'],
},
{
id: 'my role id here',
allow: ['ViewChannel', 'SendMessages', 'ReadMessageHistory', 'EmbedLinks', 'AttachFiles', 'AddReaction'],
}
]
});
pls help
Thanks, will do that. 
did the GUILDS intent change for v14?
Guilds
is it not all caps anymore
SCREAMING_SNAKE_CASE => PascalCase
so i have a messageCreate event: js bot.on('messageCreate', (message)=>{ console.log(message) }) for some reason it's not logging anything, intents: { intents: ['Guilds','MessageContent'] } i also have the intents on the dev portal enabled
those are not valid intents
wait i just realized this is v14
yea
still those are not valid, you should use the enums provided by the library
when i did Intents.FLAGS.GUILDS it raised TypeError: Cannot read properties of undefined (reading 'FLAGS')
Pins 📌
i see, let me try
yes they are valid intents
you still need GuildMessages intent
new Client({ intents: ['Guilds', 'GuildMessages', 'MessageContent' })
let me try that too then
that looks so weird when you are used to all caps
Error: Received one or more errors
at UnionValidator.handle (/root/ObitoInteractions/node_modules/@sapphire/shapeshift/dist/index.js:1467:23)
at UnionValidator.parse (/root/ObitoInteractions/node_modules/@sapphire/shapeshift/dist/index.js:110:88)
at EmbedBuilder.setDescription (/root/ObitoInteractions/node_modules/@discordjs/builders/dist/index.js:261:54)
at Object.execute (/root/ObitoInteractions/commands/utility/emoji.js:70:6)
at Object.execute (/root/ObitoInteractions/events/interactionCreate.js:56:31)
at Client.<anonymous> (/root/ObitoInteractions/Structure/Client.js:59:37)
at Client.emit (node:events:526:28)
at InteractionCreateAction.handle (/root/ObitoInteractions/node_modules/discord.js/src/client/actions/InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
is the description empty?
empty string description, it seems
yeah that was it
what does this mean
use ApplicationCommandType.User instead
import it from discord.js
you mean ApplicationCommandOptionType.User? or is it just ApplicationCommandType
ah I thought it was a context menu command
ah alright
[Error: ENOENT: no such file or directory, stat '/home/container/4d6f6b6471f1b808cd3dc8d005509ed7'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/container/4d6f6b6471f1b808cd3dc8d005509ed7'
} Promise {
<rejected> [Error: ENOENT: no such file or directory, stat '/home/container/4d6f6b6471f1b808cd3dc8d005509ed7'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/container/4d6f6b6471f1b808cd3dc8d005509ed7'
}
}
``` do you know what does this mean it keeps coming when a guild is updated and i try to edit all the properties to the oldGuild parameter and this comes up
why?
await newGuild.edit({
name: oldGuild.name,
icon: oldGuild.icon,
features: oldGuild.features,
description: oldGuild.description,
premiumProgressBarEnabled: oldGuild.premiumProgressBarEnabled,
verificationLevel: oldGuild.verificationLevel,
explicitContentFilter: oldGuild.explicitContentFilter,
afkChannel: oldGuild.afkChannel,
systemChannel: oldGuild.systemChannel,
afkTimeout: oldGuild.afkTimeout,
splash: oldGuild.splash,
discoverySplash: oldGuild.discoverySplash,
banner: oldGuild.banner,
defaultMessageNotifications: oldGuild.defaultMessageNotifications,
systemChannelFlags: oldGuild.systemChannelFlags,
rulesChannel: oldGuild.rulesChannel,
publicUpdatesChannel: oldGuild.publicUpdatesChannel,
preferredLocale: oldGuild.preferredLocale,
reason: "Server Update | Not Whitelisted"
})
``` this is the way i am editing the guild
icon must be buffer
<guild>.icon is hash
so its looikng for file with name of your icon hash
DiscordAPIError[40005]: Request entity too large
at SequentialHandler.runRequest (/root/ObitoInteractions/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:708:15)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (/root/ObitoInteractions/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:511:14)
at async ChatInputCommandInteraction.reply (/root/ObitoInteractions/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:110:5)
at async Object.execute (/root/ObitoInteractions/commands/utility/avatar.js:39:28)
at async Object.execute (/root/ObitoInteractions/events/interactionCreate.js:56:17)
at async Client.<anonymous> (/root/ObitoInteractions/Structure/Client.js:59:25)
oh i see
Request entity too large. Try sending something smaller in size
I set 4096
it isn't good?
probably not
i think you can use Guild.iconURL()