#djs-in-dev-version
35223 messages · Page 15 of 36
You havent shown a collector
Looks like this example could be improved to clarify scope. The multi scope interaction variables is confusing
but looks like the same thing
return something when it expects void
So basically
The methods expect you to return void
Which something like interaction.reply also used to return, so it was fine
But it doesnt anymore, so you cant return it from a collector function
You cant really other than looking at commits
we dont document every change between dev versions
how would i make a embed
like { Embed } from discord?
cause don't know if the name got changed
its in the guide
EmbedBuilder
got it!
what is the thing now called to add fields?
cant find the docu of .addFields()
EmbedBuilder#addFields()
Adds fields to the embed (max 25)
it works the same as v13
so .addFields('1', '2') would work?
this was addField and it has been removed
well thats how i used fields in v13
.addFields({ name, value, inline })
same as v13
alr thought that
tyyy btw sorry if i ask much, new to v14
why does the number log perfectly fine when doing it in a field, but not when i log it?
uhh not sure what you mean tbh, what does it log as
undefined
because of a typo
wym
there is a typo in the const build line
wait
lemme just do this console.log(out3.vars.sv_enforeGameBuild)
nope that still has the typo
huh
do i need toString it?
you need to spell it properly
the names aren't wong?
Rin even told you the typo
this.build = out3.vars.sv_enforeGameBuild ?

I AM SO FK SORRY
yes i am aware of that
the help i get from google is
That's some ancient ES5 code
const build = []
build = out3.vars.sv_enforeGameBuild ?
I have no idea what that has to do with anythinng
dude
You spelt enforce wrong
BLAME MY FK GOOGLE
That is the only problem
where tf do you see enforce
In the field
how about you copy the right name and paste it, so you dont misspell it
Where you spelt it enforce
And it worked
Unlike the line where you did NOT spell it enforce
MY FK GAWD I AM SO BLIND
And it does NOT work
SORRY!
i see it now but i am so sorry
its like 2 am for me
Like.... it literally feels like you ignored every answer you were given
Thats not an acceptable way to seek support
sleep then ._.
i already thought like enforcing?
I didn't know you guys were talking about my code, but more the basics of javascript. (just thought huh enforcing)
thats why i came with stupid ss's but i am so sorry
just wanted to fix that little thing then i would go to sleep
I'm going to sleep, thanks for your help and I'm going to sleep and if one of you is going to do that too then good night or have a nice day! ❤️
Uhh you're mixing collector with promise
It does reject when the end event is emitted if the end reason is time
Otherwise when it ends it returns the one collected ModalSubmitInteraction
for some reason the site will not load for me. how can I fix this?
I think it’s down, I was trying to get to it too with no luck
okay thanks.
Its working for my other friends, maybe they have the data saved from the website, because on my firefox its configured that it clears cookies when the browser is closed. idk
yea same for me
@knotty plover @dawn phoenix can you help here?
sorry sir i just was angry
Yeah, thanks!!
And also, which channel should I use?
None of them, because this is DJS not Discord 👌
right
thanks, and sorry
What is this?
it's typescript error
Either move return below the followUp or add void like return void interaction.followUp(…)
Pretty sure d.js expects the callback to return void
even if i leave the event empty it shows the error so idk what im supposed to put in there or change
The problem is CommandInteraction when thats not correct, it could be any type of interaction
so the type should just be set to Interaction?
or dont cast its type as djs already defined event typings
How do you get files sent in a slash command?
How can I set the avatar to png in v14?
<ChatInputCommandInteraction>.options.getAttachment('attachment_name_here')
Documentation suggestion for @narrow wagon:
ClientUser#setAvatar()
Sets the avatar of the logged in client.
thanks
@white nebula
this is what it should be loading
I don't want that, as displayAvatarURL({format: "png"}) is in v14
oh, you said to set the avatar
displayAvatarURL had its dynamic option removed, and you now use extension instead of format but it works the same
thanks 

Does cancelling a modal emit any event? When I have a modal collector running and the user cancels, if that user executes a new modal my first collector will catch it.
nope
You should use unique customIds so they dont overlap
unique customIds even when the user is executing the same command that brings up the same modal structure? I guess I could add a random string to the modal customId every time
Good call. Unfortunate but I guess it's all we will get.
Thanks
got this error when using emoji in ButtonBuilder
Cannot destructure property 'emoji' of 'undefined' as it is undefined.
pass an empty obj to builder constructor
example ButtonBuilder({})
{ options: [] } if it's a selectmenu
ok
why this happens?
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://discordapp.com/api/guilds/935821346494091304/members/822623402849206283',
status: 400,
statusText: 'Bad Request',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 1
}
}
Code:
let data = await fetch(`http://discordapp.com/api/guilds/935821346494091304/members/${req.user.id}`, {
method: `PUT`,
access_token: "Bearer "+req.user.accessToken,
headers: {
Authorization: `Bot OTUy********************************`,
"Content-Type": "application/json"
}
}).then(console.log).catch(console.log);
not related with djs
oh
Ik now, is in discord.js
<Guild>.members.add(<UserId>, {accessToken: <UserOauth2AccessToken>})
btw you need to specify access_token in the body
ik
I use my alt to login and I have /api/@me endpoint
using selfbot is against to ToS...
no selfbot
this is an oauth2 request
yes
not sure why you don't use the library you are in the support server for, though
I make this:
oh i misunderstood, sorry
app.get('/api/@me', (req, res) => {
res.send(req.user || 'Not login')
})
I use this
GuildMemberManager#add()
Adds a user to the guild using OAuth2. Requires the CREATE_INSTANT_INVITE permission.
so I can see the access token
TypeError: Cannot read properties of null (reading 'id')
at InteractionCollector._handleMessageDeletion (/home/clauz/snake/main/node_modules/discord.js/src/structu>
at Client.emit (node:events:539:35)
at MessageDeleteAction.handle (/home/clauz/snake/main/node_modules/discord.js/src/client/actions/MessageDe>
at Object.module.exports [as MESSAGE_DELETE] (/home/clauz/snake/main/node_modules/discord.js/src/client/we>
at WebSocketManager.handlePacket (/home/clauz/snake/main/node_modules/discord.js/src/client/websocket/WebS>
at WebSocketShard.onPacket (/home/clauz/snake/main/node_modules/discord.js/src/client/websocket/WebSocketS>
at WebSocketShard.onMessage (/home/clauz/snake/main/node_modules/discord.js/src/client/websocket/WebSocket>
at WebSocket.onMessage (/home/clauz/snake/main/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (node:events:527:28)
at Receiver.receiverOnMessage (/home/clauz/snake/main/node_modules/ws/lib/websocket.js:1137:20)
this error is hardcrashing me and happens casually when i delete a message, what is this?
Probably an undefined message, it can't read the property id
i get this error too, but for trying to update a message via .update() with a selectmenuinteraction
mm but how could it be, im deleting the message sent from messageCreate event which defintely isnt null, and also this happens only when an interaction collector is active
You need to provide the code, I can't guess
Known issue, is being addressed
this is fixed in 14.0.0-dev.1650240532-9ef7ffd ?
Hi
I'm trying to set up my Slash Command in such a way that you can only use it if you have admin rights. However, I would also like to do that because I can always use the command, even if I have no admin perms on the server
if(!interaction.memberPermissions.has('Administrator') || interaction.member.id !== '863453422632173568')
I would also have tried it like this
if(!interaction.memberPermissions.has('Administrator') || !interaction.member.id == '863453422632173568')
if(!interaction.memberPermissions.has('Administrator') || !interaction.member.id === '863453422632173568')
but this dont works
Exactly, on the grounds that I'm the developer
not possible <> probably a bad idea
those two things are very, very different
the logic is off here, try to read it to yourself and you should see what's off
first code block: if member doesn't have administrator or the id is not x
second code block (both): if member doesn't have administrator or not the id (false) is equal to x (string)
ok, thx
point still stands, though
depending on what that command does maybe you having an override for it in any place is a tremendously bad idea (maybe even abuse of privilege)
🙂 why do i get these error
update Node.js to 16.9.0 or higher
ok
That kinda seems like you're not on v14?
I'm not sure
use MessageCollectorOptionsParams<ComponentType.Button> instead
how do i set permission on v14?
example?
i am too lazy can u give the direct link of it ?? 😜
Suggestion for @nova sonnet:
Interactions: Slash command permissions
read more
thnks
why my slash commands are not getting registered?
i just made a command it didnt got registered
did you run the deploying code
yes
module.exports ={
name: "timeout",
description: "Timeout A Member",
options: [
{
name: "user",
description: "Select The User To Give Timeout",
type: "user",
required: "true"
},
{
name: "reason",
description: "A Specific Reason For Timeout",
type: "STRING",
required: "flase"
},
{
name: "time",
description: "A Specific Time For Timeout",
type: "user",
required: "true"
},
],
run: async (client, interaction, args) => {
const user = interaction.options.getUser('user')
const reason = interaction.options.getString('resaon') || null
const time = ms(interaction.options.getString('time'))
if(!time) return interaction.followUp({ content: "Time Is Not Valid Try Again!"})
const response = await user.timeout(time, reason)
if(!response) return interaction.followUp({ content:`${user} has been timeout for ${ms(time, { long: true})}`})
}
}``` here is my code
@copper jetty
required is a boolean, not a string
where
ur options
also you misspelled false
oh yes
and you misspelled reason when getting the string option as well
and you can't timeout users btw
and you need to use the ApplicationCommandOptionType enum
btw /timeout is default discord command so you could just delete it
Hey guys, I don't know if this is a djs problem, but when im trying to get message content it returns nothing
code that i used:
console.log(msg)
})```
returned message:
```<ref *1> Message {
channelId: '-deleted-',
guildId: '-deleted-',
id: '965580514914357258',
createdTimestamp: 1650282734374,
type: 0,
system: false,
content: '',
author: User {
id: '-deleted-',
bot: false,
system: false,
flags: UserFlagsBitField { bitfield: 256 },
username: '-deleted-',
discriminator: '-deleted-',
avatar: '-deleted-',
banner: undefined,
accentColor: undefined
},
pinned: false,
tts: false,
nonce: '-deleted-',
embeds: [],
components: [],
attachments: Collection(0) [Map] {},
stickers: Collection(0) [Map] {},
editedTimestamp: null,
reactions: ReactionManager { message: [Circular *1] },
mentions: MessageMentions {
everyone: false,
users: Collection(0) [Map] {},
roles: Collection(0) [Map] {},
_members: null,
_channels: null,
crosspostedChannels: Collection(0) [Map] {},
repliedUser: null
},
webhookId: null,
groupActivityApplication: null,
applicationId: null,
activity: null,
flags: MessageFlagsBitField { bitfield: 0 },
reference: null,
interaction: null
}```
It seems like unintended behavior
oh thx
it's usable for me, update to latest dev version
i think its only bugged in typescript
what
is isCommand() and ChatInput same?
whats the difference between ChatInput and Command?
CommandInteractions are the base for ChatInput (slash) and context menu commands
v13 CommandIntearction is the v14 ChatInputCommandInteraction
okay thanks
message cmd not working in djs v14 dev
bot can't read message content i enabled message intent but still
you need the MessageContent intent in your client constructor as well
const client = new Client({
messageCacheLifetime: 60,
fetchAllMembers: false,
messageCacheMaxSize: 10,
restTimeOffset: 0,
restWsBridgetimeout: 100,
shards: "auto",
allowedMentions: {
parse: ["roles", "users", "everyone"],
repliedUser: false,
},
partials: [
Partials.Message,
Partials.Channel,
Partials.GuildMember,
Partials.Reaction,
Partials.GuildScheduledEvent,
Partials.User,
Partials.ThreadMember,
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
],
});````
this is fine ?
MessageContent
you don't have this intent
v14 uses api v10
discord don't provide in non verified bots ?
you can enable the intent for non-verified bots, you just have to also add it to your intents array
how i ?
I updated my BOT to the dev version and I modified the Intents and Partials, but my BOT doesn't work (event undetected). Have I anything else to do ?
doesn't work is not enough information to help you
GatewayIntentBits.MessageContent, the same way you added the others. also don't add all intents, you most certainly don't need them
No error but the BOT don't react to anything
to what should it react?
Commands, events,.....
My BOT works perfectly in v13
what kind of commands? is it turning online?
Yep, it is turning online
For example !help or !ping command
so you mean message commands? read the conversation above, you need the MessageContent intent
so this function is in the types now, but it still doesn't work as intended:
StartThreadOptions.autoArchiveDuration expects a value of the ThreadAutoArchiveDuration enum but Util.resolveAutoArchiveMaxLimit returns a number.
let embed = new require("@discordjs/builders").EmbedBuilder
TypeError: (intermediate value).EmbedBuilder.setThumbnail is not a function help pls?
from what I can see in the docs StartThreadOptions.autoArchiveDuration accepts https://discord.js.org/#/docs/discord.js/main/typedef/ThreadAutoArchiveDuration
@outer bane u able to help me?
you need () after the constructor. also no need to import from /builders, d.js re-exports everything now
would you mind giving me an example please 🙏
what is below that line in your code?
.setThumbnail(bot.user.displayAvatarURL())
just installed the latest version, I guess that was changed very recently; it accepts specific numeric values instead of enum values now. still doesn't change anything, as there is no 'MAX' option (as opposed to the docs) and Util.resolveAutoArchiveMaxLimit still returns numbers (which isn't assignable to specific numeric values).
from what I can see in the source code you shouldn't have to call the util method, it gets called internally when you pass 'MAX'. the latter not being in certain typing interfaces seems like a bug though
alright, I guess I'll just use @ts-expect-error and 'MAX' for now.
Util.resolveAutoArchiveMaxLimit should still return 60 | 1440 | 4320 | 10080 instead of number though from what I can tell.
StartThreadOptions and ThreadEditData need | 'MAX'
typings for resolveAutoArchiveMaxLimit can also be made more strict, sure
^ cc @uncut kelp since you made the changes and I don't work with threads
@outer bane new require("discord.js").EmbedBuilder() returns Received one or more errors ;/
a shapeshift error? can you show the full error?
can you catch and console.log it? should show a bit more useful information
If you can, can you make an issue about it? I'm a bit busy right now >_<
sure, the main repo?
yes
Yes!
anyone?
this was working a few days ago and i updated today
and im getting all these errors
what's the code generating these errors?
im 99% sure
the constructor alone wouldn't throw it
99.5% sure
well it's erroring as soon as i restart the bot
and embeds load on restart of the bot
then what is below the constructor, which methods do you call on the instance?
at EmbedBuilder.setColor (/root/bots/palm-creations/node_modules/discord.js/src/structures/EmbedBuilder.js:22:18)
i see this in the error?
bot.builder = require("discord.js");
let embed = new bot.builder.EmbedBuilder()
.setThumbnail(bot.user.displayAvatarURL())
.setFooter({ text: "Updates every 30 seconds | Last updated:" })
.setTimestamp()
what is at updateLeaderboard line 86?
.setColor(embed.color)
and what is embed.color?
let me print it
changed to .setColor(require("discord.js").Util.resolveColor(process.env["themeColor"]))
same error
and what is process.env["themeColor"]?
75b424
OH WAIT
hold on im sorry
ok that error has gone now, that was mb
now im getting embed.addField is not a function
addFields
oh..
how would something like this look with addFields?
exactly the same but with an "s"
alr
YESS it's all fixed, tysm bro
I am unable to install the dev package, this is what I face while installing:
code ERESOLVE
ERESOLVE could not resolve
While resolving: distube@3.1.0
Found: discord.js@14.0.0-dev.1650240532-9ef7ffd
You're using a third party package which has a discordjs version that has conflicts with your version installed at root, nothing related to disord.js we can help with really
any idea why the interactions values are not logging?
why is the client.on part also in eval.js?
i make separate emitters for the ones i really think that i need it for formating the code better
well, right now you are attaching a listener each time the command is being run, and the first time probably doesn't have any listener yet
i didn't get it? so what am i supposed to do here? attach it with the first interaction emitter?
if you want to use the client event move the listener outside of the code you execute each time the command is being run. alternatively you can use a collector
i see alright thanks
TypeError: interaction.isModalSubmit is not a function
thats painful
make sure you are on the latest dev release
^14.0.0-dev.1645661258.8203c5d
thats the current version
pretty sure it's not
should i try re-installing or smth?
that version is 2 months old according to npm
let me update it then
@outer bane thank you very much it works now :)
So there is no solution you could suggest me it?
uninstall distube
still the same
with the same message error?
yes
whats new in v14
✨ pins ✨
npm ls distube and show the output
found it
forgot that it has another 2 packages related
rip now I can't run my music
TypeError: Cannot destructure property 'emoji' of 'undefined' as it is undefined.
the line where the error occurs = const boton = new Discord.ButtonBuilder()
👌
update, that bug has been fixed
thanks
!
Do you know why the documentation does not load? 
see #archive-site-discussion, there's an alternative domain
what am I doing wrong?
how many text inputs fit in one modal?
pass MessageActionRowComponentBuilder as the first generic parameter in ActionRowBuilder
5
thanks
thanks 😉
This error crashed the library. Any clue? js TypeError: Cannot read properties of null (reading 'id') at InteractionCollector._handleMessageDeletion (/root/Mael/node_modules/discord.js/src/structures/InteractionCollector.js:214:29) at Client.emit (node:events:402:35) at MessageDeleteAction.handle (/root/Mael/node_modules/discord.js/src/client/actions/MessageDelete.js:22:16) at Object.module.exports [as MESSAGE_DELETE] (/root/Mael/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_DELETE.js:4:32) at WebSocketManager.handlePacket (/root/Mael/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31) at WebSocketShard.onPacket (/root/Mael/node_modules/discord.js/src/client/websocket/WebSocketShard.js:447:22) at WebSocketShard.onMessage (/root/Mael/node_modules/discord.js/src/client/websocket/WebSocketShard.js:304:10) at WebSocket.onMessage (/root/Mael/node_modules/ws/lib/event-target.js:199:18) at WebSocket.emit (node:events:390:28) at Receiver.receiverOnMessage (/root/Mael/node_modules/ws/lib/websocket.js:1137:20)
Running on this version
Code
let rock = '🪨'
let paper = '📰'
let scissor = '✂️'
await interaction.editReply({
content: 'message',
components: [
{
type: djs$ComponentType.ActionRow,
components: [
{
type: djs$ComponentType.Button,
style: djs$ButtonStyle.Primary,
emoji: rock,
customId: rock
}
]
}
]
})
Error
DiscordAPIError[50035]: Invalid Form Body
components[0].components[0].emoji[MODEL_TYPE_CONVERT]: Only dictionaries may be used in a ModelType
Version: "discord.js": "^14.0.0-dev.1650240532-9ef7ffd" (In v13 this error not hapends)
Emoji has to be an object
{ name: "unicode emoji" }
ok, ty
Or { name: "custom name", id: "…" } for guild emojis
is modals addeed yet
yws
oh
https://www.toptal.com/developers/hastebin/yineniyuye.typescript
Someone knows why my code gives me ```console
Interaction has already been acknowledged.
you cant show modal after replying
hm
ty, i fixed the code
Bumping xD
it's a known internal bug caused by component interactions from messages which were not interaction replies
Someone knows why this error shows to me after the bot leaves a server where it has permissions to the audit logs
after the bot leaves a server
Because it left?
But the error is that it shouldn't show because it is an event from guildMemberUpdate.ts for example if someone changes his nickname
And when leaving the server, no one changes nickname for bot
well it might fire the event anyway
and it is possible to block the event to trigger only when someone changes the bot nickname and not when bot only leave the server?
You can check for the type of change using if
hmmm okey thanks
Thanks
does ActionRow allow .addComponents()? if not, how do i add components?
you need an ActionRowBuilder, ActionRow is the received component which is read-only
and is ButtonComponent now ButtonComponentBuilder()?
ButtonBuilder
tyy
how can I after confirmation send an 'ok', without saying that there was an error?
interaction.reply("Okay")
oh :o
thx
setNameLocalizations at slash commands are working?
as far as I know yes
Its still an experimental feature in the Discord Client though
I set it but the name for me keeps the main name.
Its still an experimental feature in the Discord Client though
uh
so what i need to make it work
for me atleast
can i make like a slash command which only specific person can see and use like normal users can't even see the command ?
no, only greyed out
and will reject if they manually type it
Anyone can help me with this?
data is not a builder
pass ButtonBuilder in the generic
Oh, i'm so stupid
Thanks
i get this error whenever a message with an interaction collector gets deleted
My bot doesnt trigger any events after i start it in the terminal does anyone know the reasons for why a bot wont trigger events
I dont get any errors
missing intents probably
or something wrong with you creating listeners
const { Client, Collection, IntentsBitField, Partials } = require('discord.js');
const Util = require('./Util.js');
module.exports = class SkyR6M extends Client {
constructor(options = {}) {
super({
partials: [Partials.Message, Partials.Reaction],
presence: {
status: 'idle',
activities: [
{ name: 'Sky', type: 'WATCHING' }
]
},
intents: [IntentsBitField.Flags.Guilds, IntentsBitField.Flags.GuildMembers, IntentsBitField.Flags.GuildMessages, IntentsBitField.Flags.GuildVoiceStates]
});
this.validate(options);
this.commands = new Collection();
this.events = new Collection();
this.utils = new Util(this);
this.mongoose = require('./mongoose.js');
};
validate(options) {
if (typeof options !== 'object') throw new TypeError('Options should be a type of Object.');
if (!options.TOKEN) throw new Error('You must pass the token for the bot.');
this.token = options.TOKEN;
};
async start(token = this.token) {
this.utils.loadCommands();
this.utils.loadEvents();
this.mongoose.init();
super.login(token);
};
};
Is this the right way to add Intents?
the bot gets online when i run node . but i cant trigger the ready event for some reason
then you got a problem with creating listeners
okay
In v14 it looks like this not work
if(message.author.bot) return;
Can anyone tell me why? Or what do I have to change?
Nope that hasn't changed
Will be fixed in a PR soon, #7812
Hmm, ok but how doesn't my bot return if the message is from another bot? 🤔
client.on("messageCreate", async (message) => {
if(message.author.bot) return;
})
No idea, looks fine to me
Is that the whole listener? You're not doing anything with the message after the if statement
will .isRepliable() return false if the interaction is deferred?
or it will only return false if the interaction is replied or editReplied
it will only return false for interactions that don't have a reply, deferReply, ... method, it doesn't depend on the replied state of the interaction
ohhh i see
the name is a bit misleading and it might be removed all together
okay, got it thanks
No, there is much more, over 300 more lines, but that is to much to post it here
And how do you know that is not ignoring bots
I tested it and another one who tested my bot independently of me also says that
Going to need to see a bit more of the continuing code I think
Not if it really does close again on the next line lol
if i try to fetch a member from a guild like this
const member = await interaction.guild.members.fetch('id');
will it result in error if the member isnt in the guild or will it return null
an error
the Promise will be rejected
okay
is it possible to bypass a permission of a role to a command by allowing an user to access the command?
[
{ id: '965522235467116544', type: ApplicationCommandPermissionType.Role, permission: false },
...Owners.map(({ id }) => ({ id, type: ApplicationCommandPermissionType.User, permission: true }))
]
so basically a role is denied from accessing the command but a user having the same role is allowed to access it
will it work?
try it, I think it should
when will discord.js v14 release
When it's ready
is that soon or not
When it's ready
hey, seems that I have some issues with modals, which didn't come out before updating. any Ideas? (or some clues that I can figure out what's wrong)
the ModalBuilder does not support using raw action rows with builder components in it. either pass pure objects or ActionRow instances. that said, why do you even use the constructor? builders are meant to be used via their methods
probably the camel case to snake case converter
I would have been to prefer constructor since I found out it more easier to read the content, that’s some my old habit from v13. Enough chatting, I will make ActionRow instances, thanks for the help 🙏
why do you even use the builder? you don't have to, you can use raw objects too
class ModalBuilder extends BuildersModal {
constructor({ components, ...data } = {}) {
super({
...Transformers.toSnakeCase(data),
components: components?.map(c => (c instanceof ComponentBuilder ? c : Transformers.toSnakeCase(c))),
});
}
it's this part only checking for components
Thats because, camel cases, the one said earlier read my mind
djs will call the jsontransformer internally for raw objects
Does that mean that it will convert camel cases to snake cases?
yes
Oh, alright. Good to know. Thanks again !
I just found out that Util.splitMessage is no longer available in v14, is there an alternative?
no, you have to implement that yourself. you can just copy/paste the old removed code, though it had issues with regex splits
👌 alright
hey, i'm trying to create something here that will link in the GuildCreate event to the server where the bot was added, but i'm getting stuck at one point
${guild.invites.create()} I don't know how to fill the brackets when creating
Error: Argument of type 'TextInputBuilder' is not assignable to parameter of type 'Partial<ActionRowData<ActionRowComponentData | ActionRowComponentBuilder> | APIActionRowComponent<APITextInputComponent | APIMessageActionRowComponent>> | undefined'.
Code: ```js
import { ActionRowBuilder, ModalActionRowComponentBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } from 'discord.js';
const feedbackModal = new ModalBuilder()
.setTitle('Feedback')
.setCustomId('feedbackModal')
.addComponents(
new ActionRowBuilder<ModalActionRowComponentBuilder>(
new TextInputBuilder()
.setCustomId('feedbackInput')
.setLabel('...')
.setMinLength(50)
.setStyle(TextInputStyle.Paragraph)
)
);```
Build: 14.0.0-dev.1650240532-9ef7ffd
use addComponents on the actionrow, don't pass it in the constructor
oh wow how did i not see that
thank you
Why this is not working? Did I forget to change something? It was working on v13
const guild = client.guilds.cache.get(guildId);
guild.commands.set(commandsData);
var permissions = [{
type: ApplicationCommandPermissionType.User,
id: myId,
permission: true
}];
await guild.commands.cache.map(command => {
command.permissions.set({
permissions
});
});
I won't get permissions for commands with defaultPermission = false
the cache won't be populated unless manually fetched. that said, you can set all those permissions with one api call, by providing fullPermissions to <Guild>.commands.permissions.set. to get the command ids use the return value from <Guild>.commands.set
console.log(roleId, Roles.RegisteredId);
await member.roles.add([Roles.RegisterId, roleId]);
the Ids arent undefined
whats going wrong here?
Oh wait I skipped that and didn't know, thanks!
why are they the same IDs?
ill fix that later
but why does it show undefined
I tried to console.log() roles received by the add method and the same roles in my own code
this is what im getting in my console
okay nvm
I didnt see the typo
💀
why would this not work?
options*
it should be an array of object
and you wrote options: [name: 'test1']
now that's invalid syntax
i mean
i didnt tell you that's correct 
iknow
but is it something with my handler?
no, it's with your syntax
no
simply add braces
[{ name: 'test1' }]
yeah well how are you registering?
yea not, thats why i asked is there something wrong with my handler?
huh? i asked to see how you were registering the command
and you didn't show a handler
also confirm your discord.js version first, npm ls discord.js
pretty sure you would get an error trying to register that option since its type is not a number
setComponents takes a rest parameter
doesn't need to be a number
well i can do number there
pretty sure d.js doesn't resolve strings anymore internally, you have to use the enum
remove the []
people told me to
Hi, I am trying to make a event that will send an embed in a server and to the owner of the server when it is added to that server.
Here is my guildCreate.js file => https://srcshare.io/?id=625ee5db5f04b85b24f2253f
Here is my index.js file => https://srcshare.io/?id=625ee5f75f04b89c95f22540
Here is the error => https://srcshare.io/?id=625ee6305f04b8d890f22541
What I am assuming the issue is is that it is not passing through guild properly (Or it doesn't have access to that). However I am unsure on how to fix this error myself. Any help is appreciated
(This was copied over from the Worn Off Keys discord server as I was told to come here)
how would i fix it now?
since i always used it between []?
remove the []
done
what now?
should be fixed ._.
no
everyone uses it with []?
is there something wrong with my handler then for not specifing options?
dk how application command options are related to action row components...
this message was directed at genericNight, not you
oh wait
2 people loll I didn't notice
?
sorry for asking but would you know the answer to my problem? 😬
can't say anything else without seeing the part of your code which registers the command(s)
this right?
look at line \d*4
you don't add options to the commands you register
iconURL is a method
I need to call it ()?
yep
so i need to remove push?
then you wouldn't register any commands anymore
Thanks
no prob
how would i add options then?
the same way you added name, description and type
yes so as i already thought
but it will be then
options: slashCommands.options?
seems correct
wait that's not the part where you deploy the commands
you are just adding them to a collection there
wait
huh i do?
where in your code do you have either <REST>.put, <Client>.application.commands.set or <Guild>.commands.set
its at the bottom
you cropped it out
yea i know
show that part
i didnt here 😉
:|
client.slashCommands is a custom collection, there's no deploying happening
(at least I hope there isn't)
the deploying is at the bottom, and thats what nameless asked for, why would you remove it from the screenshot
so i would need to use just slashCommands.set?
ok, one last time. please show the part with rest.put
i thought you said OR so i searched on <Guild>.commands.put
yes, "or", but you don't have the other versions, only the first one
that's not the issue
it's a typo in the push
remove the "s" from ...s.options
at the push right?
yes
did the console.log below the put part show?
do you have a guild id env var set?
well it works now
but the thing is, when i save for example the options type
it doesnt update inside discord
do you have a guild id env var set?
jup
but the thing is, when i save for example the options type
it doesnt update inside discord
you know why this happends?
did the console.log below the put part show?
can you log the (resolved) return value from rest.put?
(resolved)
that is not the return value from said function
this? i am sorry i just dont understand it
yes, this is correct
great
there is no "ping" command though
changed it to generate
can you log the options array from the command?
doesnt log anything?
only the one of undefined logs undefined
it's an array of objects though according to your screenshot which should show up when logging
you misspelled it
excuse
Hey, for some reason the messageUpdate event wont fire after a msg edit, is there something new in v14 or am i missing something?
using the GuildMessages intent.
- is there an way to limit the number input to max 10?
max_value
try adding the MessageContent one
already did :/
These are my intents:
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessageReactions
]```
try adding the Message partial
worked, thanks!
no prob
is min_value a thing?
yes
how would i use message.author.send in a slashcommand?
like idk how i would send a message to the author since you cant use message in slash
you don't get a message, so yeah, that won't do
but the interaction has a .user and .member accessor, which is the user/member executing the command
which one do you prefer?
How do I send emoji in a button?
there is a .setEmoji method on button builders
afaik, they take in an object with a name, id and animated property
Mind providing an example? For some reason it is not accepting string.
because as i said it doesn't take a string, it takes an object
for custom emojis setEmoji({"id": "id"}), twemojis setEmoji({"name": "🙂"})
Oh cool
Hey, im trying to make a voice channel with the bot, and got a few questions.
since i cant use type: voice, how i can make the channel a voice channel?
and what can i do instead of using permissionOverwrites? ```permissionOverwrites: [
{
id: userr.id,
allow: ['MANAGE_CHANNELS', 'CONNECT', 'MANAGE_ROLES'],
},
{
deny: ['CONNECT', 'VIEW_CHANNEL'],
id: newMember.guild.id,
},
{
allow: 'VIEW_CHANNEL',
id: '779498352210477076',
}
],```, i mean, what else can be used in order to change the room permissions?
thanks.
Value "GUILD_VOICE" is not int.
xD
for the channel type use the ChannelType enum from discord-api-types, so ChannelType.GuildVoice
thanks!
and for permissions, use PermissionFlagsBits
if a guild is unavailable, will it still be cached? (just with id and name) or will i have no trace of it at all
Guild#available
Whether the guild is available to access. If it is not available, it indicates a server outage
it should be cached and the property above should be false
ah sick, thanks
will v14 include the new permission system?
isnt only the client being updated for permissions v2
how do i check if the user id who is executing the command his id is in a json? so not deny access
i forgot how it would work
@woeful pollen no, the APIs will change too
@narrow lagoon if the permissions system is released before v14, then yes
Perfect
good to know
the warning comes from the source code of d.js
mine?
source code of d.js
no i thought of my picture, you could talk about someone else
but did i find a bug or?...
it isn’t really a bug, it’s just a warning
and I believe they are aware of it
how would i fix it?
not right?
you can’t
a nodejs warning, woo
For some reason my code exits/hangs. It runs in an environment which gets rate limited very often(shared hosting). Someone has faced this before?
Many have
You can blame the person that got the node/machine ip banned
Why does it exit though?
djs handles ratelimits right?
Ur not allowed to login if it's ip banned
It hangs in between
It exits on start so I get that
Slow connection then?
Idts
It works fine when I redeploy
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.
client
.on("debug", console.log)
.on("warn", console.log)
• Note: if you initialize your Client as bot or other identifiers you need to use these instead of client
• If the output is too long to post consider using a bin instead: gist | hasteb.in | sourceb.in | hastebin
Okay cool
Thank you
If you hit rate limit (429) on /gateway/bot, then it means someone got the machine ip banned
Bot comes online but it just hangs
Doesn't reply to any commands (slash/message)
Is it receiving the event on time?
Not logging that will setup logs rn.
TypeError: Cannot read properties of undefined (reading 'interactions')
has this been removed?
What is that?
I don't think anything called interactions ever existed, though the error says of undefined so its the class you're trying to access it on thats missing
client.api.interactions
yes, dev uses @discordjs/rest instead of the client.api proxy stuff
Probably not, haven't setup logs yet but -
Bot starts - works fine for a while - then it randomly hangs - after a while it spams all responses
Prob got rate limited on a request, causing d.js to hold up all requests
Is that a bug with djs?
No, that’s the intended behavior
All requests are handled sequentially
Right, well yes client.api became client.rest but we've never supported direct access anyway
ohh thanks ❤️
TypeError: Cannot read properties of null (reading 'id')
at InteractionCollector._handleMessageDeletion (/root/Caprice/node_modules/discord.js/src/structures/InteractionCollector.js:214:29)
at Client.emit (node:events:402:35)
at MessageDeleteAction.handle (/root/Caprice/node_modules/discord.js/src/client/actions/MessageDelete.js:22:16)
at Object.module.exports [as MESSAGE_DELETE] (/root/Caprice/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_DELETE.js:4:32)
at WebSocketManager.handlePacket (/root/Caprice/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketShard.onPacket (/root/Caprice/node_modules/discord.js/src/client/websocket/WebSocketShard.js:447:22)
at WebSocketShard.onMessage (/root/Caprice/node_modules/discord.js/src/client/websocket/WebSocketShard.js:304:10)
at WebSocket.onMessage (/root/Caprice/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (node:events:390:28)
at Receiver.receiverOnMessage (/root/Caprice/node_modules/ws/lib/websocket.js:1137:20)```
This still crashed the library. Someone told me that it would be fixed in <https://github.com/discordjs/discord.js/pull/7812> but it's not the case and not the same thing at all
From what i can see, it comes from an interactioncollector Where in js if (message.interaction.id === this.messageInteractionId) { this.stop('messageDelete'); }
message.interaction is null
Is there a Pr about this issue?
doesnt that pr address that issue?
Someone refered me to that pr but i think it's not related to the issue. It's the same result but not the same issue
And it is a major issue as it crashes the library
Yes, #7812
Its the same issue
Its now been merged
A new dev release was published 11 minutes ago which should include it, please update
Thanks!!!
why will this happens?
[antiCrash] :: Unhandled Rejection/Catch
TypeError: Cannot read properties of null (reading 'id')
at ButtonInteraction.deferUpdate (/home/runner/ka-dev/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:200:108) Promise {
<rejected> TypeError: Cannot read properties of null (reading 'id')
at ButtonInteraction.deferUpdate (/home/runner/ka-dev/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:200:108)
}
code:
update to latest, bug was fixed
I don't know why, but I get this error when trying to set an application command option type
I'm using TypeScript and djs version 14.0.0-dev.1650413390-585169f
iirc that’s supposed to be ApplicationCommandData ApplicationCommand is a class
Oh ok
Thanks mate
New weird error with the latest version of dev js Error: Received one or more errors at UnionValidator.handle (/root/Caprice/node_modules/@sapphire/shapeshift/dist/index.js:1471:23) at UnionValidator.parse (/root/Caprice/node_modules/@sapphire/shapeshift/dist/index.js:114:88) at EmbedBuilder.setDescription (/root/Caprice/node_modules/discord.js/node_modules/@discordjs/builders/dist/index.js:261:54) at /root/Caprice/dist/src/imports/messages.js:3871:14 at Generator.next (<anonymous>) at /root/Caprice/dist/src/imports/messages.js:8:71 at new Promise (<anonymous>) at __awaiter (/root/Caprice/dist/src/imports/messages.js:4:12) at ghostPingsEmbed (/root/Caprice/dist/src/imports/messages.js:3863:12) at /root/Caprice/dist/src/imports/ghost-pings.js:28:108
Error came from an EmbedBuilder.setDescription
if try to do member.roles.set([]) to an premiumSubscriber will result in an error? https://discord.js.org/#/docs/discord.js/main/class/GuildMemberRoleManager?scrollTo=set
since the nitro booster role is manageable
I think if you attempt to remove managed roles yes
okay
can i filter the managed role then use .set()?
member.roles.cache.filter((r) => !r.managed).set([])?
or since its a cache it doesnt provide set method
uhhh
Yes but not like that
member.roles.set(member.roles.cache.filter(r => !r.managed))
ah
You want to set it to only managed roles I assume
i just want to remove all existing roles from an user if the user has a certain role but since i cant remove managed roles im trying to filter them out
yeah it would be that then
okay great, thanks
Actually, other way around
filter keeps the things that pass
So member.roles.set(member.roles.cache.filter(r => r.managed))
So you're setting it to managed roles and removing everything else
yeah right
thanks
why it is not loading slash event etc ?
recheck your command handler
its correct
then it should work?
djs has nothing to do with handling commands
idk it is not working
@nocturne kayak should i send u the message create code?
uhhh, why would we want message create code
Thats not a slash command
Your handler either isnt finding or isnt counting the files
is there any downside to using UnsafeBuilders?
no validation
For some this is a upside
Not only that but you won't be able use camelCase keys in constructor, no emoji string, color string, all the features which where added in djs by extending the safe builders
if there's Interaction#awaitModalSubmit() there will be a thing like Interaction#createModalSubmitCollector() too?
I mean, you can click a button more than once but a modal once is sent it's gone so I don't see really a use case
how would i change here that my bot isn't used it will go to idle?
why are you setting activity every 5 seconds?
and what exactly is the use you get out of this procedure?
every 2,5 minutes*
idk i found this code in my old files just ignore it
no, 5000 ms is 5 seconds
it doesnt do anything every 5 secs
yes it does
more like every 1 -2,5 minutes
i can show you it doesnt do it every 5 seconds
probably got ratelimited
oh
thats my game
which is all presence updates
^^
i just wanna do in here if my bot is idle (not used for a specific time) then he goes idle, and so not he goes back to online
that's still gonna update the presence 🤔
Doesn't look like you even ever clear the interval
idc about precenese
when my bot isn't used by commands for eg by users within 2 minutes idk, then he goed idle, when he is being used again go to online
well u should
it is only the precense i am playing, i can make it slower if you want too
what you are trying to do is presences tho
i don't think you understand why this cannot work
i am asking if it is possible, and if so how would i do it (referance to a doc for example)
you are already using the methods, what would docs use?
your intervals that both persistently set status/activity (both subset of presences) overlap
you'd need to save the state (should the next update be online/dnd/idle + which activity) and set them all together on a large enough interval via #setPresence
vs. setting them separately in overlapping intervals
the only thing i can get out of there is saving the state and thats it?
now it is doing that every 5 seconds which is not checking whether the bot isnt used or it is
Souji is saying you should combine your setActivity and setStatus updates into setPresence to avoid rate limiting
There you can set both at once
I still wouldn't advise setting it every 5 seconds, that could be seen as API spam
nah, that's another thing you need to do
for example by saving the timestamp whenever the bot is used and determining the status based on the difference to the current timestamp when updating the presence again
i know it was just for testing
makes for a pretty bad test, because that'll cause it to not work
how would i be able to check then whether a slashCommand (all of my commands) are runned so not check if for example 5 seconds have been passed then do something
cause i can't find anywhere where i could maybe get some info from
listen to interactionCreate event
is SelectMenuBuilder not supported in v14 yet?
const UserEmbedComponents = new ActionRowBuilder()
.addComponents(
new SelectMenuBuilder()
.setCustomId('ViewUser')
.setMaxValues(1)
.addOptions([
{
label: 'Overview',
value: 'overview'
},
{
label: 'Roles',
value: 'roles'
},
{
label: 'Avatar',
value: 'avatar'
},
{
label: 'Banner',
value: 'banner'
}
])
);
it says you didn't pass a value and a label, which are required
i did i think..
oh the addOptions, try not passing an array
...[] will work?
yep
okay thanks
DiscordAPIError[50035]: Invalid Form Body
data.embeds[0].color[NUMBER_TYPE_COERCE]: Value "Aqua" is not int.```
is String not supported in v14?
it should be if you are on the latest dev and use the re-exported builder from d.js, not /builders
im not using any builder
then it's not supported
okay
you can use the Colors enum (I think that's the name, should be a top level export)
okay thank you
How to set a default selectmenu when sending an embed? like whenever I use the command i want it to automatically select an option so that the user cant select it again
nvm got it
are the UserFlag names not the same as the API?
No they’re PascalCase
Okay thanks
is this supported in discord.js v14
only oauth2
okay
is there any ComponentType Enum?
there is
you can import it from discord.js
@tame gazelle whats the name for it?
I cant import it
ComponentType
okay nvm I can now
do I need to fetch members to get their bannerURL in v14?
pretty sure yes
okay
Hey, I need help, I want to make a list of all role IDs of a user
I know how to make a list of role names but not IDs
const roidli = interaction.member.roles.id.cache.toJSON()
console.log(`${roidli}`)
interaction.reply({content: `${roidli}`})
But how can I make a list with the IDs
interaction.member.roles.cache.map(role => role.id)
thanks
Is there a way to edit a response in v14
editReply
thanks lol
Idk why I even asked that that was pretty dumb
and it is the same as v13 also
yeah
is spliceOptions removed from SelectMenuBuilder in v14?
How can I listen for button clicks in v14? Is it the same way for v13?
How do I exactly use this mutate a SelectMenu?
also I want to know if spliceOptions has been removed in v14 or not since I want remove an option from SelectMenu options
you can do new SelectMenuBuilder(SelectMenuComponent.toJSON())
okay
Expected a string primitive
what error is this? i receive when trying to reply()
nvm
is group dm, but bots cant be added to group dms
yeah but the bots cant be in the gc by themselves can they?:
Hey guys.
I'm trying to understand something that I'm potentially missing. I'm currently using the dev version (14.0.0-dev.1650240532-9ef7ffd), and using a button to show a modal. I can get the modal interaction and the data from it, but I don't understand why the interaction is called multiple times whenever I cancel the modal then submit it.
Here's all the steps I'm doing for that :
1. Send a message with a webhook with a button
2. Create a collector for that message
3. Once a button is clicked, show a modal
4. Click X times outside the modal (or cancel X times)
5. Submit the modal
X is the number of times the modal interaction is called.
I hope someone can tell me what I'm doing wrong, because I'm out of solutions so far.
cant reproduce this
you must be doing something wrong
can I see ur code?
yup only calls it once
even tho i used an autoclicker for the cancel button
Sure :
messageÉtatPartie = await webhook.send(
{
// Contenu
embeds : arrayMessageEmbed,
// Composants
components : arrayMessageComponents,
// Paramètres
username : plancheAvatar.nom,
avatarURL : plancheAvatar.avatar,
threadId : threadID
});
let collectorÉtatPartie = messageÉtatPartie.createMessageComponentCollector();
collectorÉtatPartie.on("collect", async interactionBouton =>
{
// Variables
let modalOptions =
{
title : "Proposition",
custom_id : "plancheProposition",
components :
[
{
type : 1, // Action Row
components :
[
{
type : 4, // Text Input
style : 1, // Short
label : "Proposer une lettre",
min_length : 1,
max_length : 1,
required : true,
custom_id : "planchePropositionInput",
}
]
}
]
};
// On affiche le modal
await interactionBouton.showModal(modalOptions);
// On récupère les informations du modal envoyées par le joueur
collectorModal = new InteractionCollector(client, { message : messageÉtatPartie, interactionType : 5 });
collectorModal.on("collect", async interactionModal =>
{
await plancheProposition(threadID, interactionBouton, interactionModal, messageÉtatPartie);
});
});```
bots can fetch group dm invites
On messageDelete event I'm getting content property as an empty string
Someone know why it is happening?
Maybe it wasn't cached? (Not sure tho, it should be null in this case) Forgot of message content intent
add MessageContent intent
It is my intent
it doesn’t include the MessageContent one
ih
I'll check here
Can I make this?
try intents: Object.keys(IntentsBitField.Flags)
Maybe this?
try it
Ok, I'll try
It returns an array of strings not numbers
😦
So, I use this?
Please just specify ur intents
They can create group dms, but no one can see it
strings also work
In the dev version?
yes
I use strings in the latest dev
so why do they have it then
This endpoint was intended to be used with the now-deprecated GameBridge SDK
so they can add people to teh dm too but people wont see it?
That’s what the description said
errors: [
[
'emoji',
CombinedError: Received one or more errors```
```js
given: { value: 'tanuki', label: 'Tanuki', emoji: '🍃' },```

emoji must be an object
{ name: "name or unicode emoji", id: "id or none" }
So, any idea what I'm doing wrong?
You create an interaction collector every time the button is pressed
Better off creating it once after the one for the button
So I should create the InteractionCollector for the modals before collecting the one from the buttons?
Welp, it worked, didn't think of that. Thanks for the help 🙂
Thank you! Its the action rows I missed
Im doing exactly like the link but I have this error:
did something change recentyly ?
actuzlly it may be simply type problem lol. lemme try running it
you need to type action row
hoesntly not sure wdym
<TextInputBuilder>
ohhh
ty
Anyone know what did these change to ?
Nothing
What's options?
What's the error on them?
I had forgotten to change isCommand to isChatInputCommand. Changing that fixed it. Thanks for the response 🙂
Since EmbedBuilder#addField() has been removed, how can I deal with situations where I want to conditionally add a single field to an embed?
.addFields({ name:'some name', value:'some value', inline:true })
That doesn't override previous addFields() calls in the same script?
use variables
Sometimes when I use more than one field, I use something like this:
const fields = []
fields.push({name: 'abc', value: 'def', inline:true})
// others pushes
embed.addFields(...fields)
Ah, I see. I didn't consider that approach. That works.
But just so I'm clear, is this the case or not?
I didn't test it
OK.
addFields does not override, setFields does
Thanks, that makes sense. That's great. Then I can call addFields again without issue.
afaik there's not way to showModal after deferReply()?
correct, it has to be an initial response
okay, thanks
So I see the docs for guild.maximumPresences say it's null for all but the largest of guilds. How large, and does anyone know why they changed this?
how do I use SelectMenuBuilder.from()
let UserEmbedComponents = new ActionRowBuilder()
.addComponents(
new SelectMenuBuilder()
.setCustomId('ViewUser')
.setMaxValues(1)
.addOptions(
{
label: 'Overview',
value: 'overview',
default: true
},
{
label: 'Roles',
value: 'roles'
},
{
label: 'Avatar',
value: 'avatar'
},
{
label: 'Banner',
value: 'banner'
}
)
);
UserEmbedComponents = new SelectMenuBuilder.from(UserEmbedComponents.toJSON())
im trying to use this as of now but this isnt working
from takes api data or something with a toJSON method which returns api data, so you'd have to use the first component from the row here
so
UserEmbedComponents = new SelectMenuBuilder.from(UserEmbedComponents.components.toJSON());
components is an array
or components[0]?
okay
you don't have to call toJSON btw, from does that internally
ohk ty
also, is spliceOptions() removed in v14?
if it doesn't exist it can easily be added, might be an oversight from the /builders transition
how do I add it?
i dont think its there
Yeah probably just an oversight
okay
when will it be added then? @knotty plover
Whenever someone codes it 😄
Open an issue on Github for it and someone will probably PR
okay
can we still use intents in like string form instead of GatewayIntentBits.Guilds,
ts doesnt complain when i do so so ig it's ok
do note that all intent strings are PascalCase
so like instead of GUILDS i have to use Guilds?
yes
would not recommend it, but you do you
It's so long like GatewayIntentBits.GuildPresences
- Prettier makes 3-4 intents in seprate lines bcz of being to big text
that's why I was asking for the String intents are available or not
Has something to do with defering changed? For some reason they just think forever until I get a memory issue 
Big heads up to everyone The next development release will change builders to only accept arrays instead of rest parameters. In most cases this means surrounding your values in [] and/or removing the leading “…” spread operator.
all methods that accept rest params in builders?
Yes they’ll only accept arrays in the next release
Okay worked out its stopping here, however I am not really sure how I would debug it?
Also removed @discordjs/builders
Use Enums instead of Strings for Button Styles
Oh alright
ok thanks
Changed it over however its still stopping
what does "its stopping" mean, does the code throw?
No error, I have console.logs between the chunk I provided in the image, first one logs, second doesn't
Updating the package seems to have fixed it
Can I as for solution? Im lost.
currently addChoices takes rest parameters, not an array
spread the array, ...choices
Wow.. You are too clever. No way i would find that out. Thank you ❤️
so my bot logs in normally, but it's not rn
nothing in the code has changed, so I'm wondering if there's anything else going on?
client
.on("debug", console.log)
.on("warn", console.log)```
returns nothing in the console
ok something's probably wrong with the platform I'm running my code on, it works once I fork the same code
resolved the issue
Does ActivityType.Custom mean we can set custom statuses on Bots now?
no
then what is it for
members can have custom statuses
which your bot can receive
man
is it a PR about that for get a list of methods that have to be changed?
you can check the pr itself https://github.com/discordjs/discord.js/pull/7759/files
it's mostly the addX and setX methods where X could be Choices, Fields etc etc
thanks
message.content is different now?
you need MessageContent intent to receive message content
o
Why do I get a error when i try to set a embed color with .setColor('#0099ff') of the EmbedBuilder? When I try to use a integer (so not a string) it works, but i can't use so much colors anymore.
The error:
Received one or more errors
1 ExpectedValidationError > s.literal(V)
| Expected values to be equals
|
| Expected:
| | null
|
| Received:
| | '#0099ff'
2 ValidationError > s.number
| Expected a number primitive
|
| Received:
| | '#0099ff'
3 ValidationError > s.tuple(T)
| Expected an array
|
| Received:
| | '#0099ff'```
either import the builder from discord.js or use 0x0099ff instead (without quotes)
The builder is already imported. But the second suggestion worked. Thank you! 
Is that a bug or just a breaking change
and the code thats throwing this error is?
const { colors } = require("../../constants"),
button = new ButtonBuilder()
.setCustomId("dismiss_output@dev")
.setLabel("Dismiss")
.setStyle(ButtonStyle.Danger),
actionRow = new ActionRowBuilder().setComponents(button);```
setComponents is doing that
needs to be an array if youre on latest
Ohh
addFields also takes array now?
yeah they all do
Alr
can modals only have textinput atm?
yes
checkboxes maybe?
no
Heyo, upgrading from v13, I'm getting this when passing options to a SelectMenuBuilder, checked and every option has label and value with good format, so I'm not sure what to do
CombinedError (2)
Received one or more errors
1 CombinedPropertyError (2)
| Received one or more errors
|
| input.value
| | MissingPropertyError > value
| | A required property is missing
|
| input.label
| | MissingPropertyError > label
| | A required property is missing
2 ExpectedValidationError > s.instance(V)
| Expected
|
| Expected:
| | [class UnsafeSelectMenuOptionBuilder]
|
| Received:
| | [ [Object], [Object], [Object], [Object], [Object] ]
addOptions takes rest parameters not array
hmmm, so it was changed? I didn't see the change on the guide, neither on the documentation (I know it might not be updated, but weird)
https://discord.js.org/#/docs/discord.js/main/class/SelectMenuBuilder?scrollTo=addOptions
I might need to update then, going to check
I updated to discord.js@14.0.0-dev.1650586180-61a44c5
I'm sure every option has a label and value 🤔, am I missing something?
CombinedError (2)
Received one or more errors
1 CombinedPropertyError (2)
| Received one or more errors
|
| input.value
| | MissingPropertyError > value
| | A required property is missing
|
| input.label
| | MissingPropertyError > label
| | A required property is missing
2 ExpectedValidationError > s.instance(V)
| Expected
|
| Expected:
| | [class UnsafeSelectMenuOptionBuilder]
|
| Received:
| | { '0': [Object],
| | '1': [Object],
| | '2': [Object],
| | '3': [Object],
| | '4': [Object],
| | emoji: undefined }
maybe if they mentioned it in a guide or pinned message people wouldn't be asking about it all the time lol
Still not working 
const testArray = [ { label: "Test1", value: "test1" }, { label: "Test2", value: "test2" }, { label: "Test3", value: "test3" }, { label: "Test4", value: "test4" }, { label: "Test5", value: "test5" } ]
const testMenu = new SelectMenuBuilder()
.setCustomId(`testMenuBuilder`)
.setPlaceholder('ThisIsATest')
.addOptions(testArray)
const testRow = new ActionRowBuilder()
.addComponents(testMenu);
Same error as above
where tf is that emoji coming from
Are you on the latest builders that expect arrays?
I think so discord.js@14.0.0-dev.1650586180-61a44c5
updated a few minutes ago
Arrays would only be if youre on builders dev
discord.js itself still uses rest params until the dependency is updated I would think?
Let me check haha
Yeah so, are you importing it from discord.js, or @discordjs/builders
Uhmmm, I checked and I dont have @discord.js/builders
uninstalled discord.js and installed again (npm install discord.js@dev) and the problem persists
Yeah so
The one in core djs still uses rest params, not arrays
It's depends on an older version of builders
Need a discord bot dev who can make me a bot for my esports server. Budget: 1500 INR
This is not a place to hire developers
Also that's basically no money at all lmao
lmao
Why I am getting this error?
My code client.channels.cache.get(process.env.ERROR_LOG).send()
channel not in cache
or that id isnt correct
Okay
is there any enum for AuditLog Actions?
nvm got it
just now updated djs to latest dev version, shud I even update @builders to latest dev?
You should uninstall it
It comes with builders installed
I shud uninstall @builders?
is the audit log broken or something? at first it was functioning fine but then it started sending wrong info, for eg. I deleted a message sent by an user but the target id is of the bot instead of the user
fetchAuditLogs()
ok thanks
.addOptions(
...categories.map((cmd) => {
return {
label: cmd.directory,
value: cmd.directory.toLocaleLowerCase(),
description: `Commands from ${cmd.directory} category`,
};
})
)
so this shud be this now:
.addOptions(
categories.map((cmd) => {
return {
label: cmd.directory,
value: cmd.directory.toLocaleLowerCase(),
description: `Commands from ${cmd.directory} category`,
};
})
)
?
yep
ok ty
so everything including the ones like this in messageCreate event too?
if (file.name) {
const properties = { directory, ...file };
client.commands.set(file.name, properties);
}
?
nah just all methods that takes rest params before in builders
ah ok
const directories = [
...new Set(client.commands.map((cmd) => cmd.directory)),
];
``` so will this be correct?
try it
TY