#djs-in-dev-version
1 messages · Page 27 of 1
might be because discord.playing is undefined and that trips 0? which is Playing, which is "playing..."
So how do I set it to watching or listening or streaming?
Like that’s what I am trying to do… I have 4 messages. Playing on a MC server, watching a YouTube video, listening to a podcast and streaming to twitch…
The message and links are all in a database that gets pulled from in a loop… so that’s why I need to figure out what to put in the field to make it work…
by importing it as shown above, with the respective types, as shown here - for example
Ok so then I would just have to basically use an if statement to check what it is in the database and then use the correct import.
alternatively saving the numbers and supplying/casting those
here, start counting at 0
(and note that custom is not available for bots)
-ev Discord.StatusType.Watching
maybe not by trying to eval things on my bot
Can we add more than 4 buttons(interaction)
you can add up to 25 buttons per message
When I tried v13 it gave Warning on more than 4, does it allow more in v14 or Each row has 4?
each row can have up to 5 buttons (nothing else), in v13 and 14
ERROR
this.components.splice(0, this.components.length, ...components);
^
TypeError: Found non-callable @@iterator
at ActionRowBuilder.setComponents (C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\node_modules\@discordjs\builders\dist\index.js:530:21)
at Client.<anonymous> (C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\index.js:24:45)
at Client.emit (node:events:527:28)
at MessageCreateAction.handle (C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\node_modules\discord.js\src\client\actions\MessageCreate.js:23:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketShard.onPacket (C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:22)Green\node_modules\discord.js\src\client\websocket\WebSocketShard.js:304:10)
at WebSocket.onMessage (C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:527:28)
CODE
let ticket = new ActionRowBuilder().setComponents(
new ButtonBuilder().setCustomId("ticket").setStyle(ButtonStyle.Secondary).setLabel("Open Ticket").setEmoji("📩")
);
let embed = new EmbedBuilder()
.setTitle(message.guild.name)
.setDescription(`Para abrir um ticket click no \"📩\"`)
.setColor(client.color)
message.channel.send({ embeds: [embed], components: [ticket] })```
plys welcome
const { Client, Collection, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js");
setComponents takes an array
what dear matrix i'm here to wonder how to fix the code not that has a matrix
Monbrey told you
and oq takes I don't know bro i don't intendi oq he talked
no idea what you're saying
in idea what he's saying
no idea
what's so hard to understand about that
const { Client, Collection, EmbedBuilder, ActionRowBuilder, ButtonBuilder, setComponents } = require("discord.js");
let ticket = new ActionRowBuilder().setComponents(
new ButtonBuilder().setCustomId("ticket").setStyle(ButtonStyle.Secondary).setLabel("Open Ticket").setEmoji("📩")
);
setComponents() takes an array
Dude has no sense of what he said
that's what I want to say to you right now
my send code fix
No we will not fix your code
send me the fixed code
no
C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\node_modules@discordjs\rest\dist\index.js:709
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, res.status, method, url, requestData);
^
DiscordAPIError[50035]: Invalid Form Body
components[0][COMPONENT_TYPE_INVALID]: The specified component type is invalid in this context
at SequentialHandler.runRequest (C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\node_modules@discordjs\rest\dist\index.js:709:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\node_modules@discordjs\rest\dist\index.js:512:14)
at async TextChannel.send (C:\Users\geren\OneDrive\Área de Trabalho\Ticket - Green\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:175:15) {
rawError: {
code: 50035,
errors: {
components: { '0': { _errors: [ [Object] ] } }
},
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'post',
url: 'https://discord.com/api/v10/channels/972624681133821992/messages',
requestBody: {
files: [],
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: [ { description: 'oi', color: 65280 } ],
components: [
{
type: 2,
emoji: undefined,
custom_id: '1',
style: 2,
label: 'Open Ticket'
}
],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined
}
}
}
You have to put the button in a row
Dev is the same, but you don’t include Message in the class name
man much more really thank you finally someone who sends the docs instead of just talking shit
not our fault you don't understand what an array is
How do I echo the picture a user attached in a command back to the user?
reply = { content: textResponse, attachments: [interaction.options.getAttachment('photo', false)] };
Is what I tried
I also tried this function that I wrote since calling toJSON on the attachment object doesn't seem to match the Discord API:
function attachmentConverter(att) {
var response = att.toJSON();
return {
id: response.id,
filename: response.name,
description: response.description,
content_type: response.contentType,
size: response.size,
url: response.url,
proxy_url: response.proxyURL,
height: response.height,
width: response.width,
ephemeral: response.ephemeral
};
}
That doesn't seem to work either
Use files, not attachments
@thick prism
Monbery literally told you that you needed to put the code into an Array.
That's literallly 2 characters [...]
We're not here to code for you.
#rules 2️⃣ & 5️⃣
Wondering how this guy hasn't met the Hammer yet 
that was hours ago, kindly move on, thanks 
Can modal be shown by clicking a button ?
yes ButtonINteraction.showModal
I get this error DiscordAPIError[40060]: Interaction has already been acknowledged.
nope
i deferUpdate every interaction though (in interaction event)
there you go, deferring is replying
i need to get the submittion info in the command file itself as im using a command handler
construct new InteractionCollector or use awaitModalSubmit()
k thx
const menu = new SelectMenuBuilder()
.setCustomId('maintenace')
.setPlaceholder('Defina uma função:')
.addOptions([
{
label: 'BOT',
description: `Coloca o BOT em manutenção.`,
emoji: '🤖',
value: 'bot',
},
{
label: 'Comando',
description: `Colocar algum comando em manutenção.`,
emoji: '📃',
value: 'command',
},
]);
Is this way to build a SelectMenu in v14 correct?
emoji takes an object { name: "" }
const menu = new SelectMenuBuilder()
.setCustomId('maintenace')
.setPlaceholder('Defina uma função:')
.addOptions([
{
label: 'BOT',
description: `Coloca o BOT em manutenção.`,
emoji: { name: '🤖' },
value: 'bot',
},
{
label: 'Comando',
description: `Colocar algum comando em manutenção.`,
emoji: { name: '📃' },
value: 'command',
},
]);
try using option builder
SelectMenuOptionBuilder
Represents a select menu option builder.
i tried using option builder in my code and it didnt work i had to use objects but maybe it will work for you
is this issue already known?
you didn't pass options into reply() method
i shouldnt need to pass it since it isnt required, + all of my other .reply are working normally, just crashing randomly sometimes
it is required trust me
you can still do .reply(string)
yes, but the options arent required
Yes they are
again, they arent
its literally on the types
if you pass in a string you dont need to pass options
The string is the option
but he is saying that i need to pass in the options object
when i literally dont have to
Nobody said that
again, my point is that i get random crashes with that error and i was just asking if its a known error
Show the code
JSON.stringify can return undefined
it isnt because results always returns an array of objects and guild is always defined (already checked)
Does it tho, log it
i did
Your error is caused by passing undefined (or nothing at all) to reply()
the thing is that im always replying
Lovely
new ActionRowBuilder<ButtonBuilder>()
pass the type to the generic
why is that even needed 
i don't have a clue
perhaps to split up the types for the modal actionrows and message action rows, i haven't kept up at all 🤷♂️
Because you’re using typescript
thats not the problem, they already have dynamic types for the components why not make the class itself dynamic 
why is this not in docs but written in type on the left? (neither is EmbedField or smth)
That type comes from discord-api-types
Which doesn’t have a docs site
How am i supposed to know how to write it in code then
Prob bc it’s ts types only
Most editors are good at giving hints
Otherwise, you can check the source code directly or the discord.dev docs
i think its just { name, value, inline }
is it possible to add a field to a specific position?
like I've an EmbedBuilder and I just want to add a field at the 3rd position
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?
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 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
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
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 });
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? 
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
@knotty plover should i open a issue on d.js?
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()] };```
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
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
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
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?
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
right I see, thanks
https://clue.isadev.tech/🥛👋🐆🥵
any difference in these? @outer bane
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
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'),
];

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
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
Use forEach instead of every
its an collection
hmmmm
mmmmh
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
I've already inserted it into the code, it didn't help
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
what's the difference?
check the docs
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
}
});```
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
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
???
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 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.
ClientUser#setPresence()
Sets the full presence of the client user.
client.user.setPresence({ activities: [{ name: 'Test', type: ActivityType.Watching }], status: 'online' });
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
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?
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.
i am on djs 14.0.0-dev.1647259751.2297c2b
update to the latest @dev and try again
isnt that the latest ?
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
By defining it?
Anyone can say me how to make this type of embed?
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?
last line of the stack trace?
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
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...
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!!
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.
Interactions: Building and sending buttons




