#djs-in-dev-version
1 messages · Page 22 of 1
discor.js@dev?
discord.js@dev*
still can't reproduce
try install discord.js@dev or @discordjs/rest or update it
i did
i can reproduce
try it after this message on windows mashine
on linux all is fine
@urban belfry
linux update it
- discord.js 14.0.0-dev.1649937833-b01f414
+ discord.js 14.0.0-dev.1650197065-b94a876```
but on windows not
nvm now it works on Win too ^^
I see talk of workspace issues but I'm not managing to reproduce them?
jiralite@MacBook-Pro-2021 Soulobby % npm i discord.js@dev @discordjs/builders@dev @discordjs/rest@dev @discordjs/voice@dev @discordjs/collection@dev
added 14 packages, changed 2 packages, and audited 308 packages in 6s
93 packages are looking for funding
run `npm fund` for details
2 vulnerabilities (1 high, 1 critical)
To address all issues, run:
npm audit fix
Run `npm audit` for details.
me neither, even cleaned the cache
some peoples can't install stable version of rest too
There is no stable version of rest
lobster means the default
can reproduce on the latest versions (not dev)
Seems I can only reproduce with /rest
jiralite@MacBook-Pro-2021 test % npm i @discordjs/builders
added 7 packages, and audited 8 packages in 3s
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
jiralite@MacBook-Pro-2021 test % npm i @discordjs/rest
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:^
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jiralite/.npm/_logs/2022-04-17T13_20_46_572Z-debug-0.log
jiralite@MacBook-Pro-2021 test % npm i @discordjs/builders
up to date, audited 8 packages in 427ms
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
jiralite@MacBook-Pro-2021 test % npm i @discordjs/voice
added 7 packages, and audited 15 packages in 7s
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
yeah tbf rest was the only one i tried
It was thrown here for discord.js, not sure of the conditions though
cant reproduce, probably caused by /rest somehow
can reproduce on rest
Hey
Why is it sending the message "Spatiu." more then 1 time
You didn't check if <Message>.author.bot is true probably
yea now i saw ty
How to check if the bot is sending the msg cuz is not working like that
if someone responds pls ping me
change || to &&
you can just do if (msg.author.bot) return;
ye but with that i will use to if conditions'
working didn't know that
what intents are needed for the guildMemberAdd event be emitted?
GuildMembers
thx
Is it possible to interaction.editReply() after interaction.showModal()?
I'm using an InteractionCollector to collect responses and I'm trying to reply to the end timeout. Is my only option to send a fresh message?
no
So I have to send a fresh message? I guess I'll have to remind the user what slash command they used
What means that?
Type 'Omit<CommandInteractionOptionResolver<CacheType>, "getMessage" | "getFocused" | "getMentionable" | "getRole" | "getAttachment" | ... 10 more ... | "_getTypedOption">' is missing the following properties from type 'CommandInteractionOptionResolver<CacheType>': _group, _hoistedOptions, _subcommand, _getTypedOption, and 12 more.ts(2345)
how to use .addChoices() in v14?
can't you use followUp()?
Ah, forgot about that! Thanks
Hey, what happened to "restTimeOffset"
And where can I find all the "Constants" please?
thank you
Module '"discord.js"' has no exported member 'CommandInteraction'.ts(2305)
what instead?
Hmmmm, there's a Constant for "ActivityType" but there's none for the client status.
CommandInteraction => ChatInputCommandInteraction
ah nvm ty
Heads up to everyone, if you have builders installed manually, you should go ahead and remove the installation via:
npm uninstall @discordjs/builders
or
yarn remove @discordjs/builders
Discord.js ships with all of the builders. Having both packages installed at the same time can cause confusion because of conflicts between both classes existing. This can cause auto-imports to give classes you might not expect.
yay!
ActionRowBuilder now requires a generic
No
either MessageActionRowComponentBuilder or ModalActionRowComponentBuilder
intellisense should help you
I don’t understand
Well as I said you should remove /builders it’s not needed if you have the latest djs installed
wonder when they're release the full version
Is there a list of known bugs somewhere? I know about builders but is there more known bugs?
Property 'reply' does not exist on type 'ChatInputCommandInteraction<CacheType>'.ts(2339) ?
Okok
code? I updated my bot and didn't encounter this one
return interaction.reply({
content: reply,
ephemeral: this._instance.ephemeral,
})
} else {
let embeds = []
if (Array.isArray(reply)) {
embeds = reply
} else {
embeds.push(reply)
}
return interaction.reply({
embeds,
ephemeral: this._instance.ephemeral,
})
}
}
try restarting tsserver, can't reproduce it
code?
new ActionRowBuilder<MessageActionRowComponentBuilder>
you need the generic
dont work thats my complete code. i'm to stupid i think https://srcb.in/HgFuWsHS4X
that code works perfectly fine for me (at least the part in question)
make sure you are on latest dev, that bug was fixed
with todays release
is there a way to run editReply of the original interaction when I receive a buttonInteraction?
so like a user runs /something
and on the response, there are buttons.
I am not using .awaitMessageComponent, but I have a seperate event listening for interactionCreate
when the button gets pressed I want to edit the message of the original response to /something
using buttonInteraction.message.edit does not work (Missing Access)
use ButtonInteraction#update
u mean me?
why i get this error then Property 'reply' does not exist on type 'Interaction<CacheType> & ChatInputCommandInteraction<CacheType>'.ts(2339)
because it doesn't exist on Interaction. not sure why it's typed like that for you, I thought you had interaction: ChatInputCommandInteraction in your code
Property 'reply' not exist on 'Interactione & ChatInputCommandInteraction
const modal = new ModalBuilder('finder')
.setCustomId('redeem')
.setTitle('Server Build - Finder');
const favoriteColorInput = new TextInputBuilder()
.setCustomId('favoriteColorInput')
// The label is the prompt the user sees for this input
.setLabel("What's your favorite color?")
// Short means only a single line of text
.setStyle(TextInputStyle.Short);
const firstActionRow = new ActionRowBuilder().addComponents(favoriteColorInput);
modal.addComponents(firstActionRow);
await interaction.showModal(modal, {ephemeral: true})
how would i log for example my input?
it just don't understand it
you need to collect the response with an InteractionCollector
no, its not a promise
i know but in theory
Im not sure if awaitModalSubmit is merged yet
Yea that got merged
cool, interaction.awaitModalSubmit
const collector = message.createMessageComponentCollector({ componentType: 'BUTTON', time: 15000 });
collector.on('collect', i => {
if (i.user.id === interaction.user.id) {
i.reply(`${i.user.id} clicked on the ${i.customId} button.`);
} else {
i.reply({ content: `These buttons aren't for you!`, ephemeral: true });
}
});
collector.on('end', collected => {
console.log(`Collected ${collected.size} interactions.`);
});
this right?
is what you mean with an collector*
<:_:874573924988518500> CommandInteraction#awaitModalSubmit()
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
sort of yes, though a MessageComponentCollector wont work since modals arent message components
where else?
We are in the version 14 category
#7751 in discordjs/discord.js by suneettipirneni merged <t:1649776427:R>
feat(modal): add awaitModalSubmit
i just don't understand it
i feel so dumb
refer to this @sharp pine
omg yess I didn't see this was merged
theres a code example on that
where?
.
update to the latest dev version
yes but what do i need to put in the brackets because of (options)
use the example
there is no example
theres no typings for it thats all
how would i retrieve the filled in data?
interaction.fields.getTextInputValue(customId)
thanks!
1|snake | TypeError: Cannot read properties of null (reading 'id')
1|snake | at ButtonInteraction.update (/home/clauz/snake/main/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:235:108)
1|snake | at processTicksAndRejections (node:internal/process/task_queues:96:5)
1|snake | at async InteractionCollector.<anonymous> (file:///home/clauz/snake/main/built/commands/infos/help.js:214:13)
recently updated djs and im getting this error when editing a button interaction, what is causing this? (i changed nothing in my code)
without seeing code it'd be hard to say, did you update from v13 to the v14 dev? or was it just a small update within v14?
i was alr on v14
Seems to be having an issue with creating the InteractionResponse
Can you show your code?
for some reason the function is only typed on message component interactions
oh I see. I haven't messed with it with yet, the collector does fine for what I need
code?
dont return that
return nothing on the next line
stricter typings
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()
<:_:874569335308431382> 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
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
nope that still has the typo
you need to spell it properly
the names aren't wong?
Rin even told you the typo
this.build = out3.vars.sv_enforeGameBuild ?

That's some ancient ES5 code
const build = []
build = out3.vars.sv_enforeGameBuild ?
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
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
sorry sir i just was angry
Yeah, thanks!!
And also, which channel should I use?
None of them, because this is DJS not Discord 👌
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:
<:_:874573924988518500> 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.
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
<:_:874573924988518500> 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
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:
<:_:862626783890636830> 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 ?
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?
what kind of commands? is it turning online?
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
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
exactly the same but with an "s"
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
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
pretty sure it's not
that version is 2 months old according to npm
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
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)
ok, ty
Or { name: "custom name", id: "…" } for guild emojis
ty
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")
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
can i make like a slash command which only specific person can see and use like normal users can't even see the command ?
Anyone can help me with this?
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
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
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
💀
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 
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 []
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 []
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
?
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)
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
seems correct
wait that's not the part where you deploy the commands
you are just adding them to a collection there
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
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
yes
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
yes, this is correct
great
there is no "ping" command though
changed it to generate
can you log the options array from the command?
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?
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
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
Ur not allowed to login if it's ip banned
Slow connection then?
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
If you hit rate limit (429) on /gateway/bot, then it means someone got the machine ip banned
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?
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
why it is not loading slash event etc ?
recheck your command handler
its correct
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
probably got ratelimited
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
only oauth2
okay
is there any ComponentType Enum?
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
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?
yes
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
Can I make this?
try intents: Object.keys(IntentsBitField.Flags)
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?
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: '🍃' },```

So, any idea what I'm doing wrong?
TY
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>
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?