#djs-in-dev-version
35223 messages · Page 20 of 36
Documentation suggestion for @tame gazelle:
EmbedBuilder#spliceFields()
Removes, replaces, or inserts fields in the embed (max 25)
<EmbedBuilder>.spliceFields(3, 1, field)
It should be 0, not 1, unless he wants to overwrite that position
Ok sorry
I'll try thanks
It's coming soon 🎉
Hi, I still need help with #djs-in-dev-version message
TextInputStyle.Paragraph, not Long
Ah right right
Hello, the messageCreate event does not issue a guild object, what is the problem? (all intents are included)
https://thumbsnap.com/i/tEhHnp4w.png
https://thumbsnap.com/i/9DUw7bhQ.png
const { IntentsBitField } = require('discord.js')
const mean = new Mean({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.GuildBans,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.GuildPresences,
IntentsBitField.Flags.GuildVoiceStates,
IntentsBitField.Flags.GuildScheduledEvents,
IntentsBitField.Flags.MessageContent
],
allowedMentions: { parse: ["users", "roles"] }
});
what happen when you log message.guild ?
null
you also don't see it in the screenshot
I don't it is related to the issue but can I just see what is Mean defined as?
the average value of what?
didn't get
Check pinned message
ty ❤️
Are you sure photo isn't null?
how does the new voice work &~~ where is the new guide url for it (dev version)~~
I'm fairly certain, however I will double check once I get back home
hello, i did ```js
guild.commands.create(new discord.SlashCommandBuilder()
.setName('soko')
.setDescription('Play sokoban')
.addSubcommand(subcommand =>
subcommand
.setName('create')
.setDescription('Create your own soko map')
.addStringOption(option => option.setName('map').setDescription('The soko map to create'))
)
.addSubcommand(subcommand =>
subcommand
.setName('play')
.setDescription('Play a custom soko map')
// .addStringOption(option => option.setName('map').setDescription('The soko map to create'))
)
)
you have to call toJSON on the builder
so like this? ```js
new discord.SlashCommandBuilder()
.setName('soko')
.setDescription('Play sokoban')
.addSubcommand(subcommand =>
subcommand
.setName('create')
.setDescription('Create your own soko map')
.addStringOption(option => option.setName('map').setDescription('The soko map to create'))
)
.addSubcommand(subcommand =>
subcommand
.setName('play')
.setDescription('Play a custom soko map')
// .addStringOption(option => option.setName('map').setDescription('The soko map to create'))
)
.toJSON()
it still does not show the sub commands
Cant see any reason
Toggle it's permissions in the server settings, might be related to that bug
sure, let me try
yea it worked, ty
problem tho, i ran the soko play command and it just ran the soko command itself, after i logged interaction.commandName it logged soko so how do i check the name of the subcommand?
and also the command itself does not appear when i do /soko only soko play and soko create appear
get it like an option: ChatInputCommandInteraction#options.getSubcommand() === 'subcommand name here'
this is what i use in v13:
if (channel.type === "GUILD_STAGE_VOICE") {
//code...
};```
is this how i would do this in v14-dev?
```js
import { ChannelType } from "discord-api-types/v10";
if (channel.type === ChannelType.GuildStageVoice) {
//code...
};```
Yes
yep this worked, tysm
what about this tho?
that is to be expected, if a command has subcommands you cannot use the base command
i see, is there a way to have the base command tho?
no
subcommands are classified as options
sad
hello, as in the realities of interaction.deferReply({ephemeral: true }), send interaction without flag 64 (ephemeral)
Set it to false
it can't be that way
Why?
well, I want the interaction to be under flag 64 first, and then it will come out as a normal message
I'll try interaction.channel.send() 
Hello I was just trying out the djs v14 version, and I cant make it respond to my commands, I have enabled the message content intent for the bot but it still doesn't work.
Hello! You dont need any intents to use commands
Oh,
But may I know why my bot isnt responding to anything?
I can give u the code if you want
const Discord = require('discord.js')
const client = new Discord.Client({
intents: 32767,
partials: ['MESSAGE','CHANNEL']
})
const prefix = "^^"
const fs = require('fs')
client.commands = new Discord.Collection()
const commandHandler = fs.readdirSync("./Commands")
for(file of commandHandler){
if(!file.endsWith(".js")) {
fs.readdirSync("./Commands").filter(file => !file.endsWith(".js")).forEach(dir => {
const f = fs.readdirSync(`./Commands/${dir}`).filter(file => file.endsWith(".js"))
f.forEach(x => {
let commandName = x.split(".")[0]
let command = require(`./Commands/${dir}/${commandName}`)
client.commands.set(command.name, command)
})
})
}
if(file.endsWith(".js")) {
let commandName = file.split(".")[0]
let command = require(`./Commands/${commandName}`)
client.commands.set(command.name, command)
}
}
client.on("messageCreate", async message => {
if(message.content.startsWith(prefix)){
const args = message.content.slice(prefix.length).trim().split(/ +/g)
const commandName = args.shift()
const command = client.commands.find(cmd => cmd.name.includes(commandName))
if(!command) return; console.log(`${message.author.tag} used and undefined command`);
command.run(client, message, args, Discord)
}
if(message.content === 'test'){
message.reply('testing')
}
})
client.login('token')``` sorry if im flooding the chat
That’s not possible
ephemeral is not editable
You need interactionCreate event listener
Im sorry but are you talking to me?
yes
you're not listening for interactionCreate events which are needed for slash commands
Yes
oh
I'm not exactly doing slash commands
I'm just tryna test out the modals
oh I assumed
Its alright
You cant show modals on messages it needs to be interaction
Yes, im trying it with buttons
const { ButtonBuilder, ActionRowBuilder } = require("discord.js")
module.exports = {
name: 'modal',
run: async (client,message,args) =>{
const btn = new ButtonBuilder()
.setLabel('Button')
.setStyle('SECONDARY')
.setCustomId('modal')
const row = new ActionRowBuilder()
.addComponents(btn)
message.channel.send({components:[row]})
}
}``` heres the button
It was in another file so I didn't show it
thats not gonna work
Oh..
modals are an interaction response
But a button is an interaction isnt it?
it is, but you're not responding to a button with that, you're responding to a message
If you want to make the bot respons to messages then you need Guilds GuildMessages and MessageContent intent
32767 covers it all doesnt it?
no
Nope
Oh..
if you insist on all intents you need 131071
ooh
but it's ill advised
you need to send a message with the button attached to it, then listen for that button press customId with either an interactionCreate listener or an InteractionCollector and then respond to that interaction with a modal
there's a brief guide in the pins on how modals work and how to use them
Yes, thats what i was planning, i was just checking if the button would send first, but it didnt, so i had to ask here for help, sorry for taking your time
well, you're missing the message content/embed
you can't just send a button on it's own
it needs to be attached to something
But it was possible tho
it's not
hmm
message.channel.send({
content: 'this is the text of the message',
components: [row]
})
you could send an array of embeds instead of content if you prefer
Thankyou,
you're welcome
Don't use magic numbers
But it still doesnt respond tho
The purpose of intents is to limit it to what you need
I did make that clear
and the guide gives enough warnings about the use of magic numbers. nothing wrong with using them if you know the risks of them changing etc
const row = new ActionRowBuilder()
.addComponents(btn)``` I reckon im doing this wrong, I'm sorry I'm not so familiar with the errors in v14, this is my first time```js
this.components.push(...components);
^
TypeError: Found non-callable @@iterator``` my error ^^
.addComponents takes an Array
Oh
Thankyou very much
no prob
Also @pallid ice, not to prove you wrong or anything, just wanted to confirm, u can send a button without any content
good to know
thanks
that's new then, had to u200B that before
I think it's been like that for a while
I've been able to send just components for a bit
Me too
I tried once during the v13 dev and failed so never tried again haha
Oh that definitely was not possible before
It is pretty recent
thank you for confirming, I was beginning to think I was going crazy 
Hey, how buggy has v14 been? Like im wondering if I should use it for my bot or not... as the modals would work great for what im making. I know its in dev and stuff so its naturally buggy but just wondering peoples experience withi t
wait for v13.7 or install modal pr if you just wanted modal
yeah its just the modals I want
ahh i can probably just use this https://www.npmjs.com/package/discord-modals
Its not buggy
no one here recommends you to use 3rd party package since it'll most likely introduce more problem to yourself
install the modal pr (#7431) if you wanted modal that bad
is there any website instance of update into v14 guide online ?
tty
Why is this code not working? There are no errors, but it's not logging anything https://sourceb.in/k0U0NtH4oM
your log coverage is pretty bad
if nothing logs, execution stops before those lines
i know but why
logging above await interaction.showModal(modal);
if (!interaction.isModalSubmit()) return;
logs it
but below it doesn't log
can anyone please help?
not too sure what's confusing about that?
you are within a block that is guarded by interaction.isSelectMenu() (line 7)
on that same interaction you now guard that it has to be a modal submit, else you return (line 45)? how's that supposed to work?
so i remove line 7?
so you stop coding for a second, think about what you want and fix your logic
also, since i'm allergic to people using #find by key: <Collection>.get(key) (line 48)
Don't use the find method to query a Collection by key (mostly the associated id)
- someCollection.find(structure => structure.id === "348607796335607817")
+ someCollection.get("348607796335607817")
ok sorry sir i will fix that later
1
node:events:368
throw er; // Unhandled 'error' event
^
TypeError: Cannot read properties of undefined (reading 'getTextInputValue')
what does that mean?
whatever comes before .getTextInputValue is undefined
but this correct tho?
const _title = interaction.fields.getTextInputValue('title');
interaction.fields is undefined
this is how i defenied interaction that wrong?
client.on('interactionCreate', async (interaction) => {
and then i have this const { member, channel } = interaction; as well
its good
then why it says TypeError: Cannot read properties of undefined (reading 'getTextInputValue')
is interaction a ModalSubmitInteraction
wdym?
is interaction an instance of ModalSubmitInteraction
no, how do i do so?
check interaction.isModalSubmit()
so like this if (!interaction.isModalSubmit()) return; ?
yup that fixxed the error but below line 45/44 nothing works
except the reply
What would be the best way of installing the modal pr?
https://thumbsnap.com/i/yYKKLy6y.png https://thumbsnap.com/i/aLCmV6CX.png
how do I disable this error?
catch it
Where is the problem?
client.on('interactionCreate', async (interaction) => {
if (!interaction.isSelectMenu()) return;
let embed = new Discord.EmbedBuilder()
.setTitle("Quick Help")
.setDescription(
`You can find a list of **frequently asked questions** and other **guides** here.`
)
.setColor(client.config.color);
if(interaction.values[0] === "bugModal"){
await interaction.update({ embeds: [embed] });
let bugEmbed = new Discord.EmbedBuilder()
.setColor("#6861fe")
.setDescription("Bla Bla")
interaction.reply({
embeds: [
bugEmbed
],
ephemeral: true,
});
}
})
C:\Users\Simon Stark\Desktop\koojeAPI\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:101
if (this.deferred || this.replied) throw new Error('INTERACTION_ALREADY_REPLIED');
^
Error [INTERACTION_ALREADY_REPLIED]: The reply to this interaction has already been sent or deferred.
at SelectMenuInteraction.reply (C:\Users\Simon Stark\Desktop\koojeAPI\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:101:46)
at Client.<anonymous> (C:\Users\Simon Stark\Desktop\koojeAPI\modules\others\quickhelp.js:18:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[Symbol(code)]: 'INTERACTION_ALREADY_REPLIED'
}
u can update and reply in one interaction
Then how can i make it, that this is going to be rested after the interaction replied
<interaction>.message.edit(...) ?
oh yea true thanks
Is there a modal collector?
Like how theres one for a select menu and button
CommandInteraction#awaitModalSubmit()
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
ah thankyou!
can you not show modals for interactions that have already been replied to?
no
showing a modal is a type of interaction response
const channel = await client.channels.fetch('964183272202592306')
const lastMessages = await channel.messages.fetch({ limit: 10 });
const systemMessage = lastMessages.reverse().find(message => message.system)
if (systemMessage) await systemMessage.delete();
Why is this not working?
please elaborate, you've been here long enough to know that "not working" is not a sufficient error description
i understand that, if i had an error i would send it in here as well
const channel = await client.channels.cache.get('964183272202592306')
const lastMessages = await channel.messages.fetch({ limit: 10 });
const systemMessage = lastMessages.reverse().cache.find(message => message.system)
if (systemMessage) await systemMessage.delete();
try this
are you trying to delete a system message?
i tried yesterday and to delete a system message yesterday and got an error like "u can't delete system message" 😕
TypeError: Cannot read properties of undefined (reading 'find')
yup
Collection#cache isn't a thing
so what do i do?
remove .cache
still not deleting
then systemMessage isn't found
is reaction.message.channel a thing?
yes
ah i thought maybe this would work but no
const lastMessages = await reaction.channel.messages.fetch({ limit: 10 });
Dont need to await get method from cache
Is not a Promise
will this make a big difference if await it or not?
Yes
you must await fetch to make it work well
so this isn't working either
const channel = client.channels.cache.get('964183272202592306')
const lastMessages = await channel.messages.fetch({ limit: 10 });
const systemMessage = lastMessages.reverse().find(message => message.system)
if (systemMessage) await systemMessage.delete();
log systemMessage
<ref *1> Message {
channelId: '964183272202592306',
guildId: '934213686468423780',
id: '973647815878250516',
createdTimestamp: 1652206128807,
type: 18,
system: true,
content: 'asdad',
author: ClientUser {
id: '938176229918531604',
bot: true,
system: false,
flags: UserFlagsBitField { bitfield: 0 },
username: 'koojeAPI',
discriminator: '2132',
avatar: 'f71d5abe9707f106dd3805d60f0ed76a',
banner: undefined,
accentColor: undefined,
verified: true,
mfaEnabled: true
},
pinned: false,
tts: false,
nonce: null,
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: {
channelId: '973647815878250516',
guildId: '934213686468423780',
messageId: undefined
},
interaction: null
}
logging
Some system messages cannot be deleted, but that's a thread system message, so it should be fine
That looks like it will work to me
.destroy() doesn't always take my bot offline, anyone know why?
it takes a while to change status
is user.member on a reaction Event partial?
user.member isn't a thing? 
yeah no i had a stroke, dont mind me
is msg.member on any message events partial?
that depends, is msg partial?
so fetching the message fetches the member?
should do?
okay thanks
not sure tho
it seems like <guild>.fetchAuditLogs() is not ratelimit checked internally
got API banned for sending too many requests 4 times
5 now
How do you know you're not getting rate limited?
but thats the point, i am
internal ratelimit checks should prevent sending too many requests by checking the response headers, and it seems like thats not happening
oh, no im getting API banned because i cant login for an hour
Do you have any evidence of this
does a Request log showing 40 audit log requests in less than 5 seconds count as evidence?
Rate limit queuing happens in the rest layer. For it not to happen then the endpoint itself would have to be not sending back headers
Depends entirely on how/where they're logged
by the rest request and response events
@knotty plover should i open a issue on d.js?
I haven't looked at the logs yet
I'm mobile right now, can if you want
will do
photo is definitely not null
This may be a bot permission issue
Nope, that wasn't it either
The bot has permission to embed links and attach files now, and it still doesn't work
anyone else got any ideas? All I want is to take the picture the user set as an attachment and echo it back in the command response
If youre using slash commands the everyone role needs those permissions
Slash command responses are webhooks
The everyone role does have the proper permissions
I doubt this will make a difference, but am I supposed to be using const { Routes } = require('discord-api-types/v10');
v10 or v9
d.js v14 uses Discord API v10
Okay
If I enter the URL the command sends in the browser the photo shows up fine
it's just nothing shows up in the return message
Or rather, just the text shows up
Can you send an embed and contents at the same time?
yes
Got it working, I'm a derp
I accidentally reset the reply variable below the code I copied and pasted
however it's working with embed, not files
is that the right way to do it?
Here's the code again that's working:
reply = { content: textResponse, embeds: [new EmbedBuilder().setURL(photo.url).setThumbnail(photo.url).setTitle("Photo").toJSON()] };```
what did i do wrong?
We don't support external libraries like discord-modals. This is DJS. Modals have been included in the dev branch of DJS, and are coming in v13.7.0
the api is already very fast, I doubt it's measurably faster
Newer api versions generally contains more features and other changes that can't be back-ported w/o breaking current applications using it
how bot can selfmute itself, not server mute?
anyone pls?
VoiceState#setMute()
Mutes/unmutes the member of this voice state.
Hello, Im making a modal and It only seems to be able to accept 5 actionRow's, is there anyway I can add more?, possibly 6?
i dont think it's possible
Oh, Thankyou for your kind time
5 rows, 1 per row => 5
yes?
Can you add more than 1 components to 1 row?
no, that's the limit
only components for modals (at the moment at least) are text input short and paragraph which is 1 per row
Hmm, alright thanks!
I'm trying to make slash commands in v14 so I needed help registering them but I ran into this problem:
you getting a 429 by any chance?
I honestly have no idea what you mean but if ur asking if I got another error then no, I didn't
429 means ratelimit
Oh, no I'm not
Actually this is the code from my v13 slash handler which I was trying to use with a v14 bot so updated the interactionCreate event which looks like this so I assumed I'm using something which has to be updated
PascalCase: Red
how to cheak uptime of the bot with eval command
Documentation suggestion for @vague depot:
Client#uptime
How long it has been since the client last entered the READY state in milliseconds
or process.uptime()
that's not the same as client
yeah
probably in the same ballpark for most applications, i'd think
it's not exactly the same, but around the same
-ev [client.uptime, process.uptime()]
[ 190886296, 190887.62047185 ]```• d.js `14.0.0-dev.1649030898-5748dbe` • Type: `object` • time taken: `0.191258ms`
"number of seconds" who thought that was a good idea 
xexexs
Does the makeCache message property will create a Limited Collection for each channel, or a global Limited Collection for all channels? (Considering my setup uses Limited Collection) I just want to know if I need a bigger limit to adreess all channels or a smaller one to adress one channel!
is GuildMember.moderatable checking if the user can be timed out?
yea, if bot have permissions to timed out member
Hello,
How to use the fetchReply property in the showModal function ?
Help please
there is no fetchReply property in the showModal function
So how do you use a collector on it?
modals arent components
CommandInteraction#awaitModalSubmit()
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
yes I had seen this one but I'm looking to do a collector's item on it but that's ok thanks anyway
@slender sky
U can submit a form only once so collector doesn't makes sense instead use awaitModalSubmit
Invalid bitfield flag or number: MANAGE_GUILD???
ManageGuild
(static) IntentsBitField.Flags
Numeric WebSocket intents
ohhhhh ty
in discord js v14 member.roles.add() changed ??
read the error, it says MEMBER_ROLE_UPDATE is not an int, that is an issue with some logger you have
you want MemberRoleUpdate instead I believe (nevermind don't believe that's an enum)
does the beta already support the new permission system for interactions?
its not done yet
partly
#7857 in discordjs/discord.js by ckohen created <t:1651099837:R> (changes requested)
refactor(ApplicationCommand): permissions v2
📥 npm i ckohen/discord.js#perms-v2
#7861 in discordjs/discord.js by vladfrangu opened <t:1651164195:R> (review required)
feat(builders): add new command permissions v2
📥 npm i discordjs/discord.js#feat/application-commands-v2-for-builders
RangeError: Non-link buttons cannot have a url
new ButtonBuilder().setURL("https://www.example.com/").setLabel("Example button");
You have to set the button type
Forgot to set the type?
you need to set style to Link
Ah dum me 
c.permissionOverwrites.has
``` this code was working in v12, but I couldn't find the equivalent of this code in v13, can you help?
Is it possible to close a modal interaction even if the user didn't do anything? I'm trying to make a time limit that the user can use the modal, then it close by itself if they didn't do anything.
.cache.has
No
Oh, okay. Thankss 
can we show a modal on a deferred interaction ?
<Interaction>.showModal
Error [INTERACTION_ALREADY_REPLIED]: The reply to this interaction has already been sent or deferred.
no
Thank you bro
I understand ^^
is there currently a request for keeping string hex colors on the EmbedBuilder class?
EmbedBuilder from discord.js accepts setColor with hex strings
word
EmbedBuilder#setColor()
Sets the color of this embed
@discordjs/builders doesn't
That is indeed correct
discord.js exports EmbedBuilder that overwrites setColor from the builder
so I should use everything from discord.js directly unless if it doesn't already support it?
You use whatever you want and need
I want to not have to refactor

Thank you tho ❤️
.addChoices([{ "name": "Test", "value": "10" }])
is this the right way to add choices in discordjs dev v14 (latest)?
looks good to me
you have any errors or something?
give me a second i will send a screenshot
this what i have used:```.addNumberOption(option => option.setName('time').setDescription('Time!')
.setRequired(true)
.addChoices([
{"name": 'Seconds', "value": 100},
{"name": 'Minutes', "value": 60000},
{"name": 'Hours', "value": 3600000},
{"name": 'Days', "value": 86400000},
]))
what version of djs builders are you using?
can you just install the dev version npm i @discordjs/builders@dev?
or import from discord.js
Version: 0.14.0-dev.1651493044-4ba0f56
const { SlashCommandBuilder } = require('discord.js'); already did :/
heh it takes a rest parameter now? uuuuuuuuuuh this is awkward
@thick willow can you try to pass multiple parameters instead of an array
thank u
i have no idea what's up with that
if(interaction.customId === "id"){
let embed = new
EmbedBuilder(interaction.message.embeds[0])
.setColor('Green')
await interaction.update({embed[embed]})``` Hello, im trying to update my interaction by setting the color of an existing embed as green, but it says that my embed needs more values, I understand why this happens, is there anyway i can edit the existing embed to change the color?
Try interaction.message.embeds[0].data
Okay lemme try
or just use EmbedBuilder.from()
Thankyou so much
I'll try that if I get the error again, thanks for the info!
Hello! I'm trying to use modal windows, but an error appears, what's the problem?
SHOW_MODAL_ERROR: An error occurred when showing a modal. HTTPError [DiscordjsError]: Request to use token, but token was unavailable to the client.
Tag suggestion for @scenic vortex:
We do not provide any help with third party libraries like discord-buttons.
• Discord.js supports buttons natively: guide
oh wait the pr wasn't merged yet was it ._.
We don't support discord-modals either
the client is either not logged in or was destroyed
Oke, thanks
but yes, you are using discord-modals, use the discord.js@dev modals if you need further support 👍
well, or ask the respective library, we cannot forbid you from using third party packages, but we cannot help you with them here
(and if you, dear reader, can and are okay with supporting it; kindly move to DMs)
we do ofc. recommend you use the native implementation
How can I convert it to the number data type?
role.permissions
i use this in my code
you can't, really
bitints are bigger than the max safe integer in javascript
if you do convert it it will loose accuracy (which is arguably really bad for permissions)
*bigint
mongoose is not using bigint what can i do?
Documentation suggestion for @frank moss:
BigInt.prototype.toString()
The toString() method returns a string representing the specified BigInt object. The trailing "n" is not part of the string.
const row = new ActionRowBuilder()
.addComponents([
new ButtonBuilder()
.setStyle(ButtonStyle.Primary)
.setEmoji('🖥️')
.setLabel('Test')
.setCustomId('test')
])
```What am I doing wrong here?
if you're asking that I guess you got an error?
No error, it just wont send. I thought maybe I made an obvious mistake that I just couldnt see
well, show how you're sending it
Nvm i didnt get the channel how i was supposed to
TypeError: category.children.find is not a function
category.children.find(channel => channel.topic === `${i.user.id}`)
```Trynna check if a channel in `category` has a description equal to `i.user.id` and this worked in v13. What's it been changed to?
category.children.cache.find
Oh yeah, tysm
what is this err?
invalid message component, perhaps you didn't put it in an actionrow?
YESSSSSSSSSSSSS 🤦🏻♂️
did someone already used getAttachment?
I keep getting that error:
at CommandInteractionOptionResolver.get (C:\Users\user\WebstormProjects\kevee\bot\node_modules\discord.js\src\structures\CommandInteractionOptionResolver.js:78:15)
at CommandInteractionOptionResolver._getTypedOption (C:\Users\user\WebstormProjects\kevee\bot\node_modules\discord.js\src\structures\CommandInteractionOptionResolver.js:95:25)
at CommandInteractionOptionResolver.getAttachment (C:\Users\user\WebstormProjects\kevee\bot\node_modules\discord.js\src\structures\CommandInteractionOptionResolver.js:226:25)
at Object.run (C:\Users\user\WebstormProjects\kevee\bot\commands\context\hi.js:10:41)
at Client.<anonymous> (C:\Users\user\WebstormProjects\kevee\bot\index.js:116:25)
at Client.emit (node:events:527:28)
at InteractionCreateAction.handle (C:\Users\user\WebstormProjects\kevee\bot\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (C:\Users\user\WebstormProjects\kevee\bot\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\user\WebstormProjects\kevee\bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketShard.onPacket (C:\Users\user\WebstormProjects\kevee\bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:22) {
[Symbol(code)]: 'COMMAND_INTERACTION_OPTION_NOT_FOUND'
}```
like I'm using the correct option name
After showing my modal I create a collector. If I then click Cancel and get it to show the modal again and then submit, it collects it twice resulting in it creating 2 channels for me. Is there a way to kinda stop the collector if I "cancel" the modal?
what is this for?
create the collector on the message or use something unique in the filter (like the interaction's id)
can't put more than 5 buttons in a row
can't reproduce, did you actually provide the option when submitting the command?
I didnt Ig the problem is from modal
*can't put more than 5 rows in a modal
const firstActionRow = new Discord.ActionRowBuilder().addComponents([firstInput]);
const secondActionRow = new Discord.ActionRowBuilder().addComponents([secondInput]);
const thirdActionRow = new Discord.ActionRowBuilder().addComponents([thirdInput]);
const fourthActionRow = new Discord.ActionRowBuilder().addComponents([fourthInput]);
const fifthActionRow = new Discord.ActionRowBuilder().addComponents([fifthInput]);
const sixthActionRow = new Discord.ActionRowBuilder().addComponents([sixthInput]);
const seventhActionRow = new Discord.ActionRowBuilder().addComponents([seventhInput]);
const eighthActionRow = new Discord.ActionRowBuilder().addComponents([eighthInput]);
const ninthActionRow = new Discord.ActionRowBuilder().addComponents([ninthInput]);
adminForm.addComponents([firstActionRow, secondActionRow, thirdActionRow, fourthActionRow, fifthActionRow, sixthActionRow, seventhActionRow, eighthActionRow, ninthActionRow]);
await interaction.showModal(adminForm);
oh ok tnx <3
wdym?
does your slash command has an attachment option with the name "hi" and did you add a file when submitting the command?
wait no sry it's an contextmenu command
it's supposed to get the attachment from a message
But I show the modal with the same button so I can't really create the collector onto that can I?
you can use the buttoninteraction's id
then use MessageContextMenuInteraction#targetMessage#attachments
Will it be a new ID from each button click even tho its the same button?
yes
all ids are unique
I logged i. Is the ID i should use i.id then?
r u replacing . with #?
Wait I actually don't get what you told me to do muchnameless.
const modalcollector = new InteractionCollector({ filter2 }, client)
```What's `filter` supposed to be?
filter: filter2
what you have there pretty much acts as {filter2: filter2} which is not what it wants, it wants filter
But I already got a filter somewhere else?
And do you know what filter would be?
it's an object property
Yeah but muchnameless told me to use the button interaction ID in the filter, but I don't get how that will fix my issue
currently you have two collectors listening both to the same interaction. the idea is to use filters in such a way that each modal submit interaction is only getting picked up by a single collector, so you need something unique to identify it. your modals are triggered by buttons, each button interaction has a unique id so you can use that in your filter, to be able to compare it your modal interaction needs the information as well but luckily it has a customId which you can set to whatever you want, so you can store the button interaction id there
I'm sorry, I still don't quite follow. What do you mean with storing the button interaction id there?
the custom id is a string of up to 100 chars which you can set to whatever you want. put the interaction id in it, maybe something else to identify the modal, ...
Is this what you mean?```js
const modal = new ModalBuilder()
.setCustomId(${i.id})
.setTitle('Please fill this form to continue')
now you compare the customId from the received interaction to i.id in your filter (no need to stringify it, ids are already strings)
let filter = i => i.customId === 'openTicket' || i.customId === 'closeTicket';
```My filter looks like this, I don't have `i.id` in it?
you might want to rename either the received button interaction or the filter parameter
Why do I need to rename my received button interaction?
because it's also named "i" according to this message
So what should I rename and what to?
in your filter you need access to both the button interaction and the modal submit interaction. since the latter is local to the filter function it would shadow the outer variable if both share the same name
Sorry I don't understand what you want me to do? 😕
do you know what variable shadowing is? is "i" from this message the button interaction or what did you define it as?
i is the button interaction yes
https://clue.isadev.tech/🦹🧶🤭📩
weren't you supposed to not be able to use strings for this anymore
BitField.resolve still resolves string flags, and it's used in most BitField methods. no idea if it's intended or will be changed at some point
Should I just keep using this? Or what are the alternatives
I'd say use the enums, PermissionFlagsBits or Permissions.Flags in this case
Can I use EnumResolvers to get it with the string instead?
why do you prefer an EnumResolver (which might be removed before the v14 release) over PermissionFlagsBits.ManageGuild?
you could even use PermissionFlagsBits['ManageGuild'] if you prefer ''
https://clue.isadev.tech/🦨💷🥜📎
because I have it like this in my commands, ill just change that ig
you can't use enumresolvers with that kind of input, it would have to be SCREAMING_CASE
no, use the d.js one, it's re-exported
ok
https://clue.isadev.tech/🥦🎣🧟🆒
is there a way to parse the permission string from a bigint
you could probably achieve it with the PermissionsBitField class, it's not a "real enum" so it won't work both ways
which method?
create a new instance and use toArray (should be called like that). what do you want to do exactly, there might be easier ways to do so
convert for example 32n (bigint) to 'PermissionName'
ig new PermissionsBitField(perm).toArray() should cover this, would also work with multiple permissions at once
perfect, thanks
EnumResolvers are being removed I wouldnt rely on them
what's the intent for joining a guild?
GUILDS
thank you
Are the message commands disabled in v14 now?
no
discord.js emits the event, what you do with that is on you
if you need content, supply and enable the intent - if your bot requires verification you have to apply for the intent and discord decides if it wants you to have it or not, "i need it for legacy content based commands" is, however, not a valid reason for them
Is placeHolder requied for modals?
the text input placeholder is not required
okay tnx
am I need Discord.GatewayIntentBits.GuildVoiceStates for listening to voiceStateUpdate?
obviously, yes
😄
tnx! and something else
I have an interval in my ready event, Now for example I define something like a server there (outside the interval) and if I made some changes in my server for example change the server avatar, in the interval the avatar will changed too or not?
let iTzClub = client.guilds.cache.get('553528389898862594')
setInterval(async () => { console.log(iTzClub ) }, 360000);
I mean if I change something in the server the result of console log will changed too or not?
if the guild isn't removed from the cache (either by leaving it or manually) the reference still points to the object in cache
d.js patches objects in place
yes
why are you on a weird docs branch
Its merged so just look at main docs
in discord.js@dev message intent doesn't work (if u dont have it) ?
its supposed to work till a few more months...
If you dont have it you dont have it
if youre in less than 100 guilds theres nothing stopping you from having it
It needs to be enabled on API v10
so discord.js@dev uses new api version
yes
Hi, I'm having an issue with ButtonBuilder in which .setEmoji() on a ButtonBuilder isn't working. Any ideas what could be causing this?
return typeof value === "string" ? Result.ok(value) : Result.err(new ValidationError("s.string", "Expected a string primitive", value));
^
ValidationError: Expected a string primitive
at StringValidator.handle (C:\Users\***\Desktop\***\discord\node_modules\@sapphire\shapeshift\dist\index.js:1372:70)
at StringValidator.parse (C:\Users\***\Desktop\***\discord\node_modules\@sapphire\shapeshift\dist\index.js:114:88)
at ButtonBuilder.setLabel (C:\Users\***\Desktop\***\discord\node_modules\@discordjs\builders\dist\index.js:604:48)
at listTemplates (C:\Users\***\Desktop\***\discord\commands\info\progress.js:486:5)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
validator: 's.string',
given: { name: '▶️' }
}```
```js
const buttons = [
new ButtonBuilder({})
.setEmoji({ name: '◀️' })
.setStyle(ButtonStyle.Secondary)
.setCustomId('prevpage'),
new ButtonBuilder({})
.setLabel({ name: '▶️' })
.setStyle(ButtonStyle.Secondary)
.setCustomId('nextpage'),
];```
oh wait i didn't change the second button to .setEmoji
im dumb nevermind
embed builder no longer have .length property?
new ButtonBuilder({})
-> .setLabel({ name: '▶️' })
.setStyle(ButtonStyle.Secondary)
.setCustomId('nextpage'),
];

I think setLabel takes a string
Not object
const list = await client.guilds.cache.get("GUILDID").members.cache;
list.forEach(member => {
fs.appendFile("mems.txt", member.user.id + "\n");
});
hey im trying to list all members on the guild, i get 191 but theres 247 members on there
a big portion of them didnt write anything for a longggg time
you are iterating all cached members
GuildMemberManager#fetch()
Fetches member(s) from Discord, even if they're offline.
ohhh
is it an array what comes out of it?
well, click on the docs link above
Returns: Promise <(GuildMember|Collection <Snowflake, GuildMember>)>
Hello, i try to fetch the Guild Owner
.addFields(
[{
name:'» Server Owner',
value:`\`${interaction.guild.fetchOwner().then(res => res.name)}(${interaction.guild.ownerId})\``,
inline: false
}]
)
but in my embed it looks like this:
Hi, Constants.Events... to was replace by what ? Please c:
because you're not awaiting the promise
and a GuildMember doesn't have a name property
i tried reading the collection docs but i cant find out how i get an array from this thing
you mostly likely don't really want an array
you can just iterate the collection instead
hmmm
Additional Information: Collections
read more
ok, the name i have changed? and what else do I have to change?
Thanks 😄
i just need the ids of the members in an array or something like it to forEach through it
fetchOwner() returns a promise, but you should already know that as you used .then() (which still returns a promise)
await it
or just store the owner in a separate variable
then you may want to read the guide linked, it solves that
(note that ids are keys for that collection)
ok
TypeError [ERR_INVALID_ARG_TYPE]: The "cb" argument must be of type function. Received undefined
i think im on the wrong trip
await client.guilds.cache.get("776180755126157312").members.fetch().then(collection => {
collection.every(member => {
fs.appendFile("mems.txt", member + "\n");
});
});
You should be using appendFileSync
hmmmm
it only puts one member id in the file wtf
Use forEach instead of every
its an collection
Ok
Collections extends Map
hmmmm
mmmmh
ohhh bruh i forgot that
noiiice
i have every id
Frequently Asked Questions: learn more
How can i fix this?
guarding or asserting the channel type - presumably the former
Are there docs for localization yet?
what kind of localization
"discord.js": "^14.0.0-dev.1652443445-d522320",
use guild.members.me
thx
is the guide being update for v14
https://thumbsnap.com/i/dNSYmjmL.png https://thumbsnap.com/i/1vKBjmtG.png why is the ping not going through?
there’s a link to the v14 guide in the pins if that’s what you were asking
that's hasn't been updated for a long time
But there's nothing to update
and no one wants to help me, okay 
repliedUser:true
add that
Discord.GatewayIntentBits.DirectMessageReactions,
Discord.GatewayIntentBits.DirectMessageTyping,
Discord.GatewayIntentBits.DirectMessages,
Discord.GatewayIntentBits.GuildBans,
Discord.GatewayIntentBits.GuildEmojisAndStickers,
Discord.GatewayIntentBits.GuildIntegrations,
Discord.GatewayIntentBits.GuildInvites,
Discord.GatewayIntentBits.GuildMembers,
Discord.GatewayIntentBits.GuildMessageReactions,
Discord.GatewayIntentBits.GuildMessageTyping,
Discord.GatewayIntentBits.GuildMessages,
Discord.GatewayIntentBits.GuildPresences,
Discord.GatewayIntentBits.GuildScheduledEvents,
Discord.GatewayIntentBits.GuildVoiceStates,
Discord.GatewayIntentBits.GuildWebhooks,
Discord.GatewayIntentBits.Guilds,
Discord.GatewayIntentBits.MessageContent,
try all the intents
and partials
this is v13 ig
BRO
ur CODE
what's the difference?
check the docs
things change bud
ok so
try the other one
and see
There is a way to know if a member click here ?
No
oof
https://thumbsnap.com/i/889P3FRy.png not work ```js
const { GatewayIntentBits } = require('discord.js')
const Mean = require('./client/Mean');
const mean = new Mean({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildScheduledEvents,
GatewayIntentBits.MessageContent
],
allowedMentions: {
parse: ["users", "roles"],
repliedUser: true
}
});```
uhhh
who pinged me
¯_(ツ)_/¯
Guild#me => GuildMemberManager#me and Guild#fetchOwner() => GuildMemberManager#fetchOwner() ?
hi, how can i set bot activity in discord.js v14 cuz setPresence and setActivity dont work ://
they do
you just need to use the ActivityType enum for the type option
where can i search activity types?
thank you
In this command, I ping the specified user in the parameters of the slash command, and not myself :(
huh?
What is it? what is not clear?
fetchOwner is still in guild, otherwise yes
guild.members.me
guild.fetchOwner()
alright thanks
Slash command localization
ExpectedConstraintError: Invalid string format
at Object.run (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@sapphire\shapeshift\dist\index.js:1413:64)
at StringValidator.run (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@sapphire\shapeshift\dist\index.js:106:27)
at UnionValidator.handle (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@sapphire\shapeshift\dist\index.js:983:32)
at UnionValidator.parse (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@sapphire\shapeshift\dist\index.js:113:88)
at validateDefaultMemberPermissions (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:964:36)
at MixedClass.setDefaultMemberPermissions (H:\IdrisGaming\Discord Bot\ObitoInteractions\node_modules\@discordjs\builders\dist\index.js:1458:29)
at Object.<anonymous> (H:\IdrisGaming\Discord Bot\ObitoInteractions\commands\moderation\ban.js:12:10)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
constraint: 's.string.regex',
given: 'BanMembers',
expected: 'expected /^\\d+$/.test(expected) to be true'
}
how am I supposed to write the permission?
you have to pass the permission number in a string (or not)
just use the enum
PermissionFlagsBits.BanMembers
I thought we were able to pass strings like Permissions#has() ._.
the builder would have to be extended in discord.js to add support for that
but its not currently
good to know
thanks for the info
Does anyone have an idea how to get the information from a command / that activates a modal, like
/ping <option=180>
So get the value 180, now a form opens and at the end we get the value 180, I succeeded with a new Collections() except that if the person decides to close the form it can distort its value :/
config.VerifiedRoleId is not a role id
is it a string or number?
Getting Response: Internal Server Error status: 500 is Discord API issue, not my Bot or D.js, right?
rest@dev seems to be missing a case to handle emoji creation?
it checks
if (status === 401 || status === 403 || status === 429)
if (status === 200)
if (status === 429)
if (status >= 500 && status < 600)
if (status >= 400 && status < 500)
else return null;
but guild emoji creation is sending back a 201 (http "Created") so it falls through all code checks and returns null instead of decoded json
this is resulting in GuildEmojiCreateAction.handle trying to access createdEmoji.id while createdEmoji is null, and crashes
const already = guild.emojis.cache.has(createdEmoji.id);
^
TypeError: Cannot read properties of null (reading 'id')
at GuildEmojiCreateAction.handle
is this known? did i mess up? should rest@dev not be used?
oh nvm this was edited yesterday, i was in a weird branch
@woven grove seems like #7747 killed emoji upload :(
Based on your messages I don’t know what’s wrong now
Since you just said you were on a weird branch?
ignore that sorry, i just mean i was searching blame in a weird branch. once i got on main i saw that it was indeed a recent change
Yeah it was most likely the undici PR
Can u make a tiny bot that reproduces the issue
Like a one file bot or smth
ig yeah
How to pass intents into this version/
I seem to run into an error when trying to pass them in
they arent a property of Discord
you should read this -> https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html
If you missed the updates, EnumResolvers are now gone, you'll need to use enums from djs only now.
getting Discord API Error 10015: Unknown Webhook when attempting to use button interactions to delete a message a bot sent
the bot has GuildMessages, DirectMesasges, Guilds, and GuildWebhooks intents
awaiting button.deleteReply() does not help, but i noticed that it's only firing after 3 seconds, which is intriguing
can anyone else confirm this or offer guidance?
I think it happens when you didn't reply and tried to delete reply
it's not possible to add a button to a message that doesn't exist -- the message is still visible, not deleted, and is not ephemeral
you can do deleteReply() if you replied to the interaction using deferReply/deferUpdate/reply/update methods do <ButtonInteraction>.message.delete() if you want to delete the message to which the component was attached
that's actually incorrect, read this response for details
what about doing button.message.delete() instead
when you receive a button interaction its not like you are receiving an interaction with the same reply as the one that sent the message with the button in it, so if you are calling buttonInteraction.deleteReply() directly after receiving the interaction then your error is normal.
@hybrid crest (sorry i forgot to reply to you)
well re reading the context again, did you try to use buttonInteraction.message.delete()? or, you could try to save the first interaction response (the one that has the buttons in it) and then call deleteReply() over that one
please read the message that i replied to; it specifically recommends using buttonInteraction.deleteReply() as it doesn't require the manage messages permission
on a side note, i bring this up in here also because .update() isn't working either, leading me to believe that webhooks aren't being stored correctly
things sent by the bot through interactions have a webhook token stored, but the thing that's confusing me is that i'm getting halted for three seconds until a timeout would occur, and then getting "unknown webhook" in reference to the first interaction
could you share the relevant code for this? that could help a bit
do you want to get it from a regular message?, i dont think thats possible tho
I have an error handler and all of a sudden I'm being spammed with multipleResolves immediately after the bot loads, of a Promise containing all interaction commands. It doesn't affect my bot's functionality whatsoever, but why might this be happening? I'd prefer to not have to disable that specific error logger.
Unsure if this is a djs@dev issue or not, but thought I'd post it here
i've divided my code up into multiple files, but the execution freezes as soon as it tries to interact with the existing interaction in any way; both .update and .deleteReply are failing to work (with .deleteReply failing even as the first line executed, and when awaited)
the bot doesnt send anything please help me.
that's not possible
show your code
What is a TextInputComponent? is it like a modal?
Yes it's for modal
thanks
is that a bug?? No content??
looks like a message including an embed if you have embeds disabled in user settings
const {
Client,
ChatInputCommandInteraction,
ApplicationCommandType,
ApplicationCommandOptionType,
EmbedBuilder
} = require("discord.js");
module.exports = {
name: "ping",
description: "Returns a WebSocket ping.",
type: ApplicationCommandType.ChatInput,
options: [
{
name: 'ephemeral',
description: 'Do you want to do the message ephemeral?',
type: ApplicationCommandOptionType.Boolean,
defaultMemberPermission: 'Administrator'
}
],
/**
*
* @param {Client} client
* @param {ChatInputCommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction, args) => {
const [ephemeral] = args;
const pongMessage = await interaction.reply({ content: 'ping??', fetchReply: true, ephemeral: ephemeral })
const embed = new EmbedBuilder()
.setAuthor({ name: '🏓 Pong!'})
.setColor('#008000')
.setDescription(`Bots Ping: ${client.ws.ping}ms!\nApi Ping: ${pongMessage.createdTimestamp - interaction.createdTimestamp}ms!`)
.setFooter({ text: interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ dynamic: true }) })
return interaction.editReply({ embeds: [embed] })
}
}
I doesnt know what you mean and I dont know user settings
if you disable that bot embeds do not display
I doesnt disabled it
looks very much like you did
@dawn phoenix
look this this had a content but doesnt appear.
that code sends an embed
look carefully
?
const pongMessage = await interaction.reply({ content: 'ping??', fetchReply: true, ephemeral: ephemeral })```
ephemeral is defined
i have no idea what you are trying to hint at, but you are definitely - ultimately - sending an embed.
yes but why the content doesnt appear?
the embed itself doesn't show.
it's sent, it just doesn't show on your end
so you either have links disabled, discords embedding service has a hiccup, or something else blocks the display of embedded content
the only considerable instance i have seen of this (over years, repeatedly) is people disabling the "embed link previews" user setting
what does logging pongMessage give you?
it should help you narrow it down
???
const { Client, ChatInputCommandInteraction, ApplicationCommandType } = require("discord.js");
module.exports = {
name: "test",
description: "just a test",
type: ApplicationCommandType.ChatInput,
/**
*
* @param {Client} client
* @param {ChatInputCommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction, args) => {
interaction.reply({ content: 'Working' })
}
}```
no idea
is this a bug on discord API????
Okay.
so kindly stop pinging me, i don't know, i cannot help you
the only version of this i have seen is embeds being disabled
when discord.js v14

when it's ready
when V14 is going to be stable?
literally 2 messages above yours
i just saw them lol
How different is v14 relatively v13?
check the pinned guide
how can I close the modal after submit?
send a reply
thanks
Hi, there is still no way to know via the API if a member is timeout?
Documentation suggestion for @proven wolf:
GuildMember#isCommunicationDisabled()
Whether this member is currently timed out
still no way
There... was never not a way
thanks
I wanted to talk about a list as for the bans to know for example if a user who left the server is timeout or not.
How do we do .setPrecense in djs v14?
modals are coming out in v14 right ?
yes
Documentation suggestion for @granite yacht:
ClientUser#setPresence()
Sets the full presence of the client user.
thats djs v13...
i need it in djs v14
ClientUser#setPresence()
Sets the full presence of the client user.
THAT DOSENT WOK
only the status
is the type right?
client.user.setPresence({ activities: [{ name: 'Test', type: ActivityType.Watching }], status: 'online' });
Where is activityType ?
like wich package?
discord.js ?!?!?!!?
if you made the type a number here it should work
^^^^^
not working
const { ActivityType } = require('discord.js')
can you send your code (rather than just a screenshot)?
setInterval(() => {
const activity = activities[Math.floor(Math.random() * activities.length)];
client.user.setPresence({
activities: [
{
name: "Test",
type: "3",
},
],
status: activity.status
})
}, 10000 );
you didn't make it a number?
I did?
no?
looks like a string to me
Its how my friend said it was gonna be xD
that– do you know javascript?
a number doesn't have quotes
I'd suggest learning basic javascript
I KNOw JS

make it a number then
I did
and?
Still not working 🙂
well send your new code
setInterval(() => {
const activity = activities[Math.floor(Math.random() * activities.length)];
client.user.setPresence({
activities: [
{
name: activity.content,
type: 2
},
],
status: activity.status
})
}, 10000 );
and show what activities is
is this after the client is ready?
in the ready file
that code should be working– can you send the whole file?
how do i remove permissions for @everyone when creating a new channel?
the guild id represents the @everyone role
so?
use the permissionOverwrites option and pass the guild id as the id
are modals limited only to interactions or can we use them for messages as well?
interactions
also interaction.update for a select menu now returns unknown interaction after updating to 13.7
any reason why?
error
ok i found it
they should be all caps
im guessing
use the ButtonStyle enum
that is v13 code
addComponents takes an Array
ty bro
So whenever i create a voice channel currently after updating it returns a Type Error, its just this Simple line and thats the output i get from it ? Something that i am missing perhaps ? some bug ?
I was able to reproduce that. Seems the channel does get created though
Yea it gets created but it throws an exeception notheless
I have no idea why we're receiving null when creating a channel
Nvm now I do
Seems to be a rest bug, rip
this bug seems to be pretty new tho 0.o
Probably something added recently.
doesn't throw on my end 
djs 14.0.0-dev.1652443445-d522320
i am on djs 14.0.0-dev.1647259751.2297c2b
update to the latest @dev and try again
isnt that the latest ?
what i sent is the latest
yours is 2 months old according to npm
same issue
@warm basin https://github.com/discordjs/discord.js/pull/7919 fixed that issue for me. The status when creating a channel was 201, but we were only looking for 200 which returned null, bad bad bad. It should be rolled out into the next dev version... so <t:1652572800:R>
okay, sounds great, thanks ;D
my modals wont show up, how can i fix it, my code is:
const modal = new ModalBuilder()
.setCustomId('suggestionmodal')
.setTitle('Suggestion');
const titleofsuggestion = new TextInputBuilder()
.setCustomId('titleofsuggesation')
// The label is the prompt the user sees for this input
.setLabel("Whats the title of your suggestion?")
// Short means only a single line of text
.setStyle(TextInputStyle.Short);
const thesuggestion = new TextInputBuilder()
.setCustomId('thesuggestion')
.setLabel("What is the suggestion?")
// Paragraph means multiple lines of text.
.setStyle(TextInputStyle.Paragraph);
const titleactionrow = new ActionRowBuilder().addComponents([titleofsuggestion])
const suggestionactionrow = new ActionRowBuilder().addComponents([thesuggestion])
modal.addComponents([titleactionrow, suggestionactionrow, ]);
// Show the modal to the user
await interaction.showModal(modal);
are you getting any errors?
nOPE
did you run this code?
Yes
add a console.log() in there to make sure that is executing
TextInputStyle is undefined
can how can i fix this
By defining it?
Anyone can say me how to make this type of embed?
It worked now, kinda
but i get this error
show the code
they just make the color the same as the embed background, no?
<EmbedBuilder>.addFields([ your fields])
const modal = new ModalBuilder()
.setCustomId('myModal')
.setTitle('My Modal');
// Add components to modal
// Create the text input components
const favoriteColorInput = new TextInputBuilder()
.setCustomId('favoriteColorInput')
// The label is the prompt the user sees for this input
.setLabel("2 One")
// Short means only a single line of text
.setStyle(TextInputStyle.Short);
const hobbiesInput = new TextInputBuilder()
.setCustomId('hobbiesInput')
.setLabel("First one")
// Paragraph means multiple lines of text.
.setStyle(TextInputStyle.Paragraph);
// An action row only holds one text input,
// so you need one action row per text input.
const firstActionRow = new ActionRowBuilder().addComponents([favoriteColorInput]);
const secondActionRow = new ActionRowBuilder().addComponents([hobbiesInput]);
// Add inputs to the modal
modal.addComponents([firstActionRow, secondActionRow]);
await interaction.showModal(modal);
that's not it
then how?
i meant that is not the code that caused that error
Then what do i show?
the code that caused the error
which involves interaction.editReply()
Theres no EditReply
last line of the stack trace?
Where?
this?
I meant read the last line
at ...editReply
somewhere in your code you're using <interaction>.editReply(), which is causing that error
I cant use it?
you can use it under certain circumstances
i was just asking for you to show the code where you're using it
your editing nonexistent message
I defered the reply doe...
if it's not the same, it's a similar colour, why does that matter?
it doesn't make it a different "type of embed"
fetch the message, grab the embed data and see if you can find what you want
you just saying no doesn't really help
why no lol
Lol
TypeError: Cannot read properties of undefined (reading 'permissions')
code
message.guild.me.permissions.has("SendMessages")
change to message.guild.members.me.permissions.has("SendMessages")
const client = new Discord.Client({
intents: [
Discord.IntentsBitField.Flags.Guilds,
Discord.IntentsBitField.Flags.GuildBans,
Discord.IntentsBitField.Flags.GuildMembers,
Discord.IntentsBitField.Flags.GuildMessages,
Discord.IntentsBitField.Flags.MessageContent,
Discord.IntentsBitField.Flags.GuildIntegrations,
],
});```
Error:
```if (!Object.hasOwn(given, key) || given[key] === undefined) {
^
TypeError: Object.hasOwn is not a function```
What's wrong?
outdated node version
oh
how to fix this error?
TypeError: Cannot read properties of undefined (reading 'permissions')
my script:
if (!msg.guild.me.permissions.has(PermissionsBitField.Flags.SendMessages)) {
// ...
}
in 14.0.0-dev.1652443445-d522320
thx
TypeError: Cannot read properties of undefined (reading 'me')
bruh
I... don't get how to use .addFields on an embed on the v14 preview
Is... there anything different from v13 on this? I found this example:
.addFields(
{ name: 'Regular field title', value: 'Some value here' },
{ name: '\u200B', value: '\u200B' },
{ name: 'Inline field title', value: 'Some value here', inline: true },
{ name: 'Inline field title', value: 'Some value here', inline: true },
)
addFields must be an array
addFields takes an array
your updated code?
Well that was my reasoning at first
if (!msg.members.me.permissions.has(PermissionsBitField.Flags.SendMessages))
guild.members
thx again :3
But it says Uncaught Error: Received one or more errors
following the stack trace, it's from addFields
catch the error and log it
Error: Received one or more errors at ArrayValidator.handle (C:\Users\06589\Programmation\repos\meaxisnetwork-bot\node_modules\@sapphire\shapeshift\dist\index.js:399:70) at ArrayValidator.parse (C:\Users\06589\Programmation\repos\meaxisnetwork-bot\node_modules\@sapphire\shapeshift\dist\index.js:113:88) at EmbedBuilder.addFields (C:\Users\06589\Programmation\repos\meaxisnetwork-bot\node_modules\@discordjs\builders\dist\index.js:244:54) at C:\Users\06589\Programmation\repos\meaxisnetwork-bot\commands\profile.js:13:6 at processTicksAndRejections (node:internal/process/task_queues:96:5) {errors: Array(1), stack: "Error: Received one or more errors\n at ArrayVal…jections (node:internal/process/task_queues:96:5)", message: "Received one or more errors"}
the error should include the wrong input and a hint at what's wrong
It's literally only that along with an array of 1 that also contains the same message
I'll check if the vars I used in my fields are defined
shapeshift errors override util.inspect which is used by console.log so logging the error with it should format it in a more readable way
I'm already logging the error tho
it doesn't use promises
The code where I create my embed is wrapped in a promise
I can put the embed part in a try-catch if you want
Wrapping into try catch actually showed me good input
CombinedPropertyError (1)
Received one or more errors
input[3]
| CombinedPropertyError (1)
| Received one or more errors
|
| input.value
| | ValidationError > s.string
| | Expected a string primitive
| |
| | Received:
| | | 128
```- OOOOH IT DOESN'T AUTOMATICALLY CONVERT TO STRING
Thanks for the help everyone
I feel dumb
Hi all, I'm having issues getting the embed from a message created by a followed channel (crossposted). I can catch the message using messageCreate, but the embeds array is 0 length. There is definitely an embed (and nothing else) in the incomming message. Any suggestions?
Embeds are always edited in by Discord
Is there a convenient way to catch that? I tried messageUpdated, but nothing was caught...
There’s no d
Just messageUpdate
Thanks, just need to wait for a new message to test lol. Hoping it was just a facepalm moment 😁
let newChannel = await message.channel.clone();
await message.channel.delete();
await newChannel.send({ content: 'Please enjoy with a new channel :)' });```
Error: Cannot read the proterties of null ( reading: 'id' ) at node:modules
so I need to update my djs@dev?
yes
Finally had a message come through from the other server, but its not triggering messageUpdate. (I tested with my own message, and the event is firing, just not for messages coming in from the other server). Any suggestions where else i could look? I've tried getting messages from the channels message cache but they seem to be missing the embed as well...
Can you show how the client is defined?
That enough?
Need MessageContent intent
Ooo, that makes sense. Thank you for your patience! Fingers crossed that fixes it.
#7876 in discordjs/discord.js by KhafraDev merged <t:1652434508:R>
feat(EnumResolvers): remove Enumresolvers
@scarlet tangle ^
Thanks Kinect! Legend
channel.clone() and channel.delete() doesnt work.
Cannot reproduce
cannot find the id of null
How do I delete the old Slash?
Usually people would post their version alongside the problematic code sample... btw. You're just on an old version
okay thanks
help
it's guild.members.me now
can I have a docs so I don’t need to ask for that tiny errors?
GuildMemberManager#me
The client user as a GuildMember of this guild
no I mean a djs v14 docs
that is that
That's is v14 docs atm
you can select the branch on the site
Until v14 becomes stable and we start working on v15
djs@v15??
soon™
Im excited to test it!!
it's not even in the plans yet
v14 comes before v15 
yeah I know but if the djs@v15 publish I will test it lol
how do I set the slash command default permission?
interesting, just tried using embed fields function, i wonder what methods got changed for that in v14
Documentation suggestion for @manic lynx:
SlashCommandBuilder#setDefaultMemberPermissions()
Sets the default permissions a member should have in order to run the command.
perfect
quite a bit, look at the pinned messages to see the guide
wait i actually used prefix method but alr, i will also check that
It worked, Ty
Im not using slash command builder. @scarlet tangle
addFields() not addField()
and also its returns array
Welp alr
I assume there is no way to determine if a Modal was cancelled? Is this an oversight or a limitation of Discord API?
the latter
Wow, that's quite terrible. How can Discord claim this to be a "replacement" for the awaitMessages way of collecting a response when there's glaring flaws like this.
You cant determine if someone didnt sent a message too btw
I think they mean the time option that collectors have
You can work around that by simply waiting for the message to arrive (or filter for the response you want) or awaitMessages to time out. Even if the user fucks up and types something incorrectly, you can work with that by showing an error, or just filtering the messages so that only the correct message gets collected. With Modals, once the user cancels the Modal, there is no going back. The user can't open it again, and has to wait for the collector to time out before they can attempt again.
This sounds like some massive oversight on Discord's part, unless I'm missing something here.
tbh to them, the interaction type is called MODAL_SUBMIT
So what are developers supposed to do if a user accidentally cancels the Modal or decides that they want to cancel it and press a different button (which should bring out a different Modal)?
Just have a timer on waiting for the modal
And make sure your Modal customIds are unique so your listeners don't overlap and duplicate
I do this by putting the interaction I'd in it
I do have a timer on it. I'm currently using awaitModalSubmit for all my modals. The problem here is that the code won't continue unless the timer runs out, or the modal is submitted. I suppose I will have to switch to collectors for this.
I'm not sure how that will change things
With collectors, wouldn't it be continuing before they've submitted in this situation?
so im using awaitModalSubmit() to collect modal interaction.
how would i prevent multiple collectors (persists if the user cancelled the modal) responding to 1 single modal interaction?
Use unique customIds
I do this by putting the interaction id that launched the modal in the modals custom id
components[0].components[5][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width?
You put too many things in action row
^ max 5 in one row
yeah i remember now, the limit is 5
Max 5 buttons or 1 select menu or 1 text input
(node:3909536) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
at emitExperimentalWarning (node:internal/util:224:11)
at new Blob (node:internal/blob:138:5)
at _RequestManager.resolveRequest (/root/Bots/Ayako-v1.5/node_modules/@discordjs/rest/dist/index.js:887:36)
at _RequestManager.queueRequest (/root/Bots/Ayako-v1.5/node_modules/@discordjs/rest/dist/index.js:845:46)
at REST.request (/root/Bots/Ayako-v1.5/node_modules/@discordjs/rest/dist/index.js:995:32)
at REST.post (/root/Bots/Ayako-v1.5/node_modules/@discordjs/rest/dist/index.js:986:17)
at TextChannel.send (/root/Bots/Ayako-v1.5/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:175:38)``` whats this
Its a warning but i think you should update node
just a warning, nothing to worry about
So are modals introduced in v14? Or are they in v13 too
they are in 13.7, the latest stable version yea
Alright
there's a wip guide for it that's currently a pr
Im gonna worry anyways >:)
I want to be able to open a modal on button click or on select menu is that possible?
yes, (button/menu)interaction.showModal is a thing
thnx
not guild members
i - command interaction
it seems like i is a Number ._.
if i is a CommandInteraction why are you doing i++
👌
How can I show another modal after the user replied to the 1st one?
You can’t
how i add choices to ín v14?
.addStringOption(option =>
option
.setName('item')
.setDescription('A description')
.addChoices([
{
name:'North Country Parka',
value:'ncp'
},
{
name:`Worker\'s Cap`,
value:'wc'
},
{
name:'Angry Rain Boots',
value:'arb'
},]
)
so I'm not sure if this is intended or not or if maybe I'm just dumb.
since the perms v2 change, I've continued to use defaultPermission: false and when doing so the command will show in the Integrations tab as denied for everyone as expected. with the d.js changes merged for perms v2 I decided to move to the new system and use default_member_permissions: '0' instead.
I found that using my existing method of Guild#commands.set was having no effect and the commands were still usable by others
so I moved my command registration to the preferred method of rest and find that yes now people without the overwrites/admin etc can no longer use the command(s) however in Integrations it still shows the command as allow for everyone and I don't know why
this seems fine, you got any errors?
yes
first,uninstall builders and update djs to the latest commit
wait what the heck, now it takes a rest parameter? 😭
@frigid sleet don't pass an array, pass multiple parameters
oh, without the array, that works,, thanks
thanks for the clarification. I assumed as much but just wanted to check here in case
oh ty ty!
How do I import the user class?
I'm trying to run checks with instanceof
const { User } = require("discord.js");
Wouldn't it be import { User } from 'discord.js';?
it depends
It's safe to use the client rest to deploy guild commands, instead of creating a new rest
yeah but like the whole point of the guide was to detach the bot process from the registering process
if you call the method through djs, you're most likely going to be making needless api calls leading to api spam leading to you getting rate limited
it's just considered best practice, that's all
Got it, thanks
we highly recommend the approach in the guide
I'm making a program that actually reads the command deployment json, compares it to the currently registered commands and then makes any changes needed.
So you could do something like that.
(shit im very late to this)
Are you using v14?
Yes
numbers can be text
You cant restrict it to just numbers though
How to... not doing something? I did say "cant"
IntentsBitfield in v14
If you're looking at the v14 changes preview guide sure
See pins
Just that page
Does .setRequired(true) exist in modals?
No
Alr
Uhm, how do i fix this?
Dont use getTextInputValue method on undefined
What do i use then?
Call this method on ModalSubmitFieldsResolver
???
Wdym? @copper jetty
Documentation suggestion for @granite yacht:
ModalSubmitFieldsResolver#getTextInputValue()
Gets the value of a text input component given a custom id
soo
interaction.ModalSubmitFieldsResolver.getTextInputValue("value")?

<ModalSubmitInteraction>.fields is ModalSubmitFieldsResolver
interactionModal.getTextInputValue("value")
do i have to import anything from the djs package to get it to work?
No
can u type an example ?
interaction.fields.getTextInputValue(name)
Didnt work
I get the getTextInputValue undefined
you need to import fields from the interaction that comes from the awaitModalSubmit
show the code
I get this now in interactionCreate
show the code
Works now
, i had a deferreply that i wasnt supposed to have 🤣
Whats the new GUILD_TEXT on channel
as im trying to check if its the right channel type
chnl.type !== "GUILD_TEXT"
this is the one currently
worked in djs v13, but not v14
GuildText probably
Ill try that
Didnt work
chnl.type !== "GuildText") this is it rn
const chnl = interaction.options.getChannel("channel")
thats the code for the chnl
why do you need that anyway, just use the typeguard, chnl.isText()
Soo
if(chnl.isText()) {
console.log("true")
Like that?
that would be one way, yes
ill test that
That worked 😄 Ty ❤️
Im currently changing from djs v13 to djs v14
bc of modals xD
pst, modals are on v13 
we srsly need that announcement
WHATTTT
