#djs-in-dev-version
1 messages · Page 29 of 1
is it a sharex theme
yes
On Discord developers portal
this intent is activated
maybe later on dm, not here
k
You can use <TextChannel>.awaitMessages instead of message collector
https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=awaitMessages
But i really dont know why you get a blank message content if your intent is activated and whitelisted
Are you sure is the same bot?
yes
i'll try
LET'S GO
ty
no
https://deploy-preview-1011--discordjs-guide.netlify.app/additional-info/changes-in-v14.html
and look for it, but i dont think if it`s changed
Btw, does await messageComponent still error if the time passed?
await message.channel.permissionOverwrites.edit('759445952452362290', { VIEW_CHANNEL: true, SEND_MESSAGES: true })
there isnt any err bot the code doesnt work any idea?
anyone?
when updating to TS 4.7.2, I started getting this error on the guildMemberAdd event
basically I have an array of objects which hold the name and the args of an event, typed using the ClientEvents interface from d.js, yet it's saying this, any idea why and how to fix this?
Can you show the relevant piece of code?
there you go, code and type definitions
- {
border-radius: 0px
}
?
how do you take round pictures like that
dm them or ask in general
Hi! How can I make the options of a SelectMenuBuilder remains selected after clicking on it?
set the default value to the option the user picked and unset it from the previous one
Just keep in mind, that changes what it shows to everyone who can see it
That why do this only if your select menu is displayed per user or if it is in ephemeral message
not passing an array
yes
how so?
Which are.....
Youre removing all the useful information
Thats still not really the useful part
Are you catching this error and console.logging it or is it unhandled
what would name.changedToAt be, a date?
Youd need to provide a string
yeah, a number then
Needs to be string
I have a question, what is #isFromMessage for in the modal options?
It checks if the modal was shown in response to an interaction from a message (button, selectmenu) rather than a slash command
Because that determines if you can use .update()
and, its in v13.7.0 dont exits? and why?
Because I didnt backport it properly 😄
Oh, and its possible create a pull request to add that?
ok np, thanks and good nigth
what the field amount limit for modals
25 rows/fields
why when I click 3 times in a row on the selection menu it shows unknown interaction?
that clicking 3 times in a row makes it reply to the same interaction
Documentation suggestion for @dim moss:
Attachment
Represents an attachment.
Are the new Permissions V2 options for SlashCommandBuilder() available in @ dev?
Thanks, thought i was going crazy, looked like they were in the doco lol
They are available in builders @dev
SlashCommandBuilder#setDefaultMemberPermissions()
Sets the default permissions a member should have in order to run the command.
Do i need to install builders separately? I just updated discord.js @ dev and cant get them working...
nope, they are included with djs 14
Strange, bot wont start with setDMPermission or setDefaultMemberPermissions
What changed in addOptions
That would cause Received one or more errors
String overflow
you need to pass an array
anyone know why since 4h or more i can't create roles anymore with my bot ? (I have permission, intents etc)
maybe rate limit
It was my first guess but there is no message and i waited 4h before retry
listen to client.on('rateLimit', console.log) and try to create a role
The role is not created and the event is not triggered
ahhh... im sorry once again i forgot this is the dev version, there is no ratelimit event there. Maybe listen to "debug" and "warn" instead

I got nothing related to a rate limit
Hm... can you show your code?
client.guilds.fetch(config.guild).then(async (guild) => {
console.log('pls work');
const role = await guild.roles.create({
name: this.name,
});
console.log('don\'t log because the promise never finish');
const cat = await guild.channels.create(`${this.name}`, {
type: ChannelType.GuildCategory,
permissionOverwrites: [
{
id: role.id,
allow: [PermissionFlagsBits.ViewChannel, PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.UseApplicationCommands],
deny: [PermissionFlagsBits.AddReactions, PermissionFlagsBits.SendMessages, PermissionFlagsBits.AttachFiles],
},
{
id: guild.id,
deny: [PermissionFlagsBits.AddReactions, PermissionFlagsBits.SendMessages, PermissionFlagsBits.AttachFiles, PermissionFlagsBits.ViewChannel, PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.UseApplicationCommands],
},
],
position: 1,
});
});
so it is safe to assume you have the guilds intent enabled, and the client is ready when you call this
Yep, this is my client if you want
const client = new Client({intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]});
``` role creation was working a few hours ago
oh wait in debug event what does that mean
Total: 1000
Remaining: 1000
``` is this a rate limit ?
no uh I think thats just the login information, you have a thousand logins per day so it might have been reset just now, but i think that is outside the scope of your issue, I honestly can't tell what is happening
, does this console.log('pls work'); get logged at least?
no this is why i put "pls work" here lol
okay so that means that the outside scope where this fetch call is is not being triggered either, what is before this? or inside what function are you calling this
v14's rest has a rateLimited event which you can listen to
🤔 i'm not sure to understand what you mean, the promise with role creation never resolve so the await is freeze forever that the problem
you mean like client.rest.on('rateLimited')? didn't know it got moved there, @hazy light try that one. And i meant that you have that code inside an event listener or something that is probably not being triggered either, unless the fetch is being called but never resolves
oh wait there is a misunderstanding the "pls work" get logged I didn't read your sentence correctly.
oh { timeToReset: 79442486, limit: 250, method: 'POST', hash: 'Global(POST:/guilds/:id/roles)', url: 'https://discord.com/api/v10/guilds/949615144894361620/roles', route: '/guilds/:id/roles', majorParameter: '949615144894361620', global: false } with client.rest.on('rateLimited')
I am getting this two error since I updated my package. It spams my whole console.
It was v14.0.0-dev.1651493371-4ba0f56
now I updated to ^14.0.0-dev.1653480262-68d5169
do you use <Guild>.me somewhere instead of <Guild>.members.me?
yes, in lots of places
should I replace it with guild.members.me?
yes
Thanks
How do you set a color into an embed?, a hex code returns an error?
22 hours of timeout, unless i did math wrong
yes if timetoreset is in ms
0xhexColor
if you use the reexported embedbuilder from d.js you can also use hex strings
enable ts strict mode
are there any official tools to help me learn v14?
there's a wip guide in the pins and main documentation, other than that you have to look at the commits on github
0.options[0].name[APPLICATION_COMMAND_INVALID_NAME]: Command name is invalid```
```JS
code: 50035,
errors: {
'0': { options: { '0': { name: [Object] } } }
},
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/979506674052243477/commands',
requestBody: {
files: undefined,
json: [
{
name: 'convert',
name_localizations: undefined,
description: 'Converts executes to the new format',
description_localizations: undefined,
type: 1,
options: [
{
type: 11,
name: 'Attatchment',
name_localizations: undefined,
name_localized: undefined,
description: 'File to convert',
description_localizations: undefined,
description_localized: undefined,
required: true,
autocomplete: undefined,
choices: undefined,
options: undefined,
channel_types: undefined,
min_value: undefined,
max_value: undefined
}
],
default_permission: true
}
]
}
}```
no capitals
What is difference between log_one.entries.first() and log.entries.first()?
variable names i assume
Okay it says when a user lefts the guild or has been kicked. So what should be the event for prune?
1n << 5n
Ty
I think its still that event, just... lots of them
I’ve only encountered it once but from what I recall it emits the guildMemberRemove event for each member pruned, unless Discord changed it
Okay
I get this error sometimes while using a interaction. How do I fix this?
Maybe your interaction token is expired
An interaction token is valid only for 15 minutes
by optimizing your code and reply within 3s
If you can't reply within 3s you can defer the reply (you can edit reply after defer within 13s)
Okay
I would like to know the reason for not assigning permissions
a small note: in the channel, no permissioners were assigned to all these roles
Why when I get the string name of my Slash command, on my test bot with guild scoped commands that works I receive the name. But on the production bot I receive undefined for the same piece of code.
The piece of code:
args.getString('name') is the part of the code where I get undefined on prod
Why don't you use interaction.options.getString('name') instead ?
ok, seems fine
So why I received undefined
do you know the answer?
Error:
DiscordAPIError[10062]: Unknown interaction
Code:
ctx.interaction.reply({ content: `${process.env.FAILURE_EMOJI} | **This user don't have any badges currently**`});
Why does it come?
uh
at ArrayValidator.handle (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:399:70)
at ArrayValidator.parse (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:113:88)
at EmbedBuilder.addFields (D:\Discord Bots\Just a tester\node_modules\@discordjs\builders\dist\index.js:244:54)
at IncomingMessage.<anonymous> (D:\Discord Bots\Just a tester\index.js:106:6)
at IncomingMessage.emit (node:events:539:35)
at endReadableNT (node:internal/streams/readable:1344:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errors: [
[
3,
CombinedPropertyError: Received one or more errors
at ObjectValidator.handleIgnoreStrategy (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:972:66)
at ObjectValidator.handleStrategy (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:906:47)
at ObjectValidator.handle (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:950:17)
at ObjectValidator.run (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:102:23)
at ArrayValidator.handle (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:393:37)
at ArrayValidator.parse (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:113:88)
at EmbedBuilder.addFields (D:\Discord Bots\Just a tester\node_modules\@discordjs\builders\dist\index.js:244:54)
at IncomingMessage.<anonymous> (D:\Discord Bots\Just a tester\index.js:106:6)
at IncomingMessage.emit (node:events:539:35)
at endReadableNT (node:internal/streams/readable:1344:12) {
errors: [ [ 'value', [ValidationError] ] ]
}
]
]
}```and
```js
.addFields([
{ name: 'User', value: value.name, inline: true },
{ name: 'Rank', value: value.rank, inline: true },
{ name: 'Joined', value: new Date(value.joined).toDateString(), inline: true },
{ name: 'Contributed', value: value.contributed, inline: true },
])```
it takes a rest param, not array
you have to reply within 3 seconds
hi in what website/programm do i have to code my bot?
oh wait nevermind!
How to do that?
how do I explain that further 
means what should I add with interaction.reply(...) to make it reply in 3 seconds
you can deferReply before any async tasks
try to replace all value.xxx with ```js
value: ${value.xxx}
replace xxx by your fileds (name, rank etc)
o yea that worked
🙂
How can I create a channel with specific rights? if I looked at the documentation. just would like to take a detailed look at the permissionOverwrites array
Someone can help me on this ? Please
getString cannot return undefined https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/CommandInteractionOptionResolver.js#L161
hello
if (msg.mentions.members.first()) {
var ok = msg.mentions.members.first()
msg.channel.send("https://cdn.discordapp.com/avatars/"+ok.id+"/"+ok.avatar+".jpeg");
}```
why is the avatar always null
it works if i did msg.author.avatar
i cant find anything why on google i tried looking
msg.channel.send(msg.author.displayAvatarURL({ format: "jpeg" }))
or call that method on ok instead of the author since that seems to be the goal
wdym
.avatar can be null if the user/member has a default pfp, but the displayAvatarURL() falls back and never returns null
you're checking the member's avatar, not the user's avatar
Do you have a guild avatar in the server you're calling the function in?
he doesn’t have Discord Nitro
what
@rose geyser try my version
whats a guild avatar
custom avatar in a specific guild
ok
idk what that is
Souji has one
It's only shown in a specific guild, rather than globally
GuildMember#displayAvatarURL()
A link to the member's guild avatar if they have one. Otherwise, a link to their [User#displayAvatarURL()](<https://discord.js.org/#/docs/discord.js/stable/class/User?scrollTo=displayAvatarURL>) will be returned.
idk i dont understand
i dont know what is a guild and what is shown in a specific guild
strange, everyone attacked one person, but no one with permissions could help me 😾
im a lua coder not this but i started recently
a Guild is the internal name for a server
for a discord server?
yes
ok
Despite sounding similar there is a distinct difference between users and members in Discord:
• User: global discord user data (global avatar, username, tag, id)
• GuildMember: user data associated to a guild (guild, nickname, roles, voice, guild avatar, etc.)
• Conversion: User ➞ GuildMember | GuildMember ➞ User
You don't need the conversion here, but the rest explains what users and members are
and you should probably be using #djs-help-v14 since I suspect you are too new to be using the experimental dev branch
You could be using either, but it depends on what you're trying to get
what is difference of global avatar and avatar
this works
thanks
You can set a guild avatar if you have nitro.
Anyone has a clue on this error
src/commands/music/PlayCommand.ts:87:55 - error TS2339: Property 'me' does not exist on type 'Guild'.
87 .permissionsFor(interaction.guild.me as GuildMember)
~~
pretty sure it exist on the member manager now
so interaction.guild.me as GuildMemberManager ?
no, it exist on the member manager dk why u type asserting a property that does not exist anymore to something else?...
interaction.guild.members.me as GuildMember
what's the correct way to hook into REST requests? not capturing an event via client.rest.on(RESTEvents.Request, ...)
that event has been removed since the switch to undici afaik, you should be able to use diagnostic channels with undici instead
https://thumbsnap.com/i/MjYR5KMu.png https://thumbsnap.com/i/9YCppi95.png why is it that when I respond to an interaction (ephemeral, there's a deferReply on top), the role is pinged in content, and when I want to send a message to the channel, the role is not pinged
https://discordjs.guide/popular-topics/builders.html#mentions might help
also what does it send out?

did it fix it?
also didn't help
ok so what did it send?
through this formatting in ephemeral interaction only shows
he sends only the embed and the components that I specified
hrm
try changing content to `${roleMention(mean.config.roles.event)}`

he still doesn't ping the role
sup, i'm looking for who can make my bot, I pay. He is not that long to build.
not here
dm me if interested, i'm not accepting useless dm
send in some other server
Who are you
;-;

i just want to say that this is not the right server
I already found some1 here for another bot, it's a djs discord so it's good for me
also why are you even here if you want to find someone to make the bot?
yea but this is not a server to advertise
Because it's easier for me to search for a dev, into a discord dev?
I'm not advertising, just looking for someone
I repeat to you once again, this role is only verified in an ephemeral message. she is on the server, and her ID is correctly specified in the configuration, just her ping is not displayed in the usual message
hrmm try `<@&${mean.config.roles.event}>` then
also is it a user or a role? you're saying its a role but you're saying it like its a person
so it work?
@lethal dagger
hrm
can you show me whats the code for that?
I think can use allowedMentions
perhaps discord does not see the role there and does not actually send the content. although it should, because ping roles are enabled in the client's options
if ping roles is disabled it should show the role just dont ping it
nothing helps at all
.
the role is visible in an ephemeral form, but it is not in the message that is sent to the channel
yes
what
dm
uhh ok?
yes
how to fix this error```js
CombinedPropertyError: Received one or more errors
at ObjectValidator.handleStrictStrategy (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1157:70)
at ObjectValidator.handleStrategy (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1007:47)
at ObjectValidator.handle (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1079:17)
at ObjectValidator.parse (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:113:88)
at ButtonBuilder.setEmoji (/home/runner/nCrypt-Bot/node_modules/@discordjs/builders/dist/index.js:598:42)
at ButtonBuilder.setEmoji (/home/runner/nCrypt-Bot/node_modules/discord.js/src/structures/ButtonBuilder.js:27:18)
at Client.<anonymous> (/home/runner/nCrypt-Bot/index.js:21:150)
at Client.emit (node:events:390:28)
at Client.emit (node:domain:475:12) {
errors: [
[
'guild',
UnknownPropertyError: Received unexpected property
at ObjectValidator.handleStrictStrategy (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1154:27)
at ObjectValidator.handleStrategy (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1007:47)
at ObjectValidator.handle (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1079:17)
at ObjectValidator.parse (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:113:88)
at ButtonBuilder.setEmoji (/home/runner/nCrypt-Bot/node_modules/@discordjs/builders/dist/index.js:598:42)
at ButtonBuilder.setEmoji (/home/runner/nCrypt-Bot/node_modules/discord.js/src/structures/ButtonBuilder.js:27:18)
Show the setEmoji from where this error is emitting.
I fixed it by adding a .toString() to the client.emojis.cache.get(id)
Makes sense. If you have the ID, couldn't you simply just use setEmoji({id: "ID"})?
when passing components to an ActionRowBuilder, does it create new obj from passed components or use reference of those?
how embeds works in v14 ?
same as before
Just gotta import the EmbedBuilder from builders
Or djs probably re-exports it
ok
oh, thats changed to addFields
oh
and takes an array
ok
Why'd we remove .addField()?
https://thumbsnap.com/i/TgWReE6b.png why doesn't the role ping appear?
because you have addFields()
Yeah but everyone is already using addField and addField is (arguably) easier to read and use
addField also worked perfectly fine
I can't figure out why for several hours now
It's not easier to read, and it just used addFields
There was no need to really remove addField
.setColor(['#0ff1fc']) Should i add array also
no
when I try to check the ping of the role myself, everything is sent, and when I want to embed it does not work
😔
Help
yea fixed
const { Command } = require('../../structures/functions/Command');
const { PermissionsBitField } = require('discord.js');
module.exports = new Command({
name: 'test',
description: 'test',
type: 1,
default_member_permissions: new PermissionsBitField('Administrator').bitfield.toString(),
run: async ({ interaction }) => {
interaction.reply('test')
}
})``` I already set the default_member_permissions but its doesn’t work
Can i restrict character limit of option of slash command?
is it me or, you cant get png from displayAvatarURL options
the format seems doesnt work but the size and dynamic does
i tried on avatarURL too, here btw, Progen is 13.7.0 and Cursed is 14.0.0-dev.1653091711-fdeac9d
it's now called 'extension'
I have the same problem
how do you deploy the commands?
and what is the content of that file?
so you are using builders for your commands with setDefaultMemberPermissions?
works for me, although discord's ui doesn't reflect the permissions and shows them as usable by everyone when they are not
You are right UI doesnt reflect the premissions
it is working
thank you so much, also is there a v14 docs yet?
ik theres a preview guide
pong if reply :3
https://discord.js.org/#/docs/discord.js/main/class/GuildMember?scrollTo=disableCommunicationUntil
what would happen if i put a negative date timestamp in this method?
Discord would probably error as you supplied a negative time? Do you mean just a time in the past like an hour ago? If so, that'd be in range but clear their timeout
member.communicationDisabledUntilTimestamp ? await member.disableCommunicationUntil((member.communicationDisabledUntilTimestamp - (Date.now() + duration_timestamp) > 0) ? member.communicationDisabledUntilTimestamp - (Date.now() + duration_timestamp) : null) : null;
for some reason this code returns this error even though the timestamp is a positive number
yeah something like that
console.log(member.communicationDisabledUntilTimestamp - (Date.now() + duration_timestamp)) // 111186546
Does anyone know what the partials are like in v14? 
Pins

ah thanks, i understand now what i need to do
removing date.now() would fix it
and where are the channeltypes? 
and keep throwing err
why interaction.options.getMember method didnt contain required param in chat input command
getUser has it, but getMember only one param for name
#7188 in discordjs/discord.js by imranbarbhuiya merged <t:1642423874:R>
refactor: remove required from getMember
read this ^^
Is it illegal to do .setThumbnail({url: ``}
because I get:
ValidationError: Expected undefined or null
& ValidationError: Expected a string primitive
illegal
as in won't work
yes
what should I do instead
pass string instead of object into setThumbnail
Does anyone know why this await interaction.reply executes twice??
Cause that Interaction has already been acknowledged is hella annoying to get
can't say anything from this snippet, might be worth showing what's before those lines. why do you fetch the reply twice? in v14 you don't need to fetch it at all to create collectors for the message
This is the code before, didn't even know you didn't have to fetch the reply first but ill make sure to change that.. Thanks for noticing that, not up to date on everything in V14 just yet lmao
could you send the entire file in a pastebin? would be a lot easier to read since there's now a few lines missing in between. is this the only interactionCreate listener you have?
Yes, I want to have that event ran BEFORE they actually run a command to make sure they agree to the ToS before doing anything else
Ill get the code into a pastebin one sec
Pastebin link with entire event - https://pastebin.com/YDqgSJLj
could it be because the entire tos thing runs for every kind of interaction, so it runs both for the slash command and the button?
Hmm, you're actually onto something here
Oh that might be why, lemme check if its a button and see if that helps
Yes, that was it thank you so very much 🙏 just gotta fine tune it and it should work better this time 👌
ReferenceError: message is not defined
at Object.execute (/root/ObitoInteractions/events/interactionCreate.js:94:44)
at Client.<anonymous> (/root/ObitoInteractions/Structure/Client.js:59:37)
at Client.emit (node:events:527:28)
at InteractionCreateAction.handle (/root/ObitoInteractions/node_modules/discord.js/src/client/actions/InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketShard.onPacket (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/WebSocketShard.js:447:22)
at WebSocketShard.onMessage (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/WebSocketShard.js:304:10)
at WebSocket.onMessage (/root/ObitoInteractions/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (node:events:527:28)
I don't have any message in my interactionCreate.js file
could it be a internal bug?
ObitoInteractions/events/interactionCreate.js:94
oh wait
the project name is ObitoInteractions ._.
I'm looking at a bad project
what is the character limit for responding to a command in v10 API? the official documentation doesn't list a maximum length, so i'm wondering if it's 2000 or 4000 characters
Pretty sure it's the same as a normal message
It's 2,000
ty jira
new SlashCommandBuilder().setDefaultMemberPermissions(0)
TypeError: (intermediate value).setDefaultMemberPermissions is not a function
I'm on the latest version, is this not implemented yet?
works for me, which version of builders do you have installed?
the dev version exports builders, doesn't it?
I'm importing it from discord.js
and it's the latest dev version
Help me please.
tried installing @discordjs/builders(latest dev version) and it still doesn't work
moving to #archive-builders
PermissionsBitField.Flags.Administrator
Don’t nedd to use new?
Doesn’t work too
What's the error?
No error
And also I’m not using REST.```js
const { Command } = require('../../structures/functions/Command');
const { PermissionsBitField } = require('discord.js');
module.exports = new Command({
name: 'test',
description: 'test',
type: 1,
default_member_permissions: PermissionsBitField.Flags.Administrator,
run: async ({ interaction }) => {
interaction.reply('test')
}
})```
In the docs it should be String
Trying it
Doesn’t work
const { Command } = require('../../structures/functions/Command');
const { PermissionsBitField } = require('discord.js');
module.exports = new Command({
name: 'test',
description: 'test',
type: 1,
default_member_permissions: new PermissionsBitField('Administrator').bitfield.toString(),
run: async ({ interaction }) => {
interaction.reply('test')
}
})```
I use it but Its doesn’t work
And also PermissionsBitField.Administrator doesn’t exist
Try it in your code editor
I said its doesn’t work try it first in your code editor
Yeah
default_member_permissions? ?string Set of permissions represented as a bit set all discord.dev docs
Its just a class command bro
Nah, I tried it many times but I will try it again
const {
ChatInputCommandInteraction,
ChatInputApplicationCommandData,
PermissionResolvable,
GuildMember
} = require('discord.js');
const { WbotClient } = require('../client/WbotClient');
/**
* @typedef {{ client: WbotClient, interaction: ChatInputCommandInteraction & { member: GuildMember, client: WbotClient }, args: String[] }} RunOptions
* @param {RunOptions} runOptions
*/
function RunFunction(runOptions) { }
class Command {
/**
* @typedef {{ cooldown?: Number, userPermissions?: PermissionResolvable, botPermissions?: PermissionResolvable, run: RunFunction } & ChatInputApplicationCommandData } CommandOptions
* @param {CommandOptions} options
*/
constructor(options) {
Object.assign(this, options)
}
}
module.exports = { Command }
Did I need to change to REST?
Discordjs doesn't support permissions v2 yet, only builders and therefore rest because it's raw API
So If I use REST I can access the default_member_permissions?
wdym "access" it?
use
use where/how
If I use REST can I use the default perms?
it should accept them yes
Any docs how to use REST?
const rest = new REST({ version: '10' }).setToken(token);
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(
Routes.applicationCommands(clientId),
{ body: commands },
);
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();``` How do I set this in guild only commands and this will be in ready event or no?
applicationGuildCommands(clientId, guildId)
No, its a separate script, not in the ready event
The guide explains that
Thanks
Last question. Did I need to use builders if I use REST?
You never need to use builders at all. It's just a tool for constructing JSON
If you like them, use them
I had Command Class so I dont need it.
Cool
But I created a package because IDK how to use classes in JS I only know TS creating classes
It's the same though...
No, I mean client: CustomClient, interaction: ChatInputCommandInteraction you can’t do that in JS right?
Wdym?
But I doesn’t get any params like client: any, interaction: any
I genuinely have no idea what you're talking about
If you don't use TypeScript you don't get types
If you know how to use TypeScript, use it
Yay It works!
hi
i tried this code/script in
JS
and was wonering if any of guys could tell me if there are any mistakes i might have missed?
heres a pic
We aren't debuggers you know
what is this error? ver: 14.0.0-dev.1653480262-68d5169
well importing SelectMenuBuilder from builders instead fixed the error
Invalid interaction application command:
• After updating a global command Discord prevents you from receiving stale data until the update rolled out
• Refresh your commandlist to receive the updated command and try again
Thanks
Version 13 has released! Please update at your earliest convenience, we will not indefinitely support v12.
• Update: npm rm discord.js npm i discord.js
• Update guide (use CTRL + F to search for the old method or property)
@small prism #app-commands
can I ask why PresenceUpdateStatus is in discord-api-types instead of discord.js for the dev branch?
everything from discord-api-types/v10 is re-exported in discord.js
is it? i can't find a presence status enum in discord.js until someone recently told me it was in discord-api-types/v10
@forest elm is 14.0.0-dev.1653091711-fdeac9d the latest?
no
alright ill update then
you can check by doing npm outdated
or just by checking the npm page
How can I make the interaction failed disappear when editing the message
if you initially respond with update that doesn't happen
don't message#edit it, but interaction#update it
Someone can help me?
seems like you're trying to fetch a channel before the client is ready
or somehow you removed the token from the client
const {
readdirSync
} = require("fs");
module.exports = (client) => {
try {
let amount = 0;
readdirSync("./commands/").forEach((dir) => {
const commands = readdirSync(`./commands/${dir}/`).filter((file) => file.endsWith(".js"));
for (let file of commands) {
let pull = require(`../commands/${dir}/${file}`);
if (pull.name) {
client.commands.set(pull.name, pull);
amount++;
} else {
console.log(file, `error`.brightRed);
continue;
}
if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach((alias) => client.aliases.set(alias, pull.name));
}
});
console.log(`[ ${amount} ] :: Commands Loaded`.brightBlue);
} catch (e) {
console.log(String(e.stack).bgRed)
}
};
the commands don't work
how do i access message.guild.me in v14
ty
Sometimes I get this issue when I reuse URL of some images, can anyone help?
Not really no. That image URL is no longer accessible
I assume that people have suggested making ChatCommandInteraction.showModal return a promise with the modal, is the reason that this isn't being implemented because discord doesn't send updates for cancelled (clicked outside of box to close) modals?
Thats what interaction.awaitModalSubmit is for
But yes, thats part of the problem
Thats why time is a required parameter on that method
i'm not seeing an awaitModalSubmit method as part of Interaction on the docs for v14?
Interaction is a parent class, make sure you're looking at the right child class
ChatInputCommandInteraction#awaitModalSubmit()
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
ah i see, it's just not present on the parent docs, i see it on button as well
i do think it's kind of cool how you can write bots 30 different ways with DJS, i've used at least three by now and my main file is only like 40 lines long which is unbelievable given the 200+ line mess it usually turns into
stupid question, does TextInputBuilder.setValue set a default value for the text input like changing .value for an input element does in browsers?
yes
showModalp/awaitModalSubmit is not present in parent class "Interaction" because ModalSubmitInteraction is a child of Interaction but dont have showModal/awaitModalSubmit methods.
i know, only certain interactions can have the showModal/awaitModalSubmit methods
Hey what are the values for SUB_COMMAND_GROUP and SUB_COMMAND in ApplicationCommandOptionType?
I tried loking at the source to find out but my editor's dumdumb
ApplcationCommandOptionType.SubcommandGroup and .Subcommand
thx
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: undefined. i only use new at new Discord.Collection() and new Client() so i dont understand
You're passing something undefined probably to intents
const { Client, GatewayIntentBits, Partials } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.GUILDS, GatewayIntentBits.GUILD_MESSAGES, GatewayIntentBits.GUILD_MESSAGE_REACTIONS, GatewayIntentBits.DIRECT_MESSAGES, GatewayIntentBits.GUILD_PRESENCES], partials: [Partials.Channel] });
Theyre PascalCase now
PascalCase?....
ah
@knotty plover 'discord.js/typings/enums' not found waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
😢
Are you importing something directly from enums?
no thats the thing
const Discord = require("discord.js");
const { Client, GatewayIntentBits, Partials } = require('discord.js');
``` are my only imports
yeah idk
i had it right before updating to v14 and i thought v14 would fix it lmao
bc this is my first time using modals
maybe it's the modals?
type: Discord.Constants.ApplicationCommandOptionType.STRING, TypeError: Cannot read properties of undefined (reading 'STRING')
PascalCase
Also its generally advised to just import enums from discord-api-types/v10
for string?
Its saying ApplicationCommandOptionType is undefined
Yeah but youre not using an enum, you're using the string constants which were removed I think
Look at the second example
Literally the ApplicationCommandOptionType
TypeError: Cannot read properties of undefined (reading 'String')
oh wait constants
im dumb
const input = new TextInputBuilder()
.setCustomId('translationInput')
//the label is the prompt the user sees for this input
.setLabel('Enter your text here, we\'ll translate it for ya')
//long input, other version is single line of text.
//we might need to put a maxiumum on this is we display it as an embed.
.setStyle('PARAGRAPH')
const row = new ActionRowBuilder()
.addComponents(input)
gives typeerror found non-callable @@iterator at .addComponents(input)
takes an array
I'm getting modal error, not using modal
That says Model, not Modal
Something invalid in your embed(s)
Show how youre sending it
so whats pages[0]
can't seem to register a command with autocomplete through client.application.commands.set
i'm guessing this would be the guilty command
{
name: "help",
description: "view details on how the bot works",
type: ApplicationCommandType.ChatInput,
options: [{
name: "category",
description: "select which area you would like help in",
type: ApplicationCommandOptionType.String,
required: true,
autocomplete: true,
choices: [{
name: "tags",
value: "tags"
},{
name: "help",
value: "help"
},{
name: "random",
value: "random"
},{
name: "prefs",
value: "prefs"
}]
}]
}
Autocomplete isn't supposed to have choices. You provide them dynamically via AutocompleteInteractions
ah my bad, wasn't aware of that. what's the choices field of ApplicationCommandOptionData for then?
String/integer/number options without autocomplete
so if i wanted to have those as the only options, would i remove autocomplete: true?
Yes
autocomplete choices are dynamic and chosen via the interaction, choices are fixed and predefined
ty all
how do you check if a member is a bot or not? ver: 14.0.0-dev.1653480262-68d5169
they both return 0
or random numbers in general
m.user.bot
ty
Keep in mind that what you are doing relies on cache, so fetching before that may be needed
by fetching before, do you mean this?
having an accurate count of members, yes
cache has only cached members
.
I keep getting Value "MAX" is not int for auto thread archiving, does anyone know what the issue is? Is it still an option?
I assume its because boosts are no longer required for the duration
It was removed.
Correct, so that helper is useless. Removed
Thanks!
Are colour resolvables no longer settable in an embed builder?
if you import the builder from d.js it should work
yes
Alright
you can also use the Colors "enum" from d.js instead of strings
How do I set these two commands?
pass a single array with both commands in it
Has anything changed with embeds? For some reason my image and thumbnail are not showing in the last half hour or so.
Edit: (It could be something i did, just doing some testing)
network issues?
Tried from 2 different networks, and tried directly accessing the image in a browser. Image loads fine in my browser, but still nothing showing up in the embed
Edit: Seems to be an issue between discord and my image hosting, disregard 🙂
anyone know a guide for slash command attachment options?
This is how you add and get
why UI doesnt update in slash command section ?
you mean the command isnt registering?
Which API version is recommended for use currently?
djs v14 uses v10 iirc
I mean when u set defaultMember perm in slash command UI doesnt update in integration
the ui doesn't reflect default perms atm, discord is apparently aware and planning a fix
is there a reason why djs sticker tags proprety holds string[] | null even though dapi handles strictly string | null?
modal doesnt have eval2 option
but it's not to have
Ur not checking the modal's custom id
You have to make sure it’s the proper one depending on what the block does (evalmodal, formModal, etc)
Is v14 unstable? (have a lot of error issue?)
Thats not what unstable means
v14 is not buggy, no
But its subject to change at any time
Hi, do you know if select menus in modals are going to be integrated into the test version of discord.js? Unless they are supported by the API only temporarily
They arent even announced by Discord yet so no
We will not be adding them to the dev version until Discord formally announces and documents support for them
Are there any alternative for Constants.APIErrors in v14?
Thanks
Type 'ChannelType.GuildVoice' is not assignable to type 'ChannelType'.
show code
import { ChannelType } from "discord-api-types/v10";
if (![ChannelType.GuildStageVoice, ChannelType.GuildVoice].includes(_channel?.type))
//blabla```
nvm fixed it
bot dosent try to login after this, no errors.
Code:
const { Client, Collection, GatewayIntentBits } = require('discord.js');
const config = require('./config.json');
const fs = require('node:fs');
const client = new Client({ intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
]})
client.commands = new Collection();
client.on('ready', () => {
console.log('READY!')
})
client.on('debug', (d) => {
console.log(d)
})
client.login(config.token)```
Can't see any reason for that
Try run the code on your computer
don't see a problem, did you save your code?
Didn't you like... hit ctrl+c or something for real?
Hey, I have a small question, I'm trying my hand at syntx based commands(text commands) again after a long time, but somehow my messageCreate event doesn't work, and I don't know why, I've looked up everything possible via console.log( ), I logged my collection and it still doesn't work, and I don't know why, the only thing I found out is that comm = undefined
does anyone know why this doesn't work
message create
//text commands
const {ChannelType} = require('discord.js');
try{
let args = message.content.split(/ +/);
if(!message.content.startsWith(`a#`)) return;
let cmd = message.content.slice(`a#`).trim().split(/ +/).shift().toLowerCase();
let comm = client.commands.get(cmd);
// console.log(comm)
if(comm) {
comm.execute(client, message, args);
} else {
message.reply({ content: `Dieser Befehl existiert nicht!` });
}
}catch(err){
console.log(err)
}
command file
module.exports = {
name: 'botinfo',
description: 'shows some botinfo',
async execute (client, message, args) {
//code here
}
}
collection
Collection(1) [Map] {
'botinfo' => {
name: 'botinfo',
description: 'shows some botinfo',
execute: [AsyncFunction: execute]
}
}
do you have the MessageContent intent? otherwise message.content will always be an empty string
my bot is not verified
v14 uses api and gw v10, you need the intent
but even if I have it on, nothing happens
enable it in the client constructor too
how i do it in v14, i use everytime the 32767
You shouldn't use magic numbers
you need to use pascalcase strings ("GuildMembers" where each word is capitalized) or get the GatewayIntentBits enum from discord.js
magic numbers removed? I don't think that's true
not sure
i dont think they've been removed really
but as i said earlier, i'm not sure
you couldn't really remove them without removing enums
do it like it's suggested in the guide everywhere, provide an array with the GatewayIntentBits you actually need
i have a question, how can you access the text voice channels
access? voice channels have a MessageManager in v14
Ok thank you both of you
I meant "use" lol, also i checked the ChannelTypes enum but I couldn't find GuildTextVoice
The channel type is still GuildVoice
what is the current version of discord.js@dev?
why did they remove .getBoolean() and getString() and stuff from the commandInteraction?
No, it wasn’t removed
Perhaps you need a chat input interaction
ah different type now?
It was renamed to reflect its type - chat input
yeee thats it thanks a lot!
CommandInteraction is now a base for context menu application commands and chat input application commands
v14 looks very nice so far
new ActionRowBuilder<MessageComponentBuilder> iirc
yos ty
The <Message>.fetchReference() uses the cache before fetching the message?
yes
wait no
ah yeah forgot about that
For fetching command interaction options, is it sufficient to use interaction.options.get([option_name], true) ?
The interaction is typed as CommandInteraction and I'm trying to parse the application command interaction options
yea
does the intents constructor exist in the dev release?
cuz its throwing an error for me
has been renamed, see pins
thanks
Is there a way to send a message to a voice channel without reacting to an event? I don't see send in VoiceChannel
I think the docs are outdated, send exists on VoiceChannels
Ok, thanks, I don't see the answer in faq
If it's "fully implements the feature", that could be interpreted as "fully implemented it in a way we wanted to", which could have excluded send
why EmbedBuilder.from is returning any? Am I missing something?
This is typed correctly for me, can you try installing the latest dev release?
I just did
If you ctrl click on .from does it show what I posted in the second image?
Yeah
try restarting ts server
tried but still getting any
Try updating djs version (npm i discord.js@dev)
help
The error says you didn't set an author name. Did you?
nvm BTW can you help me to this? member is defined as GuildMember
doesn't seem like that would be a function anyways, it's a property
GuildMember#kickable
Whether this member is kickable by the client user
member.kickable?
It's suppose to be a property, not a function. Omit the brackets
Yup
thanks
Np
BTW is member.kick() take an object?
the docs are your friend
How to check if a bot has permissions?
interaction.guild.me.permissions.has(['ManageGuild']) - this doesn't work
Error: Cannot read properties of undefined (reading 'permissions')
ok
in dev it’s been moved, to get the client as a member its guild.members.me
thank you
permissions.has takes a string, and ManageGuild is not a permission
Actually Permissions#has() takes a PermissionResolveable which include both strings and an array of PermissionResolveable
ManageGuild is valid
what did you think was valid lol
MANAGE_GUILD
All permission flags are now pascal cased in dev
@ dev uses PascalCase
ok
The new Voice text channel are full supported in @digital dust right?
yes
👍
I saw this thing with .setDisabled for buttons do i need this new function if I dont use the old buttons and just set a new components array?
I mean I dont have a receivedButton I just set a completly new comp array with a disabled button
what do you mean exactly? If you already have a row with a disabled button you can just send it (?)
Example:
My bot send a msg with a button
If you click the button the bot edits the msg
with a new components array that have the same button but to create the disabled button it dont use the old button thing it creates a new
Row1 = ActionRow with no disabled button
Row2 = ActionRow with a disabled button
Bot sends msg with row1
click on the button =>
edits msg with row2
is this better to understand? haha
in this case you don't have to change anything. what v14 adds is a differentiation between received data which is immutable and builder data to send to the API. To edit received components you have to first convert them via Builder.from or Component.toJSON if you are not using builders
Ahh thanks
Is there a way to know which local the user uses ?
(In which language is the client of the user that use the command)
Interaction#locale
The locale of the user who invoked this interaction
thx
Is there a guide for transitioning from v13 to v14 similar to this?
https://discordjs.guide/additional-info/changes-in-v13.html#before-you-start
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
allowedMentions: { parse: ["users", "roles"], repliedUser: false },
});
not getting message content after updating - do i have the right intents?
see pins for a wip guide
Thanks! ❤️
tried intents: ["Guilds", "GuildMessages", "MessageContent"] with no luck as well. toggled intent in dev dashboard on/off, still nothing
I don't see any issue with the intents, you get messageCreate events but content is always an empty string?
lmaoo i had the event as message and not messageCreate 😭 thank you
After updating the npm package to v14 and the first start I get this error? Why?
https://i.imgur.com/fx9WAl9.png (First seconds after start)
it doesnt look like an error to me
Yeah its a multiple resolves but with v13 I dont get this
Is this no longer supported?
channel.permissionsFor(guild.me).has(['VIEW_CHANNEL', 'SEND_MESSAGES', 'EMBED_LINKS'])
cuz I get this error:
TypeError: Cannot read properties of null (reading 'has')
thx
channel.messages.fetch().then((fetchedMessages) => {```Messages that are returned in `fetchedMessages` seem to have blank content, any ideas? Those messages are from a voice-text channel.
do you have the MessageContent intent?
Let me see, I should unless it's a new thing 🤔
Silly me, seems like I don't thanks! 🙂
Added this and it's crashing the bot now 🤔
GatewayIntentBits.MessageContent
@velvet jasper pinging u since u had added fetch less component collector. When I'm using it with an ephemeral reply, it's not working Is it intentional?
probably not, can you make an issue ticket for the time being?
#7992 in discordjs/discord.js by imranbarbhuiya opened <t:1654188976:R>
can't create message collector on ephemeral response without fetching.
is this a bug? the docs say setEmoji should take string or ApiMessageComponentEmoji
did you import the builder from d.js?
channel.parent.children.forEach((child) => {```How would I go about updating this to v14?```CategoryChannel#children is no longer a Collection of channels the category contains. It is now a manager (CategoryChannelChildManager). This also means CategoryChannel#createChannel() has been moved to the CategoryChannelChildManager.```
.children.cache
I get the same error when sending a normal message, I wonder if there was a change in v14?
wrong channel id
If I add a normal SelectMenuBuilder as a component to a modal, does it work or is there an error?
Error
Selects in modals are not announced, officially released or supported yet
@slow storm I can't seem to reproduce your error, here's my code:
client.on('interactionCreate', async (interaction) => {
if (!interaction.isChatInputCommand()) {
return;
}
const msg = await interaction.reply({
content: 'test',
components: [
new ActionRowBuilder<MessageActionRowComponentBuilder>().addComponents([
new ButtonBuilder()
.setCustomId('test')
.setLabel('test')
.setStyle(ButtonStyle.Primary),
]),
],
ephemeral: true,
});
msg
.createMessageComponentCollector({
componentType: ComponentType.Button,
})
.on('collect', (btn) => {
console.log(btn.customId);
});
});
Even though its not supported, you can technically get them into a modal. However, I did not find a way to extract the chosen value out of it so it was pretty much worthless
They look like shit right now anyway, you cant label them, they arent ready to be modal controls
ok
Hi!
I'have a question...
How to get the voice channel client with this version discord.js@dev?
<guild>.members.me.voice.channel
how does one send a message in tiv?
channel.send
just curious, how can I send a message to a voice channel's text channel?
couldn't find in the docs or in the actual github how to do that
or, simply, how can I access the text channel inside a voice channel?
the docs are outdated, <VoiceChannel>.send() works
oh, gotcha, thanks
Am I thinking about this the wrong way? Trying to get my bot ready for v14 and hit this wall of options not having a type despite them clearly having one, any ideas?
Are you sure that’s the command it's referring to?
Every command has that issue, and they all (afaik) have type's that are the new v14 style.
The error says the one in index 0, 2, and 4
Can you show the first command in the Array?
Ah, I see what I did wrong.. Used the wrong ApplicationCommandOptionType thing for subcommand.
It's not throwing but it's not collecting too
Ik but mine is collecting
It prints the custom id every time the button is pressed
:sad: it's not working for me. I had tried a lots time and only if i fetch the reply then it collects else not. But I'll try again today and will inform
Did you try my code?
I'll do it now
I just tried and it's working. But in my case, it's a ButtonInteraction sorry I thought it was any interaction that's why didn't mention it. Can u try with MessageComponentInteraction please?
With v13, we could create a new ActionRow, and pass that directly to the reply function, like reply({components: [actionRow]}). However, with v14, I'm getting an error when passing the ActionRowBuilder instance to reply. Do I need to pass ActionRowBuilder.data or ActionRowBuilder.components instead?
const row = new ActionRowBuilder()
.addComponents([
new ButtonBuilder()
.setCustomId(JSON.stringify({data: voiceChannel.id, command: 'end'}))
.setEmoji('🛑')
.setLabel('End')
.setStyle(ButtonStyle.Primary),
]);
await interaction.reply({content, components: [row]});
No overload matches this call.
Overload 1 of 2, '(options: InteractionReplyOptions & { fetchReply: true; }): Promise<Message<true>>', gave the following error.
Type 'ActionRowBuilder<AnyComponentBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<AnyComponentBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.
Overload 2 of 2, '(options: string | MessagePayload | InteractionReplyOptions): Promise<InteractionResponse<true>>', gave the following error.
Type 'ActionRowBuilder<AnyComponentBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.ts(2769)
You need to toJSON() it I think
Otherwise it might be the lack of a generic in the constructor for ActionRow, not sure how builders works there
It still works
msg.createMessageComponentCollector().on('collect', (c) => {
console.log(c.customId);
});
you can use a generic new ActionRowBuilder<ButtonBuilder>()
const changeChannelButton = new ButtonBuilder()
.setCustomId('announce-change-channel')
.setLabel('Change Channel')
.setStyle(ButtonStyle.Primary);
const changeChannelRow = new ActionRowBuilder<MessageActionRowComponentBuilder>().setComponents([changeChannelButton]);
const msg = await i.reply({
content: `announcement send to ${channel}`,
components: [changeChannelRow],
ephemeral: true
// fetchReply: true
});
const channelCollector = msg.createMessageComponentCollector({
filter
});
channelCollector.on('collect', async (int) => {{
console.log(c.customId);
});
My code and it works with fetchReply: true. And i is a ButtonInteraction
what is your filter?
const filter = ({ member }: MessageComponentInteraction<'cached'> | Message) => member.id === interaction.member.id;
Is it an issue with member? my filter uses member instead of user bcz I'm using it with messagecollector too
let me try with users
I tried and still not working with user
this is actually working for me
I've tried without filter too. Dk what's wrong in my code
try this, listen to interactionCreate and print it if it's a message component
ok
I'm receiving the interaction in interactionCreate
Also is this a chat input command or context menu command?
I'm replying to a button interaction with another button and trying to add a collector on replied response
like what is the ephemeral response to?
here i is a ButtonInteraction
v14 migration was easier than I thought it'd be, though I wish the change in deprecation status for 'message' had yelled at me in TypeScript-land. Are y'all taking PRs on that sort of stuff?
On what kind of stuff?
Isn’t there a deprecation message in previous versions when you use the message event?
gr8
I didn't see one. I was expecting .on('message') to report that 'message' is not a valid parameter at compile-time, but it did not. Perhaps a cache issue?
Thanks!
It was definitely throwing deprecation warnings in v13
There’s no compile time error, it was only emitted during runtime
I did not see it in there but my app spits out a whole ton of junk at runtime so it was probably lost. It should be possible to set up the typescript defs to emit an error at compile time
hi, i notice guild.me no longer exists, what's the alternative?
cool cool, thanks!
Will these clear all permissions from the role?
roles.cache.get(log.entries.first().target.id).edit(
permissions: null,
)
it's normal that PermissionsBitField don't work?
When i try PermissionsBitField.Flags.Administrator this return undefined
i use commonjs for import discordjs as here -> const {PermissionsBitField} = require('discord.js');
but don't work -_-
AND i don't found PermissionsFlagsBit on discord-api-types/v10 (no enum too)
PermissionsBitField.Flags.Administrator is valid, run npm ls discord.js
I'm importing exactly as shown:
PermissionFlagsBits.Administrator
That is from discord-api-types and I am not the one having the issue, they also said they can't find that export
If you are using latest discord.js@dev PermissionFlagsBits is exported in discord.js :
import { PermissionFlagsBits } from 'discord.js';
To be clear, this resolves from discord-api-types
Yea i know that
i have a error with this ._.
ManageMembers ?
hi are voice channel broke in the recent update?
my code:
if (
message.guild.me.voice.channel &&
!message.guild.me.voice.channel.equals(message.member.voice.channel)
)
- message.guild.me
+ message.guild.members.me
So am i that stupid? Yessss.... (Thx for help)
it works now thanks
How would i do if i would like to edit a Message and then check the lastMessage and if it was by the Bot or not??
i'm using v14 so
I don't see any problem in this code. Why do I get this error?
if (message.member.roles.highest.position >= message.guild.members.me.roles.highest.position) return;
which one is null
I don't know really
cause the code runs fine, but it shows the error
anti-everyone.js line 21
I have already given line 21
if (message.member.roles.highest.position >= message.guild.members.me.roles.highest.position) return;
fetch the bot member
I think it's message.guild.me not message.guild.members.me
Documentation suggestion for @scarlet tangle:
Guild#me
The client user as a GuildMember of this guild
it's message.guild.members.me
it's message.guild.members.me
ah ok my bad, didn't notice this is the dev channel
It would be better if you elaborate more. I didn't understand.
guild.members.me is nullable, u can fetch client.user.id from guild.members and have the "me" object you're trying to use
👍 Thanks, will try it
Hi, who to send message in new vocal chat beta option
as you would on a textchannel, just call #send on it
Oh okey thx
👍
ModalBuilder
Represents a modal builder.
ActionRowBuilder
Represents an action row builder.
TextInputBuilder
Represents a text input builder.
I'm using discord.js@14.0.0-dev.1653480262-68d5169 and for some reason interaction.options.getBoolean()\getString() doesn't exist. Anyone know why?
you're missing something in that sentence
Use typeguard
Interaction#isChatInputCommand()
Indicates whether this interaction is a [ChatInputCommandInteraction](<https://discord.js.org/#/docs/discord.js/main/class/ChatInputCommandInteraction>).
Hi
Does anyone have hashs of commits about support of text in voice pls ?
I heard it was supported in dev but in discordjs/discord.js i dont found commit(s) about that
anything past may 2nd
Also how do you create an embed in v14, because it's MessageEmbed doesn't exist in 'discord.js'
read the updating guide
EmbedBuilder
check out the guide in pins
Thx
Is it possible to get the customid from a ButtonBuilder?
iirc no
you can do new ButtonComponent(<ButtonBuilder>.toJSON()).customId
I tried that but typescript dont like that because ButtonComponent is a private class contructor
you should be able to access it from <ButtonBuilder>.data
though you should consider restructuring your code so you don't need to check it since you should have all the data since you are using it for the builder anyways
how to fix?
addComponents takes an array
it's array
you are showing addOptions
new Menu()

uhm i did setDefaultMemberPermissions("0") but the command isnt disabled for @ everyone?
is everything from discord-api-types/v10 re-exported in djs v14? nvm
can you try using it with an account with insufficient permissions? the ui doesn't reflect default permissions yet
oh ye ur right
thats uhm weird, assumed it was just disabled for @ everyone??
ig it is but just invis
Hi
Where can I find the button styles, I can't find them in Constants anymore
and in the doc the type is not a link anymore :/
import ButtonStyle from discord.js
My IDE was not autocompleting it but now it works??????? wth :')
what kind of magic is that
Thank you!
no prob
Was MessageAttachment renamed? Tried AttachmentBuilder and that also did not work.
new Attachment() ? i think?
Documentation suggestion for @scarlet tangle:
Attachment
Represents an attachment.
oh sweet ty that worked
oops
How can I get the choice of which option a user selects in a SelectMenu when multiple items can be selected at once?
Documentation suggestion for @frigid sleet:
SelectMenuInteraction#values
The values selected, if the component which was interacted with was a select menu
thanks
How exactly do you get message content now?
Message.content
Yeah but that's returning an empty string
Is your bot verified?
no
You need the message content intent enabled
In the dev portal? Because I did that
And code
In the dev portal and in your code
ah ok
What is GuildStore in ChannelType
old store channel
it should be removed soon from djs
from discord it was removed in march
It is removed
okey
Is there any benefit to start looking at v14 to code new standalone features? (I'm planning to segregate feature in different container)
you don't need all of those intents
99% sure you don't
integrations is misspelled
kinda interested in what you want to do with DirectMessageTyping
EmbedBuilder iirc
?? u still have MessageEmbed on here, i literally told u to use EmbedBuilder and import it from djs
setFooter takes one param, as an object .setFooter({ text: 'your text' })
<MessageEmbed>.setFooter() and <MessageEmbed>.setAuthor() now each take an object:
- embed.setAuthor('This is an example text', 'https://example.com/icon.png', 'https://websiteofauthor.com')
+ embed.setAuthor({ name: 'This is an example text', url: 'https://websiteofauthor.com', iconURL: 'https://example.com/icon.png' })
- embed.setFooter('This is an example text', 'https://example.com/icon.png')
+ embed.setFooter({ text: 'This is an example text', iconURL: 'https://example.com/icon.png' })
#archive-offtopic for off topic @scarlet tangle @tender spoke
i know don't worry
you cant apply
help.js line 45
const client = new Discord.Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildsMembers,
GatewayIntentBits.GuildsBans,
GatewayIntentBits.GuildsEmojisAndStickers,
GatewayIntentBits.GuildsIntegrations,
GatewayIntentBits.GuildsWebhooks,
GatewayIntentBits.GuildsInvites,
GatewayIntentBits.GuildsVoiceStates,
GatewayIntentBits.GuildsMessages,
GatewayIntentBits.GuildsMessageReactions,
GatewayIntentBits.GuildsPresences
],
partials: [Partials.Message, Partials.User],
})``` RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: undefined.
Guilds is plural but the rest are all Guild singular
oh I see
GuildText
you use enum now
import ChannelType and use ChannelType.GuildText
Use the enums
Try "\u2B50" as the star emoji
so it turns out there was what appears to be a zero-width space in the strings with the stars in them 🤦🏾♂️
coding on a phone sucks sometimes
ah
is there any way to get the id of the text channel of the voice channel?
or will the id be the same as the voice channel?
Same
i get this err when i try to run a cmd
addFields takes an array
ty
now?
i just installed v14 btw
still trying to merge
whatever you pass to setColor is not a ColorResolvable. You can check out the WIP upgrade guide in pins
can u send me the exact link
for the topic im searching 4
docs have a search feature, make sure to select the main branch or use the link in the pins
ok ty
how to fix?
<Guild>.members.me
console.log(interaction)
Why isn't it possible to update the original message with a modal submit interaction when the modal is triggered by a button press?
it is possible?
await interaction.awaitModalSubmit({ filter, time: 60000}).then(async i => {
await i.update({ components: [row]))
})
Property 'update' does not exist on type 'ModalSubmitInteraction<CacheType>'.ts(2339)
you do a isFromMessage() typeguard
Ah alright, thank you!
Are radio buttons already supported in dev?
radio buttons are a thing?
looks very fake
no it got confirmed by a staff 
Getting Started: Introduction


**Guild: **