#archive-github-djs
1 messages ยท Page 5 of 1
Afterwards we can create a quite simple example bot:
Afterwards we can create a quite simple example bot:
Please describe the changes this PR makes and why it should be merged:
#6114 accidentally removed a line which caused a converted TextChannel to not be updated.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
774f5b7 fix(ChannelUpdate): restore accidentally remove... - timotejroiko
cf6720e Docs build for branch master: 774f5b77ec6218c30... - iCrawl
7c54076 refactor(GuildChannel): use filter method for #... - Keke27210
626ff85 docs: change example in readme to slash command... - SuperchupuDev
e7a012f Docs build for branch master: 7c540764f05cf0a7d... - iCrawl
2492d8f Docs build for branch master: 626ff85ae7616a59c... - iCrawl
The warn now on line 25 can now be removed.
Not every BaseGuildTextChannel is a TextChannel.
Please describe the problem you are having in as much detail as possible:
While creating a slash command like in v12 and then setting the permissions I receive an error back (although no error appears to occur).
The permissions actually work as intended however it does return the following error:
TypeError [INVALID_TYPE]: Supplied permissions is not an Array of ApplicationCommandPermissionData.
at ApplicationCommandPermissionsManager.set (/redacted/node_modules...
While creating a slash command like in v12
You can't create commands in v12
While creating a slash command like in v12
You can't create slash commands in v12
sorry, you are right I was mistaken about the version number, must have been the moment v13 added them is what I was referring to
Out of curiosity,
- how is it the wrong type? Pretty sure the class takes in raw data from Discord
- How are you affected by this? ๐
The commit before you PR'd breaking changes, worked fine with the type as ApplicationCommandData
1: Changing it to a raw datatype requires the user to input application_id and id which I don't think is intended
2: What I said above, when doing
new ApplicationCommand(// params, {
// application_id and id are required here
}...
- It's very much intended, as it's the data Discord gives us anyways, and is required by the class itself:
- You're...not supposed to construct an ApplicationCommand instance yourself, we have fetch methods for that!
this is what we are doing right now,
this.slashCommand = new ApplicationCommand<Record<string, unknown>>(
client,
{
...options.slashCommand,
name: this.name || options.name || '',
description: this.description || options.description || '',
options: options.slashCommand?.options || undefined
}
);```
This has worked for a while now, it only works when adding application_id and id now. What...
If you wanna create a slash command just create an object with the type ApplicationCommandData and then create it like you would normally. There are guides that explain how to do all of that at https://v13-prep.discordjs.guide/interactions/registering-slash-commands.html
GuildChannel#setTopic moved to BaseGuildTextChannel
Stage channels would receive this method from BaseGuildVoiceChannel which extends GuildChannel, which means this would be lost and needs implementing back in somewhere...
Perhaps just stick it in the stage channel itself? That way, we could customise the description of it as it's a unique case for a stage channel?
I have my bot token but my acc is protected by a2f and i don't have the codes. I think they could make a feature to turn on intents with only bot token.
Stage channel topics seem to have no purpose at this point. The api accepts and sends topic on stage channels, but it doesn't exist in the UI. I suspect this is a remnant after moving to stage instances. But, it probably should be added back directly.
Is it still documented that it can be used in a stage channel? I see only text channels and announcement channels here upon editing a channel, which is how it is currently called!
Despite the API accepting it, if it does nothing and doesn't seem to be documented... probably best to not add it back in, since stage instances are the way to go right now?
Because we don't need some 3rd party with arbitrary and opinionated rules evaluating our code.
So why do you have eslint checks in github actions
discord.js is only able to implement features that exist in the Discord API. Please contact Discord for assistance recovering your account.
Because we define the rules ourselves, thats why.
Because we don't need some 3rd party with arbitrary and opinionated rules evaluating our code.
Not to speak of the fact that it conflicts with our prettier rules (using an outdated version themselves) and will mess up our CI.
So why do you have eslint checky in github actions
And where are your rules?
https://github.com/discordjs/discord.js/blob/master/.eslintrc.json ?
Because we don't need some 3rd party with arbitrary and opinionated rules evaluating our code.
Not to speak of the fact that it conflicts with our prettier rules (using an outdated version themselves) and will mess up our CI.And where are your rules?
Where eslint rules usually reside, in the .eslintrc.json
Is this feature still needed?
If its undocumented, lets yeet it.
There's been no activity on this issue for over 2 years, and it seems to be resolved - I think this issue should be closed
My bot is down for hours at a time because of this issue, I'm running 7 shards and getting rate-limited almost immediately on boot. I don't understand why it suddenly started getting rate-limited a week ago, and again today, is this really on Discord's end?
Also very unhelpful, ShardingManager appears to just throw an unhandledexception when this occurs, it does not display any sort of 429 error, which made this extremely confusing to debug...
Is this still an issue? If so, what d...
I don't believe the last suggestion resolved the issue if that is what you are referring to. I have not used discord.js in a while, perhaps I am missing a commit.
you can just pass immediatePatch into the super and simply remove this patch call because _patch is called in channel
make this an async function (#6210)
would it not make more sense just to just add properties user and message to the class?
Not sure I can. The patch on this was hard-coded to false, I don't want to override that by setting a default here.
This has been extensively debated and this is the approach we've decided on.
isn't it the same behaviour both ways? im not crazy?
These are supposed to be Guild only...
So what? You use the same objects for guild and global slash commands and the guide covers both of those
So what? You use the same objects for guild and global slash commands and the guide covers both of those
I'm using the ApplicationCommand class to represent the Command.slashCommand. If I'm not making an instance of a new applicationCommand for each command I can't do Command.slashCommand to get the application command.
I still don't understand why you need to construct an ApplicationCommand yourself, its not meant to be constructed from user data, it only comes from data discord returns, and reverting this makes this type incorrect.
Like I said you need to create an object of ApplicationCommandData, not construct the class. Most classes in d.js are not meant to be constructed by the user, this PR should just be closed because it is incorrect and you should use the supported methods that are described in the guide.
Please describe the problem you are having in as much detail as possible:
In v13, Permissions#missing returns all permissions, not only the provided ones.
Include a reproducible code sample here, if possible:
guild.me.permissions.missing(Permissions.FLAGS.ADMINISTRATOR)
This should only return the ADMINISTRATOR permission, since it's the only one passed as argument, in v12 works as intended but v13 seems to return all permissions, i'm not sure if those ar...
e2e4f65 refactor(*): use async functions (#6210) - NotSugden
de1fe66 Docs build for branch master: e2e4f6518b3be85b1... - iCrawl
Please describe the changes this PR makes and why it should be merged:
Add GuildStickerManager and GuildInviteManager to list of configurable Caches, as both extend CachedManager.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
Please describe the problem you are having in as much detail as possible:
Include a reproducible code sample here, if possible:
// Place your code here
Further details:
- discord.js version:
- Node.js version:
- Operating system:
- Priority this issue should have โ please be realistic and elaborate if possible:
Relevant client options:
- partials: none
- gateway intents: none
- other: none
Please describe the changes this PR makes and why it should be merged:
The new example of the README was missing a semicolon, added it for consistency with the styling since the guide has that semicolon and it's used everywhere else at the end of functions
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
- This PR only ...
2c452df docs: add missing semicolon to readme (#6270) - SuperchupuDev
ec5f8b5 Docs build for branch master: 2c452dffb8204868e... - iCrawl
Please describe the changes this PR makes and why it should be merged:
While the direct issue outlined in #6168 has been fixed in #6263, the same issue still persists for old messages sent in this same channel. As outlined in the issue the least intrusive way to fix this I could think of is making Message#channel a getter to retrieve the channel from cache on demand. I use the Client cache (versus the guild cache) to be robust against DMs, if that has any caveats I did not think of, ...
Getting the channel from an Interaction require a pretty long boilerplate code (see below). I propose to add some shorcut method to Interaction.
Maybe the name fetch is not appropriate since it doesn't fetch in all case.
I know the policy is to avoid trivial shorcut method, but this one could help improve code readability.
const channel =
interaction.channel ??
(interaction.channelId
? await (
interaction.guild ??
(interacti...
Just fetch either way really.
const guild = await interaction.client.guilds.fetch(interaction.guildId);
const channel = await interaction.client.channels.fetch(interaction.channelId);
.fetch won't make an API request if you already have it in cache by default.
Please describe the changes this PR makes and why it should be merged:
Yet another README pr, this one removes the "this is still for stable" message from the guide link and changes the update guide link to v13 changes, since the old one is for v12
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
- This PR only includes...
Please describe the changes this PR makes and why it should be merged:
Some links related to interactions were wrong (you can tell straight away because there was no - separating the words!) - I've gone ahead and pointed them to the correct area.
APIInteractionDataResolvedChannel & APIInteractionDataResolvedGuildMember were missing documentation links, so I've gone ahead and pointed them to https://discord.com/developers/docs/interactions/slash-commands#interaction-object-applic...
6e0ea02 docs: update link of the guide to v13 changes (... - SuperchupuDev
544b1ed Docs build for branch master: 6e0ea020c0de58091... - iCrawl
It seems like it only happens with the administrator permission ๐ค
As for the errors you will need to disable those eslint rules on those lines. If you install the eslint extension it will help you do that
Since both lead to the same link you should only add 1 and call it APIInteractionDataResolvedOption, and change it where these 2 appear
Seems like this happens because if you have a permission bitfield of 8n (ADMINISTRATOR) and call .toArray() on it, it will resolve into all permissions which seems counter intuitive. Can you check if this behavior also happens on v12?
I do not think this is the right approach. These types are imported from discord-api-types, and if they don't exist there, I don't think we should be creating them over here. Also doing this would imply both the return type of a channel and member would be the same, but this is not correct.
In order to set a command's permissions, you must provide an object where the array of permissions is in the permissions parameter and you must also supply a guildId. This error should be fixed once you do so
Remember that these are not types and only serve for documentation purposes. Once someone clicks either one of those they will be sent to the same page and will need to figure out what they should be looking at. I argue some may even be confused and call these a bug but there's not much we can do. You could also try a weirder syntax used in typescript which would be something like APIInteractionDataResolvedOption['member'] so that they know what property to look at when they open the page. ...
Remember that these are not types and only serve for documentation purposes
These are types, I'm not sure what you mean?
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
permissions: Permissions;
}
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
permissions: Permissions;
}
Changing them away from these types means we wouldn't be using any types at...
No these are not types, these are only links in the documentation website. I didn't link the index.d.ts file
I've spent about 5 hours updating my code to work with v13 from v12 and I got to a point where I physically can't move any further.
I've spent at least 2 hours trying to get it to work and I'm just getting no where, channel.setParent() is doing absolutely nothing, no error and the channel doesn't move into a diff category.
client.on('messageCreate', async message => {
if (message.content.toLowerCase() === '!test') {
var guild = client.guilds.cache.get('847...
This is a bug.
This happened because #6210 reverted what #6232 implemented...
I'm glad I didn't do some silly mess up with my own code haha, any eta on a fix?
This is a bug.
This happened because #6210 reverted what #6232 implemented...
oopsies, must've got lost in the rebase :sweat:
Thanks @NotSugden I'll use that as a temporary fix ๐
It should be parentId though, parent doesn't make much sense...
@ImRodry I believe it making parent makes sense as it can be either an object or snowflake :)
It should be parentId though, parent doesn't make much sense...
Well it won't make much sense right now due to this issue but it should accept parent which takes a CategoryChannelResolvable, which is not just the id of the channel, but also a CategoryChannel.
This is a bug.
This happened because #6210 reverted what #6232 implemented...oopsies, must've got lost in the rebase ๐
<GuildChannel>.edit({ parent: ... });should work though!
Your fix works nicely, thanks :D
Please describe the changes this PR makes and why it should be merged:
This fixes an issue introduced by #6210 that made setParent not work at all.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
parent: channel ?? null,
i suppose this can also be changed (as that was originally what was on the PR)
Yeah I guess since we're resolving the id anyway in .edit might as well keep that.
Yes please. This check is already in the edit, so it would be duplicating the check.
7e0618f fix(GuildChannel): setParent not working (#6276) - ImRodry
627f340 Docs build for branch master: 7e0618f17a7867080... - iCrawl
Small correction: If the ApplicationCommandPermissionsManager belongs to a guild application command bot the guild and command options are ignored and only permissions is required here.
You may be interested in the checkAdmin parameter, e.g.
guild.me.permissions.missing(Permissions.FLAGS.ADMINISTRATOR, false)
While that does return the behavior from v12 I feel like it's confusing to get all permission flags when only providing one, do you think that's intentional behavior?
15aea68 types(Caches): add GuildStickerManager and Guil... - timotejroiko
41c5c2c Docs build for branch master: 15aea68946f4d35a4... - iCrawl
Seems like this happens because if you have a permission bitfield of 8n (ADMINISTRATOR) and call .toArray() on it, it will resolve into all permissions which seems counter intuitive. Can you check if this behavior also happens on v12?
calling .toArray() gives the same output in both v12 and v13
You may be interested in the
checkAdminparameter, e.g.guild.me.permissions.missing(Permissions.FLAGS.ADMINISTRATOR, false)
This indeed fixes de issue, but as @Im...
I suppose the common use case would be to have checkAdmin=true for this, but checkAdmin=false for bits.
So that:
[admin].missing(manage_webhooks) => [] admin means everything here
[manage_webhooks].missing(admin) => [admin] admin only means admin here, not everything
So 2 parameters with probably these defaults?
Now a descriptive docstring for these would be nice. ๐ค
I suppose the common use case would be to have
checkAdmin=trueforthis, butcheckAdmin=falseforbits.
So that:
[admin].missing(manage_webhooks) => []admin means everything here
[manage_webhooks].missing(admin) => [admin]admin only means admin here, not everythingSo 2 parameters with probably these defaults?
Now a descriptive docstring for these would be nice. ๐ค
This makes sense, but the thing is currently .missing without checkAdmin flag set to false...
Yes, that's because it's allowing the administrator flag in your provided bits to act as what administrator usually does: All permissions.
I suppose the common use case would be to have
checkAdmin=trueforthis, butcheckAdmin=falseforbits.
So that:
[admin].missing(manage_webhooks) => []admin means everything here
[manage_webhooks].missing(admin) => [admin]admin only means admin here, not everythingSo 2 parameters with probably these defaults?
Now a descriptive docstring for these would be nice. ๐ค
I believe this isnโt the way to go. The fact that [admin].toArray (Where [admin] is the ...
Hello everyone,
Everything is in the title. It is reproducible with the current master version, which I pulled 2 hours ago. I don't have a specific commit number, it doesn't seem very important.
Replying interacts with an embed message that contains images, while being ephemeral, prevents the images from being displayed. Proof in the following capture with and without ephemeral.
let messageEmbed = new MessageEmbed();
messageEmbed.setAuthor('Extension pour navigateurs', "att...
You already can control it - disable auto-respawn and listen for the relevant events yourself.
I might be understanding this wrong, but this method allows you to do what you described.
Discord doesn't allow files to be attached to ephemeral messages. discord.js is unable to do anything about this.
Please describe the changes this PR makes and why it should be merged:
Since the addition of default auto archive durations to Discord, the autoArchiveDuration parameter is now optional on the Discord API (tested). This PR marks that parameter as optional on the docs and types.
๐ Upstream PR: https://github.com/discord/discord-api-docs/pull/3567
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know...
Please describe the changes this PR makes and why it should be merged:
MessageButton#setDisabled and MessageSelectMenu#setDisabled currently need to be passed a parameter set to true to actually disable them. This PR defaults said parameter since the method name implies this functionality
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't n...
Please describe the changes this PR makes and why it should be merged:
Since #5906 interaction channels get resolved by Action#getChannel, however this method does not account for the User being in data.user for interactions instead of data.author. Since the interaction data does not include a 'user_id' field a partial user with the id of undefined gets added to the cache if the interaction is triggered from a DM channel.
I am not too familiar with discord.js internals, so I hope this...
Please describe the changes this PR makes and why it should be merged:
Client#_finalize is currently showing up in the docs due it being not marked as private
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
- This PR only includes non-code changes, like changes to documentation, README, etc.
LGTM, waiting for upstream PR to be landed first.
We probably want to store guild outside of the loop, as well as guard it, so we don't execute the getter's logic multiple times.
* @type {?(TextChannel|DMChannel|NewsChannel|ThreadChannel)}
Please describe the changes this PR makes and why it should be merged:
Discord.js is not meant to be cache independent in its current state. The option to override caches is provided but overriding some of these caches will cause major issues internally. Those caches are: GuildManager, ChannelManager, GuildChannelManager, RoleManager, and PermissionOverwriteManager.
| โ ๏ธ Overriding the cache for any of the managers listed above is now considered unsupported. Unsupported m...
* <warn>Overriding the cache used in `GuildManager`, `ChannelManager`, 'GuildChannelManager', `RoleManager`,
* and `PermissionOverwriteManager` is unsupported and **will** break functionality</warn>
35fa3b3 docs(Client): mark _finalize as private (#6281) - muchnameless
6fed3f6 Docs build for branch master: 35fa3b3103998f932... - iCrawl
we get channels with the initial guild payload or channel creates
unless people severely mess things up (sweep channels during runtime) this can not return null
Is your feature request related to a problem? Please describe.
It appears inconsistent to still have MessageEmbed#addField within the Discord.js API as we have MessageEmbed#addFields
Describe the ideal solution
I suggest deprecating or removing MessageEmbed#addField().
I don't even want to relive the last time we did that, I think that's enough PTSD for a lifetime.
What about this syntax?
// name, value, inline
embed.addFields([
['Amount', '0', false]
])
Please describe the changes this PR makes and why it should be merged:
Fixes a bug where the client would not emit ready despite being ready, having to wait 15 seconds instead when no guilds intent was specified
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
We did this once before. It was one of the most hated changes we ever made.
We know it's pointless when addFields exists, we're just not going to remove it.
wouldn't it be better to just put it in the docs and/pr guide instead of also logging a warning? or at least add a way to disable the warning
and why do the typings say TODO: ๐ค
https://github.com/discordjs/discord.js/pull/6271/files#r681339770
if it can never be null then ...?
return this.channel.threads.resolve(this.id);
and why do the typings say
TODO:๐ค
Because we need TODO things. Those managers are removed from the typings so as to discourage/prevent them from being overriden by cacheWithLimits/makeCache, but there is the intention to refactor things sufficiently such that those caches being empty does not break functionality.
why not just remove the functionality to override these caches then?
that makes more sense to me than adding a warning not to do it
const time = new Intents(this.manager.client.options.intents).has(Intents.FLAGS.GUILDS) ? 15000 : 0;
or perhaps use a boolean variable like hasGuildsIntent, then below
}, hasGuildsIntent ? 15000 : 0).unref();
`Shard ${time ? 'did' : 'will'} not receive any more guild packets` +
`${time ? ' in 15 seconds' : ''}.\n Unavailable guild count: ${this.expectedGuilds.size}`,
I disagree with totally removing it; you can still just not use the functionality it breaks if you want
wouldn't it be better to just put it in the docs and/or guide instead of also logging a warning? or at least add a way to disable the warning
Although I did add it to the docs, the process warning is a much more present warning. It will only emit the warning once per process run, so up to 5 total warnings. It's more of a reminder like "hey, things are gonna break" and I don't want people just disabling the warning because they saw someone else do it.
why not just remove the function...
lol, I meant to do it this way but then totally botched it...thanks!
As described in the title, this error summons randomly, everything was working fine, and after I reinstall everything I get this error on every collection I have.
Even guilds cache and members cache get the same bug.
I define them like this
let databaseCache = new Discord.Collection()
Further details:
- discord.js version: discord.js dev version of this commit
- Node.js version: 16.5.0...
Collection#array was removed. pr for the removal
iirc use: [ ...databaseCache.keys() ] to get the array.
fully documenting and typing it as nullable is not feasibly possible with how the library is designed at the moment, yet decided to handle it when easily possible, which is the case here, since the return value was already nullable.
Please describe the changes this PR makes and why it should be merged:
At the moment, if Discord adds a new channel type, we have to update the types in many places, this creates issues as far as the type consistency go, such as MessageCollector not accepting NewsChannel as a valid channel type.
I also considered #6262 as an alternative fix for this, however, a generic type doesn't have many of the benefits from an union, such as being able to exclude certain types (`channel.guild ?...
Please describe the problem you are having in as much detail as possible:
When creating or editing permission overwrites for channels my client is unable to toggle any of the MANAGE_THREADS, USE_PUBLIC_THREADS, USE_PRIVATE_THREADS
permission flags despite it being documented and it being told within the support server that those permissions are supported
It throws no errors, whether it be caught or not
And does not work as intended for those particular permissions
**Include a rep...
Please describe the problem you are having in as much detail as possible:
My Discord Bot is not receiving 'interactionCreate' and 'messageCreate' events. I have latest version of discord.js installed (version number below). The 'message' event is working fine. My command is registered correctly and is visible in Discord.
Include a reproducible code sample here, if possible:
const Discord = require('discord.js');
const { token } = require('./config.json');
const clien...
Your discord.js version doesn't have these events. They belong to version 13!
I'm having the same issue as well, following the guide here - https://discordjs.guide/interactions/registering-slash-commands.html
@Jiralite the latest tag is 12.5.3 per https://github.com/discordjs/discord.js/tags, and the documentation includes instructions to use messageCreate and interactionCreate. Where does one source v13.x.x? NPM registry notes 12.5.3 as latest as well.
At this point in time, the guide is meant to be used for creating v13 bots. v13 hasn't been completely released yet, you may install a pre-release by using npm install discord.js@dev. The guide for v12 is accessible at https://v12.discordjs.guide, however, it is advised to start making your bots compatible with v13 as early as possible, and this includes creating new ones.
Please describe the changes this PR makes and why it should be merged:
This PR makes a small change to Collector#checkEnd to make it return a boolean representing whether or not the collector ended.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
Please describe the problem you are having in as much detail as possible:
The client crashed after disabling the member and user cache (GuildMemberManager: 0, UserManager: 0) and listening to the userUpdate event. I was expecting it to be emitted with some data or partial data.
Error:
/media/vicente/Secundario/Desktop/Proyectos/djs-limited-caching/node_modules/discord.js/src/client/actions/UserUpdate.js:11
const oldUser = newUser._update(data);
...
Thats intended, we just didn't document it so far.
Whoops, didn't mean to close this.
We would have to investigate completely disabling the UserManager though.
Chances are completely disabling it will be unsupported. Our userUpdate event isn't exactly the raw update from discord.
You could try setting it to like 10(?) or so, this should solve your problem. Or even 5 for that matter.
Also disabling your GuildMember cache like that will make you unable to check for your own clients permissions, is that intended in your use case?
Also disabling your GuildMember cache like that will make you unable to check for your own clients permissions, is that intended in your use case?
No, that was not my intention.
In this case the error happened when a user changed their username, if it was emitted by a gateway event it would be useful in case a developer wants to reduce memory consumption and just cache the client using the keepOverLimit option, but also be able to listen to the userUpdate event to provide logging.
But I know it might be better to consider not supporting disabling that cache and consider fixing it in future versions.
With the current way this event is set up (since it's not a real event) and how much work it would be, this is sadly unfeasible in v13.
BUT like I said, try lowering the number to something more feasible that still nets you a memory benefit, like 10-100 (mind you, users or members are usually no problem until you reach like 200-500k of them).
Please describe the changes this PR makes and why it should be merged:
This is an addendum to #6212, it simply exports the different button option variants, and cleans up definitions.
Status and versioning classification:
Please move lines that apply to you out of the comment:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
Maybe InteractionButtonOptions, as the rest of the buttons trigger interactions?
Just one suggestion, but won't block.
Maybe check if this._cache.constructor is Collection, instead of checking for the name?
3c7c822 refactor(MessageComponents): default setDisable... - muchnameless
a72b5a3 fix(Action): getChannel interaction DM (#6280) - muchnameless
a5739b1 Docs build for branch master: 3c7c82292a914eb9b... - iCrawl
1135036 Docs build for branch master: a72b5a355e443f17e... - iCrawl
61db5f7 refactor: added TextBasedChannels type (#6286) - kyranet
09471be fix(WebSocketShard): mark shard ready if no gui... - ckohen
298a91b Docs build for branch master: 61db5f7618e30c050... - iCrawl
49517fe Docs build for branch master: 09471be30eea25409... - iCrawl
6b2098f feat(Constants): added more error codes (#6234) - kyranet
0264f09 Docs build for branch master: 6b2098f7c7592eee2... - iCrawl
Please describe the changes this PR makes and why it should be merged:
Added a period to the first console.log for consistency. Corrected typo in second console.log to read "Successfully".
Status and versioning classification:
- This PR only includes non-code changes, like changes to documentation, README, etc.
00d5cee Fixed typos in the slash command register examp... - pixxies
a36dd27 Docs build for branch master: 00d5ceebf775a0aaf... - iCrawl
Collection#arraywas removed. pr for the removal
iirc use:[ ...databaseCache.values() ]to get the array.
Thx dude!
The number of people who want structures are larger than the number of people who don't.
They don't actually give a damn
Please describe the problem you are having in as much detail as possible:
Include a reproducible code sample here, if possible:
const { Client, MessageEmbed, MessageActionRow, MessageButton, Intents } = require("discord.js");
const client = new Client({intents: [Intents.FLAGS.GUILDS,Intents.FLAGS.GUILD_MESSAGES]});
let page = 0;
const pages = [
(new MessageEmbed).setTitle("Page 1"),
(new MessageEmbed).setTitle("Page 2"),
(new MessageEmbed).setTitle...
Please describe the changes this PR makes and why it should be merged:
This PR fixes a grammar mistake in the documentation, which can be found somewhere like here. "An Sticker" is not correct, and neither is "an StickerResolvable", and should be "A sticker" instead because Sticker is not a vowel.
Status and versioning classification:
- This PR only includes non-code changes, like changes to documenta...
The "end" event doesn't provide a single interaction, it provides a Collection of all interactions collected by the collector
The "end" event doesn't provide a single interaction, it provides a Collection of all interactions collected by the collector
Oh, okay. But what about the collect event is never triggered?
> 0 seems to be a rather odd restriction as well. after all 0 is a valid index. please add some debugging logs to your code or spin up a debugger to inspect the state and find out where things don't get triggered and why.
If you need more direct help you can also check out the discord server at https://discord.gg/djs
@almostSouji Since you added the question label I am telling this:
I already asked in discord and only one guy helped me, still that guy couldn't find out the bug. So I opened a issue
Also I tried pinging Monbrey, he always responds to not ping
cc0a600 Docs build for branch master: 90c2e072bf0ab3562... - iCrawl
Use Array#includes instead
- const filter = (i) => (ids.indexOf(i.customId) > 0);
+ const filter = (i) => ids.includes(i.customId);
Please describe the problem you are having in as much detail as possible:
When I trying to call user.username on Client instance, it's returns undefined.
Include a reproducible code sample here, if possible:
...
const client = new Client({ intents: [ Intents.FLAGS.Guilds ] });
console.log(client.user.username); // undefined
...
And here is output of the console.log(client):
[
Client {
_events: [Object: null prototype] {
shardD...
it will be defined in the ready event
it will be defined in the ready event and please use the discord server the next time
Client has content, but I can't get user.username of the client. Ever in ready event.
Also, I used Discord server, and nobody answered me. Here it is: #djs-help-v14 message.

Works for me ๐คทโโ๏ธ
Please describe the changes this PR makes and why it should be merged:
@kyranet and I found the bug when updating @skyra/editable-commands
when our custom function that accepted an argument of MessageTarget
was suddenly no longer accepting message.channel. Turns out it was
because of a mistake @kyranet made lulz
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done...
threads do not have their own permissions, but operate on the parent's permissions instead.
if the parent has "public threads" people will be able to participate, even if they cannot type in the parent channel
typing in the parent channel + "public threads" will allow people to create a thread.
Is this feature still needed?
I made my own package. So I would not need it. But when someone wants it, I can create a PR for it.
5b0621f types: make MessageTarget extend on TextBasedCh... - Favna
3ee2ad7 Docs build for branch master: 5b0621fb3a8ecefcd... - iCrawl
Please don't remove Structures. My bot's entirely dependent on it. If someone adds something that doesn't work, its them to blame, not you. They should've known what they're messing with before updating the structure.
Then you better fork and fix ๐คก
6e3236a fix(Message): make #channel and #guild getters ... - almostSouji
c9c4009 Docs build for branch master: 6e3236ab64549d274... - iCrawl
ae6200e types(MessageButtonOptions): Clean up and expor... - suneettipirneni
f7794a2 Docs build for branch master: ae6200e58e6062372... - iCrawl
5be471b refactor(Channels): fix incorrectly shared prop... - monbrey
1fafc9e Docs build for branch master: 5be471b47dd65616e... - iCrawl
Made this.channel.defaultArchiveDuration the default for autoArchiveDuration due to the conversation on the upstream PR where we found that Discord always defaults to 24h no matter what this is set to and passing null is ignored so it will replicate the default behavior of the API
While there probably isn't anything inherently wrong with this change, this method is mostly used internally after handling an event to maybe stop the collector.
What's the use case here? Do you have an example?
Gonna be honest I've never used this method before but I made this change because it made sense in my head that a function called "checkEnd" would return whether the collector ended or not after running that. Also adding this may make it so the function is used more? Not sure but if it's not meant to be used it can always be marked as private
a6d4035 fix: remove support for overriding caches that ... - ckohen
19e24ba Docs build for branch master: a6d4035176ca784e7... - iCrawl
Please describe the changes this PR makes and why it should be merged:
Adds isVoice() type guard to Channel. We already have isText() and isThread(), so it's logical to have one for voice-based channels as well.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
- This PR changes the library's interface (methods or para...
Fixes a bug introduced in #6262 which meant TextChannel and NewsChannel weren't calling _patch() on creation.
3eb4140 fix(BaseGuildTextChannel): call patch (#6298) - monbrey
bb4155d Docs build for branch master: 3eb41405f412ee2b2... - iCrawl
Please describe the changes this PR makes and why it should be merged:
I went through every page on the docs and added/fixed some things. Although the title says docs this does include very small changes to the typings and code which I will be detailing below and you're welcome to give your opinion on them if you believe they should be reverted.
โ ๏ธ This PR contains the following breaking changes:
- Removed the
RELAY_ENABLEDguild feature as it was not found on the docs - Marked `G...
this.messageId = options.message?.id ?? null;
Set it to null if not provided (as per typings), don't leave it undefined.
This cannot be removed, its for inherited classes like Permissions that do have additional parameters in .has
I cannot find any class that overwrites the has method and adds other parameters, could you link me one?
These were nicely alphabetically sorted, why change this?
Because the order is different on the Discord API docs and that's the order the library follows for other things similar to this. Makes it easier to add other features in the future.
Are you sure those are still valid? Seems like the discussion on the issue said that there was no enum but it does exist now and does not include those 3 flags cc @advaith1
the client still has MANAGED_EMOJI and GROUP_DM_CREATE but night removed them from the docs pr before merging: https://github.com/discord/discord-api-docs/pull/2624/commits/41974d06084c1b0b7d1463477788baabca0f8190
Then I guess theyโre just leftovers? Either way itโs not documented so I donโt think it should be there but Iโll let the @discordjs/the-big-3 decide
I'd rather write that off as being a fault on their end than ours.
* channel ({@link Client#channelDelete channelDelete}), or guild ({@link Client#guildDelete guildDelete}) is deleted.
* The type of activity of a user's presence. Here are the available types:
* The mode to spawn shards with for a {@link ShardingManager}. Here are the available modes:
* * 'process' to use child processes
* * 'worker' to use [Worker threads](https://nodejs.org/api/worker_threads.html)
This suggested wording feels rather informal and not right for the docs
Nope, that is right (if the message, channel or guild are deleted)
This is a list of multiple items, are is correct
I donโt agree with this because a presence can have multiple activities
Yeah I used the โformatโ that is generally used across the docs
I'm pretty sure when you use or with the list of items, you would use is instead of are as the subject is singular, not plural.
Edited that back to an activity.
Idk, I saw a bunch of stuff like Here are the available types: which is why I suggested it
It does exist, but the current version appears more often
You already can control it - disable auto-respawn and listen for the relevant events yourself.
I might be understanding this wrong, but this method allows you to do what you described.
I'd like to direct your attention to the previous comment:
Thanks for the idea, didn't think of doing it manually. If I do implement this manually, I'll post a gist to it. I still feel like this is a feature a broad range of bot owners would find useful.
It is a solution, but it ne...
Idk man if you can find me an article on that sure but are sounds better to me
Grammarly also agrees that it should be is. You are only talking about one thing after the or, so it should be is, not are.
Examples:
If the channel, or guild are deleted โ
If the message and channel are deleted โ๏ธ
If the message, or guild and channel are deleted โ๏ธ
The second and third examples make sense because you are referring to both; however, you aren't with the first example.
Please describe the problem you are having in as much detail as possible:
The issue is im getting
const token = this.client.token ?? this.client.accessToken;
^
SyntaxError: Unexpected token '?'
``` which i'm very confused about.
**Include a reproducible code sample here, if possible:**
```js
client.login(process.env['TOKEN']);
Further details:
- discord.js version: 13 Dev
- Node.js version: 14
- Operating syste...
Make sure your node version in 14, this occurs on 12 and below
Make sure your node version is 14, this occurs on 12 and below
Alright, i'll double check that because I am running node 14. But, i'll take a look into that.
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue โ you will get redirected there anyway.
Please describe the problem you are having in as much detail as possible:
I got an error from this code.

I think discord.js should reply something else
Include a reproducible code sample here, if possible:
.on("ready", () => {
.guilds.cache.get("Id of a guild").commands.create();
});
Further details:
- discord.js version: 13.0.0-d...
The create() method expects you to pass in an actual command to create.
We should not have to validate that you use methods correctly.
Please describe the problem you are having in as much detail as possible:
When removing a user reaction from a MessageReaction, when accessing the cache afterwards it still has the user in it.
Issue in a real world example: I have an embed with an either one or other option, and if a user clicks option B I remove their reaction to option A, and re-render the embed with an updated list. This bug is causing the user to show up under both A and B, because I am using the cache for use...
Maybe I have read incorrectly but it doesn't seem to explain why we can't manage thread based permission overwrites within text channels, and why my reproducible sample throws no errors while still not actually toggling the channels permissions
This might be a more visual example
https://imgur.com/a/j6v6Qq7
You can see that SEND_MESSAGES is true but all three USE_PUBLIC_THREADS, USE_PRIVATE_THREADS, MANAGE_THREADS do not change at all
i don't believe the brackets are needed here
* @returns {Promise<GuildBan|Collection<Snowflake, GuildBan>>}
same here
* @returns {Promise<GuildMember|Collection<Snowflake, GuildMember>>}
and everywhere else
* @typedef {'process'|'worker'} ShardingManagerMode
i think this is valid ?
i use firefox can't look discord document.
firefox: 90.0.2
but chrome can look document.

It is but this isnโt done anywhere else on the library because if more options were added this would become huge and it also just repeats the information above so I donโt think itโs necessary
Iโve seen multiple commits just adding these brackets because otherwise the docgen gets really messed up
Only when you would do ?x|?y it needs to be ?(x|y).
Not for the use case you demonstrate.
Yeah for this specific case I know there wonโt but for the sake of consistency I still think it should say string + weโd be repeating information that was mentioned above so I personally donโt see a point
Yeah that works just fine I donโt remember seeing you talk about that but it didnโt even cross my mind
Please describe the changes this PR makes and why it should be merged:
This adds a "MAX" option to ThreadAutoArchiveDuration that sets a thread's auto-archive duration to the maximum one, based on the guilds boost count.
I understand that this is not really needed, so here's a couple of reasons this may or should get rejected:
- Runtime check
- Changes
ThreadAutoArchiveDurationtype tonumber | string(could be solved by setting all options to string and converting later) ...
Seems like the CI got stuck, can someone rerun it?
* @typedef {number|string} ThreadAutoArchiveDuration
why not just scrap thia variable and assign to autoArchiveDuration directly
Please describe the changes this PR makes and why it should be merged:
Just fixed a small typo introduced in #6282

Status and versioning classification:
- This PR only includes non-code changes, like changes to documentation, README, etc.
Same here:
* @returns {Promise<*|Array<*>>} Results of the script execution
Same here:
* @returns {Promise<*|Array<*>>}
Same here:
* @returns {Promise<*|Array<*>>} Results of the script execution
Could've sworn I had done this one already bruh
The CI is just broken today apparently
There seems to be a partial outage, although the workflow is now at least queued.
b639b6c refactor(InteractionCollector): only keep Ids o... - Bluenix2
I'm honestly not sure what to do with this PR in its current state and what seems to me like a Discord API bug.
I'm honestly not sure what to do with this PR in its current state and what seems to me like a Discord API bug.
I think we should wait to see what the dapi maintainers say about the other PR and if the bug gets fixed. If it does I can revert the last commit
40d987a Docs build for branch master: b639b6c6533bde64f... - iCrawl
0fbe83a Docs build for branch master: dd3a79eead4f01094... - iCrawl
f1e2621 Docs build for branch master: 5b4efd13c9eced97f... - iCrawl
Just one more PR to defer the v13 release
Please describe the changes this PR makes and why it should be merged:
This renames .defer() to .deferReply() and with it also InteractionDeferOptions for more correctness (you do not defer the interaction itself) and better consistency with .deferUpdate() and possible upcoming methods.
I wasn't sure if .deferred should be renamed to .replyDeferred or something like that, so I kept it at the current name for now.
**Status...
4241feb refactor(Interaction): rename defer to deferRep... - vaporox
a5a6439 Docs build for branch master: 4241febe24e6b5520... - iCrawl
Check the guild features, not the subscription count
This is unnecessary, edit already handles it
ThreadManager#create already does this
* .then(guildBan => console.log(`Banned ${guildBan.user?.tag ?? guildBan.user.id} from ${guildBan.guild.name}`))
Although this function can resolve to either a GuildMember, a User or an ID, I think the name user is more appropriate than guildBan because that gives off the idea that it will return a GuildBan object. As for the rest, I did user.user?.tag ?? user.tag ?? user because it can resolve to a GuildMember (user.user.tag), a User (user.tag), or an id (user) and your approach would ignore the scenarios where User is returned
This looks completely weird.. user.user?
I know it can be a member, or a user..or an id (why did we do this again), but maybe renaming the result variable would be better? @iCrawl thoughts?
a partial? Wouldn't this be better worded as partial? @discordjs/the-big-3
Honestly, if it's that complicated, maybe just don't "show" such an example at all.
I'd also go with partial here.
Yeah I added a typedef above for this, it should've never been added in the first place I just read it wrong when I did it
Yeah I agree tbh, should I change?
or we could use instanceof checks to more explicitly say what we're checking for here
The docs aren't a guide. Long and unnecessary examples defeat its purpose.
Yeah ik but it should probably say the name of the person anyway.
Wouldn't it be better if it just always returned the user instead of trying to get a member?
Besides the requested changes, LGTM
Changing the method signature and return values isn't really up for debate and I don't think a PR is up for debate either.
Sure then. Should I just rename it to something like "banned"?
Could also just name it ban =>
Why access the channel here?
haha yeah, fixing rn, missed it in copypaste
Once again, that gives off the impression that it's a GuildBan and not a Member or a User imo
You clearly show what it is afterwards though...? lol
Also theres still the return value signature on the docs. If someone ignores all that, god help.
Yeah I know but people can be really stupid, I think banned is better still
I honestly think banInfo or something would be the best, but it might be too verbose.
And I don't really care about catering to what you refer to as "really stupid".
Maybe we can make a new method in Util to fetch the highest duration available for a guild, but otherwise this is fine.
I know it would just avoid unnecessary confusion
Either way, banned, ban or banInfo, you choose
Just go with banInfo and kickInfo for now, we can always change that whenever, I don't want a single word be blocking the whole PR.
Any way this could not mutate the options?
b4afcf8 docs: general cleanup and improvements (#6299) - ImRodry
f473f43 feat(Collector): return a boolean on checkEnd (... - ImRodry
a7c0c05 Docs build for branch master: b4afcf8236b0fb497... - iCrawl
913b2ae Docs build for branch master: f473f43d081c8c703... - iCrawl
Some textual errors in this PR, namely writing id instead of ID.
Some textual errors in this PR, namely writing id instead of ID.
Both are fine but if you wanted that changed you shouldโve probably said that before merge
id is used throughout now anyway, refer to #6036
let maxAutoArchiveDuration = data.autoArchiveDuration;
and remove the ?? ... at the end
Please describe the changes this PR makes and why it should be merged:
This PR renames .deferred to .deferredReply in order to be consistent with the recent change from .defer() to .deferReply() in PR #6306.
I wasn't too sure whether to do deferredReply or replyDeferred, but the only reason I went with deferredReply instead is that it sounds more consistent with deferReply(). If replyDeferred is decided instead I can change it to that. I guess you can see which is better ...
I think this was fine as it was. The property applied to both deferReply and deferUpdate, and could apply to any future type of defer. deferred is accurated.
Hmm... It seems to load fine for me with Firefox 90.0.2 ๐ค
348a059 Docs build for branch master: a56ba097dce5b4769... - iCrawl
Please describe the changes this PR makes and why it should be merged:
This PR fixes a grammar mistake. Since HTTP is an acronym, and when saying the first H, it sounds like a vowel, it should be "an HTTP" and not "a HTTP".
Status and versioning classification:
- [x] This PR only includes non-code changes, like changes to documentation, README, etc.
oh...i try firefox clear cache and close all firefox plugin,now is wokring!
so maybe plugin bug. omg.
now i close this issues. thx @muhimur9049 : )
Please describe the changes this PR makes and why it should be merged:
For ThreadChannel, errors occur because channel.threads do not exist.
This PR fix that problem.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
What's the type of this.channel when it lacks of threads?
ThreadChannel does not have threads. So when I use code message.thread in ThreadChannel, then error(Cannot read propery 'resolve' of undefined) is occured.
71698c6 Docs build for branch master: 913c9fa17672fa914... - iCrawl
35d987b Docs build for branch master: 06644770c8254b105... - iCrawl
Please describe the changes this PR makes and why it should be merged:
This PR removes the abort-controller package from the dependencies as a favor of the initial Node.js implementation of the AbortController API which was graduated here.
The lib should use the initial implementation of the APIs if possible.
**Status and ver...
Please describe the changes this PR makes and why it should be merged:
This PR introduces a grammatical fix. a Interaction is incorrect, and in turn has been fixed to an Interaction.
Status and versioning classification:
- [x] This PR only includes non-code changes, like changes to documentation, README, etc.
Please describe the changes this PR makes and why it should be merged:
Fixes a bug in the current sweeping of caches where ThreadChannels would remain in the client and guild channel caches, only being removed from the thread channel caches.
Allows a bit more control over how thread channels are swept from these caches without triggering the process warning for overriding the channel caches.
Also fixes a minor documentation error in LimitedCollection.
**Status and versioning c...
what about this._cache.constructor === Collection ?
This is an intentional hardcode on the name
It also technically allows for an extension of Collection the way that discord.js used to due it (e.g Collection extends BaseCollection) that won't output the error.
Please describe the changes this PR makes and why it should be merged:
Fixes a hard crash when resolving mentioned roles in previously uncached messages being replied to.
Also passes the guild id that is received with said message reference so that it is more likely the mentions will be resolved.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typi...
d5e28c2 refactor: replace dependency with initial imple... - VoltrexMaster
02e3a8a Docs build for branch master: 7787a7695a3733f28... - iCrawl
c481f11 Docs build for branch master: d5e28c22988376825... - iCrawl
Really liking the utility function ๐
Can't we move this outside the loop to avoid a check for each role?
I'd really love to see this filtering get moved to a util function, but LGTM I suppose
f950dad fix(GuildMemberManager): fetchMany fixes - iCrawl
Please describe the changes this PR makes and why it should be merged:
Fixed the redundant size checks (they aren't working for some time now anymore and with our caching strategy its completely haywire).
Additionally the way the checking for option || force is done could maybe be done differently? I'm open to suggestions on that front.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update...
[discordjs/discord.js] New branch created: fix/guild\-member\-fetching
Please describe the changes this PR makes and why it should be merged:
The package was updated to node 16 on https://github.com/discordjs/discord.js/commit/a56ba097dce5b476939a10d6dc9250a966356594 so might as well update the CI too
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- This PR only includes non-code changes, like changes to documentation, README, etc.
Erlpack doesn't works on Node 16
e27cf67 Docs build for branch master: a0974fdbbba1e46ab... - iCrawl
3725dca fix(Caching): sweep archived threads in all cha... - ckohen
1be564d Docs build for branch master: 3725dcafc0cbb4a40... - iCrawl
[discordjs/discord.js] branch deleted: fix/guild\-member\-fetching
52817fc fix(GuildMemberManager): fetchMany fixes (#6314) - iCrawl
1200bba fix(MessageMentions): check guild exists before... - ckohen
f691996 Docs build for branch master: 52817fc414eef5220... - iCrawl
431aff6 Docs build for branch master: 1200bba7bcc48dab6... - iCrawl
6791c1b Docs build for branch master: cfde127072ae06b63... - iCrawl
863734a feat(GuildMemberManager): throw TypeError on in... - monbrey
4b555fd feat(Message): added string type for message no... - wonderlandpark
8c8883e Remove Guild#member (#4890) - anandre
6f30763 remove User#locale (#4932) - advaith1
12a096b fix(RoleManager): fix ID return value, change r... - vaporox
718e782 Docs build for branch stable: 44231dea9b5bca1cd... - iCrawl
863734a feat(GuildMemberManager): throw TypeError on in... - monbrey
4b555fd feat(Message): added string type for message no... - wonderlandpark
8c8883e Remove Guild#member (#4890) - anandre
6f30763 remove User#locale (#4932) - advaith1
12a096b fix(RoleManager): fix ID return value, change r... - vaporox
e1321e5 Webpack build for branch stable: 1f4b9fe749cc05... - iCrawl
8ea28f5 Docs build for branch stable: 1f4b9fe749cc0501e... - iCrawl
b7f02ea Docs build for branch stable: cfde127072ae06b63... - iCrawl
Please describe the changes this PR makes and why it should be merged:
The most important fix you'll ever see
Status and versioning classification:
- There are no code changes
- Typings don't need updating
- This PR only includes non-code changes, like changes to documentation, README, etc.
[discordjs/discord.js] New tag created: 13\.0\.0
Oh yes, a day one patch.
4bef5df Docs build for tag 13.0.0: cfde127072ae06b63f17... - iCrawl
Okay so, what you're getting at is we should combine APIInteractionDataResolvedChannel and APIInteractionDataResolvedGuildMember into APIInteractionDataResolvedOption and just make one @external reference, right?
The other option I was thinking of was just leading to the usual channel object/guild member object page since most other API-types do that.
Is your feature request related to a problem? Please describe.
Actually using buttons and selectors is boring and brings you to write a lot of code for something witch can be simple, mostly when you just need one or two buttons/selectors.
The action row system hasn't any specific features or options but it's a needed component if you want to work with buttons stuff.
.send({
content: 'Interact with my beautiful buttons',
components: [
new MessageActionRow({
...
Been there done that, decided against it because removing MessageActionRows is not feasible since they might change in the future and it will require a breaking change on our side to support that new usage.
I already thought about it before opening the issue.
The options that Discord could add would not have any impact on this because it's a simple shortcut for simples usage (most of the cases when you use components).
If the developer needs those new features (that Discord could add in the future) he can use the "complicated method" to implement them.
Also (assumption): when you see the roadmap of the planned features for messages components of Discord, these are only optional additions to m...
[discordjs/discord.js] branch deleted: master
[discordjs/discord.js] New branch created: main
Yep thatโs it
There are many different types of API external links, thereโs no set rule for them so thatโd be fine
9514fe7 Docs build for branch main: cfde127072ae06b63f1... - iCrawl
0045cf1 Docs build for branch main: 3bff08acf781d9fe1ab... - iCrawl
108d79b Docs build for branch main: cd1aefb46c6a6bcb4b9... - iCrawl
b9526af Docs build for branch main: 2b61fb5b3c342a5dabf... - iCrawl
Some time this errors appers out of blue
(node:26) UnhandledPromiseRejectionWarning: ReferenceError: AbortController is not defined
at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:172:15)
at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:176:19)
at RequestHandler.push (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:50:25)
Further details:
- disc...
You need Node.js v16.
IIRC AbortController was introduced in Node v16. By the way discord.js needs Node v16 or more. Try updating
That goes against what we removed in v13, specifically allowing "simplification".
Remember the whole send(embed) but once you need content you have to do send({ content: '', embed }). Same spiel here.
Yep, I understand. It is surely better like that, it would be illogical to make this move.
Thank you for taking the time to answer me.
Nice work for this v13 ๐
Good evening!
In V12 I could get the current Time of the Playback with StreamDispatcher.StreamTime how do I get this now?
Hi @hellos3b cache is not updated when the <ReactionUserManager>.remove() method is called, your Client remove it when Discord API send you the messageReactionRemove event (here exactly).
The promises of each method of DJs are resolved once the request is sent.
It's not a bug, just that your ca...
Please describe the changes this PR makes and why it should be merged:
Add THREADS_ENABLED guild feature, to know whether a guild has threads enabled or not.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
Please describe the changes this PR makes and why it should be merged:
Fixes this TypeScript error that was introduced cause of https://github.com/discordjs/discord.js/pull/6286

Status and versioning classification:
Please move lines that apply to you out of the comment:
- Code changes have been tested against the Discord API, or there are no code changes
- I know ...
Is this still an issue? If so, what discord.js/node.js version?
Recently just got the 429 error. I have no idea what caused it. It could be because of the webhooks for errors my bot uses, or maybe it was using the .fetch method too often when fetching a channel (?).
I'm going to try and restart the bot in about an hour to see if it goes away or not by then.
Please describe the problem you are having in as much detail as possible:
There're exists a problem with literals on TypeScript lower than 4.2. If you use new types including literals (e.g. HexColorString, UserMention), there occurs a following error: "RangeError: Maximum call stack size exceeded" (you can read about it here, for example: https://github.com/TypeStrong/typedoc/issues/1440 or https://github.com/microsoft/TypeScript/issues/41651). I haven't found anywhere in docs that Typ...
Is your feature request related to a problem? Please describe.
I need to change an embed image often, so what i do is when editing the message, use like
edit({embeds: [embed], files: [attachment]})
What this do its to set the message embeds to the array of embeds i pass, and ADD to the attachments the files that i pass.
edit({content: 'Something Amazing!', embed: [], files: []})
This remove all embeds from the image, and does nothing to the files.
**...
Please describe the changes this PR makes and why it should be merged:
First(?) semver major PR ready for v14 -- removes the deprecated client message event.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
- This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
Please describe the changes this PR makes and why it should be merged:
PR #6271 has introduced a regression, because fetched messages do not include a guild_id property in the rest response. This causes Message#guild to become null for fetched messages, even if they were fetched from a guild channel.
- try to assign the guild id from the channel, if available
- adapt the
Message#guildgetter to also return the guild from theMessage#channelgetter, if necessary and availa...
Please describe the changes this PR makes and why it should be merged:
Akin to #6324, removes the deprecated client interaction event.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
- This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
Please describe the changes this PR makes and why it should be merged:
Removes the deprecated messageSweepInterval and messageCacheLifetime client options, and the sweepMessages client method that they used.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
- This PR includes breaking changes (methods removed or rena...
Please describe the changes this PR makes and why it should be merged:
Refactors / Fixes the _fetchMany function in a non-breaking but also non-stupid way to actually work as intended (since this is not a REST endpoint either).
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
5e360a6 fix(GuildMemberManager): refactor fetchMany - iCrawl
[discordjs/discord.js] New branch created: fix/guild\-members\-fetch\-many
[discordjs/discord.js] Pull request opened: #6329 chore: add other maintainers to GH Sponsors config
Please describe the changes this PR makes and why it should be merged:
Adds the core maintainers with GitHub Sponsors enabled to the funding doc to help point folks in the right direction if they wanna sponsor those that keep this lib going.
Space, ily, but you don't have Sponsors enabled (which is in a way great 'cause the config only allows four usernames)
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code ...
9e6a627 chore: add other maintainers to GH Sponsors con... - MattIPv4
8205e35 Docs build for branch main: 9e6a627a13fc5f372a8... - iCrawl
Please describe the changes this PR makes and why it should be merged:
Separates out the default options being passed to Options.cacheWithLimits.
This allows devs to change only a single one of the default overrides or add on top without having to redo the rest.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
- This PR ...
Is this change necessary with the constructor's assignment?
Likelihood? No
Theres an extremely small niche use where you fetch a message, the channel is not cached, now you have no guiildId, channel gets cached, now you have guild
60ace9a types(Util): fix cleanContent parameter type (#... - ThaTiemsz
028eb1d Docs build for branch main: 60ace9a2d4cd2844a86... - iCrawl
Please describe the problem you are having in as much detail as possible:
See title. Only the private fields of options are being populated. The public fields (client and data) are undefined.
Include a reproducible code sample here, if possible:
Here is an example of the issue:
I submit the following registered command:
/blacklist add role queue: 760577441927659541 role: @mod
With the code:
client.on("interactionCreate", async (interaction: In...
I am not sure I understand you, but https://github.com/discordjs/discord.js/pull/5557 added attachments as an option when editing messages.
You can combine it with files too to replace earlier attached files:
await message.edit({ files: [newFile], attachments: [] });
ceae596 fix(Message): handle fetched messages (#6325) - almostSouji
909c873 fix(GuildMemberManager): refactor fetchMany (#6... - iCrawl
[discordjs/discord.js] branch deleted: fix/guild\-members\-fetch\-many
53bc8a0 Docs build for branch main: ceae5960edefc63be5f... - iCrawl
a2a1320 Docs build for branch main: 909c87353e24eb7947d... - iCrawl
2b44c3e Docs build for branch main: 622f398f4b36b00d0a3... - iCrawl
3481d97 Docs build for branch stable: 622f398f4b36b00d0... - iCrawl
[discordjs/discord.js] New tag created: 13\.0\.1
0ad6698 Docs build for tag 13.0.1: 622f398f4b36b00d0a34... - iCrawl
fb824a3 Docs build for branch main: 0d765f53d2c6d2825f3... - iCrawl
Please describe the changes this PR makes and why it should be merged:
CDN typings had a surprising number of issues so this fixes them:
- DefaultAvatar takes "discriminator" (number), not id
- a few used
userIdwhen they were not for users - added
dynamicoption to Avatar and Icon (pulled from the banner prs) - a bunch of id args were typed as
Snowflake | numberfor some reason, changed those to justSnowflake - some methods actually take format and size in an object (for s...
[discordjs/discord.js] New branch created: chore/new\-labels
Please describe the changes this PR makes and why it should be merged:
wink
Status and versioning classification:
- This PR only includes non-code changes, like changes to documentation, README, etc.
[discordjs/discord.js] branch deleted: chore/new\-labels
29b5b52 Docs build for branch main: b2e23ca03c09be6e5f2... - iCrawl
62d74f6 Docs build for branch main: ed0f605b23aa058ee73... - iCrawl
de6db7b Docs build for branch main: d1d740c1a5719b940e8... - iCrawl
68c0591 chore: fix bug report and feature request templ... - iCrawl
17dda40 Docs build for branch main: 68c059165bd6166e53c... - iCrawl
/home/runner/fdsiifsudiyhfsdsfd/node_modules/discord.js/src/rest/RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^
SyntaxError: Unexpected token '?'
Uhh... i am on nodejs 16, help
That error says otherwise.
The issue tracker is for bug reports and feature requests, ask on the discord server if you require support, as you won't be given it on here.
The server can be found at https://discord.gg/djs
However, updating Node.js is really something you need to figure out on your own. That error clearly shows that you do not use node 16 for this process.
Please describe the changes this PR makes and why it should be merged:
Fixed a typo in GuildMemberRoleManager
Status and versioning classification:
- This PR only includes non-code changes, like changes to documentation, README, etc.
d14a6bf refactor(Options): separate default settings fo... - ckohen
Is your feature request related to a problem? Please describe.
Currently I'm trying to make a feature of a bot that allows the bot to delete and resend an inline reply as the bot, and I'd like it to conserve the ping option of the initial reply. However, there currently seems to be no way to check this.
Describe the ideal solution
A property of the reply message with a boolean for whether or not it was a ping.
Describe alternatives you've considered
Message#reference ...
ff93adb Docs build for branch main: d14a6bfe1d00511e43d... - iCrawl
d87299b fix(GuildMemberRoleManager): typo (#6335) - SinisterDeveloper
1a9fb52 Docs build for branch main: d87299ba2036ee19da2... - iCrawl
I have changed some of the messages in a more appealing manner
ApplicationCommand#type should be added so that it's possible to check whether the command is a slash command or context menu.
This increases verbosity and is inconsistent with many other errors as well as it introduces typos.
I don't see what's the improvement here.
LGTM after ThaTiemens comment is resolved
I have changed some of the messages in a more appealing manner
It only seems like one change to me, and not โsomeโ? ๐ค
Also, thereโs no space or capital p after the exclamation mark, making it improper grammar.
Please describe the changes this PR makes and why it should be merged:
fixes a typo in the warning for UnsupportedCacheOverrideWarning
Status and versioning classification:
- This PR only includes non-code changes, like changes to documentation, README, etc.
Correct a typo:
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
- This PR only includes non-code changes, like changes to documentation, README, etc.
I just correct a typo in an error message
ApplicationCommand#typeshould be added so that it's possible to check whether the command is a slash command or context menu.
ApplicationCommandInteractionData you mean
We don't accept PRs to the v12 branch, please target the main branch.
Discord is using Message#mentions's to determine whether the author was mentioned, so you can check MessageMentions#users for that.
I am not sure I understand you, but #5557 added
attachmentsas an option when editing messages.You can combine it with
filestoo to replace earlier attached files:await message.edit({ files: [newFile], attachments: [] });
If i pass an MessageAttachment to the attachments array, it will add the attachment to the message or it will set all attachments from the message with the array?
The docstring in MessageEditOptions seems to be pretty self explanatory: "An array of attachments to keep, all attachments will be kept if omitted"
Please describe the problem you are having in as much detail as possible:
When I tried to run my bot's source code, I receive this error:
C:\Users\User\Documents\GitHub\Discord-Bot\node_modules\discord.js\src\client\Client.js:544
throw new TypeError('CLIENT_MISSING_INTENTS');
^
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\User\Documents\GitHub\Discord-Bot\node_modules\discor...
As the error says:
Valid intents must be provided for the Client.
Please read the migration guide for more information.
It would be more user friendly for new people who are getting into djsv13 or updating to it to have a default intent of []
const { Client } = require('discord.js');
const client = new Client({intents:[]});
const { Client } = require('discord.js');
const client = new Client(); // Default would have: intents:[] instead of throwing an error.
If it is really necessary to have to throw an error, it would be best to throw a warning instead.
Further details:
- di...
ApplicationCommand#typeshould be added so that it's possible to check whether the command is a slash command or context menu.
isCommand() and isContextMenu() already do this
discord.js requires at least GUILDS to work, blindly setting it to an empty array would just make your bot completely unoperative, aka doing absolutely nothing, which is a worse behaviour than throwing.
discord.js requires at least
GUILDSto work, blindly setting it to an empty array would just make your bot completely unoperative, aka doing absolutely nothing, which is a worse behaviour than throwing.
That pretty stupid imo, but then a default would be intents: ["GUILDS"]
I fail to see how an empty intents would want an empty intents in that case.
394d486 feat(Threads): max autoArchiveDuration option (... - papsavas
GUILD_MEMBERS is privileged, and GUILD_MESSAGES will in 9 months. GUILDS by itself alone is useless for many bots until they switch completely to slash commands.
917e71a fix(Managers): fix typo in unsupported warning ... - xMooddyy
7f90f3e Docs build for branch main: 394d48649fe4faef8c6... - iCrawl
94bb953 ci(PublishDev): remove t and hardcoded dev vers... - shinotheshino
b5e89fd Docs build for branch main: 917e71a9ee7d8bd76d8... - iCrawl
The whole purpose of intents is for developers to think about and choose which intents they need.
A default isn't going to be set, least of all one that includes a privileged intent the developer might not have enabled.
2217cea Docs build for branch main: 94bb953bf17d33805b7... - iCrawl
ApplicationCommand#typeshould be added so that it's possible to check whether the command is a slash command or context menu.
isCommand()andisContextMenu()already do this
That's only on Interaction though. You can't do that with commands that are cached that you've fetched from the API.
// grab context menu commands
guild.commands.cache.filter(command => command.type === ApplicationCommandTypes.USER || command.type === ApplicationCommandTypes.MESSAGE)
ApplicationCommand#typeshould be added so that it's possible to check whether the command is a slash command or context menu.
isCommand()andisContextMenu()already do thisThat's only on
Interactionthough. You can't do that with commands that are cached that you've fetched from the API.// grab context menu commands guild.commands.cache.filter(command => command.type === ApplicationCommandTypes.USER || command.type === ApplicationCo...
Please describe the changes this PR makes and why it should be merged:
.avatarURL({ format: 'gif' }); throws the following:
Type '"gif"' is not assignable to type 'AllowedImageFormat | undefined'.
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
Please describe the changes this PR makes and why it should be merged:
With the default branch now named as "main", I think it would be suitable to correct some links!
In the links section, the documentation was pointing to master branch (instead of main) but a later link was pointing to stable. I just made the links here match.
Let me know if I should amend anything!
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are...
- I have also tested the issue on latest main; Commit hash: `xxx`
perhaps https://github.com/discordjs/discord.js/blob/cfde127072ae06b63f17ba19b3e0d28fddef97d6/src/sharding/ShardClientUtil.js#L9 and other instances like this aught to be changed (possibly in a seperate PR)
I left the sharding stuff alone because I too thought that would probably be best done in a separate pull request... This was just for the rename of the default branch, so. Yeah.
570fba3 chore: Rename various stuff to "main" (#6343) - Jiralite
9edda3d Docs build for branch main: 570fba33d389dcf48ca... - iCrawl
Okay so I have now been strugging with this error for a 1/2 days now.
Below I will provide my codes and notes.
Code
const { Client } = require("discord.js");
const { Intents } = require('discord.js');
const Discord = require('discord.js')
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_BANS, Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS, Intents.FLAGS.GUILD_INTEGRATIONS, Intents.FLAGS.GUILD_WEBHOOKS, Intents.FLAGS....
the code you provided works fine for me, so there's probably an issue with your discord.js installation, try uninstalling and reinstalling it
I have reinstalled visual studio code, node, checked my hosting. Reinstalled discord and updated all my packages. But the code is just not working. Please help me.
As it stands, version 16.6.0 is extremely recent. You can't expect everyone to switch to it for Discord.js alone. For now, I'm temporarily using 12.x, but I would encourage you guys to start transpiling with Babel or similar if new JS features are that important to Discord.js.
I have reinstalled visual studio code, node, checked my hosting. Reinstalled discord and updated all my packages. But the code is just not working. Please help me.
Whatโs the output when doing npm ls discord.js? Are you sure youโre running the correct file? Are you sure youโre saving the file first?
- You can get gif with
<User>.avatarURL({ dynamic: true }) - Shouldn't you add
gifto AllowedImageFormat?
Shouldn't you add gif to AllowedImageFormat?
no, that's what DynamicImageFormat is for:
https://github.com/discordjs/discord.js/blob/394d48649fe4faef8c6b30d5c04962588f86261e/typings/index.d.ts#L3398
Yep I am sure. I tried running my bot all ways even without my hosting.
Just cannot get it to work
@Hype8585 Whatโs the output when doing npm ls discord.js? Do you have any third party packages that are interfering with the discord.js version by any chance?
The code you provided works perfectly fine for me. Your installation must be screwed up then. Have you tried npm rm discord.js or npm uninstall discord.js, and then reinstalling?
Please describe the changes this PR makes and why it should be merged:
This PR fixes grammar regarding plural possessives.
In some places, it said something like The value set for a team members's membership state:. Not only is this incorrect (since it would be The value set for a team members' membership state:), but it does make it too consistent with documentation in other places.
For example, for stickers, nowhere does it say The value set for a stickers's type:; inst...
As it stands, version 16.6.0 is extremely recent. You can't expect everyone to switch to it
discord.js v13.0.0 is even more recent than node.js v16.6.0, I fail to see how is it more OK to install the former but not the latter.
I would encourage you guys to start transpiling with Babel or similar if new JS features are that important to Discord.js.
To bump to v17-nightly he said.
No, seriously, we can't. It's not only about new syntax requirements, it's more about the node.js b...
Prefix should be docs; fix appears in the change-log under bug fixes
Prefix should be
docs;fixappears in the change-log under bug fixes
Oh right, I did docs: in the other PRs oops lol
Hi !
Discord.JS documentation says that only code, channel and url properties are guaranteed.
Is there a way to "force" the return on a properties, like the uses one ?
Also, I use DiscordJS v13 with Node v16.6.1.
Thanks in advance,
LProgead.
use guild.invites.fetch() or channel.fetchinvites().
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue โ you will get redirected there anyway.
@advaith1, I use guild.invites.fetch. However, uses is never returned.
I thought that it was a bug. That's why I opened an issue here.
export interface ImageURLOptions extends StaticImageURLOptions {
Or if it complains (although not suggested, as it makes them non-assignable to each other):
export interface ImageURLOptions extends Omit<StaticImageURLOptions, 'format'> {
Ow...
Weird...
I'll try different things to make it working.
Thanks a lot for your time ๐
I used the former initially, but I then switched to a type on the second commit because it was complaining
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue โ you will get redirected there anyway.
LGTM after ThaTiemens comment is resolved
762e6be Docs build for branch main: f13d27ca2e6873f1cc1... - iCrawl
you guys to start transpiling with Babel or similar if new JS features are that important to Discord.js.
You could use babel to transform certain node_modules yourself (it's really just a very simple pipeline) if it's that important that you run on old node versions ๐
This isn't really... accurate, or strict. it's... fine probably, but idk. @discordjs/the-big-3 thoughts?
Thereโs no better way to indicate that that is the data that you can receive though
Please describe the changes this PR makes and why it should be merged:
The options type this[] as a self reference causes issues when implementing this interface. Changing this to ApplicationCommandOptionData[] fixes this issue https://imgur.com/a/0eVBoJU
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
47d2ef3 fix(Constants): fix CDN endpoint typings (#6332) - advaith1
9d824a4 Docs build for branch main: 47d2ef3e40165d846b5... - iCrawl
Please describe the problem you are having in as much detail as possible:
I had encounter a problem with messages, so Message has properties .deleted and .deletable, I suspected that these properties don't update at all so I've conducted an simple experiment
Include a reproducible code sample here, if possible:
Here's the code
// Receiving the message and everything before this
console.log(msg.deleted, msg.deletable)
await msg.delete()
console.log(msg.deleted, ms...
You also need to update the ApplicationCommandOption interface (directly below your change) to reflect that options is ApplicationCommandOption[].
See: https://github.com/discordjs/discord.js/pull/5679#discussion_r640091017
Got a TypeError: Class constructor Client cannot be invoked without 'new' error when i try to run bot.
import { Client, Collection } from 'discord.js'
import { readdirSync } from 'fs'
import { connect } from 'mongoose'
import { Config } from '../config'
import { Command } from '../interfaces/command'
import path = require('path')
export default class Bot extends Client {
public commands: Collection = new Collection()
public events: Collection = new Collection()
...
As the error says, you need to replace const client = Client(); with const client = new Client();.
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue โ you will get redirected there anyway.
I got that in my main.ts file
import { Intents } from 'discord.js'
import Client from './client'
const intents = new Intents(32767)
new Client({
intents,
}).init()
@Mnigos, it's definitely not a big witch Discord.JS...
Did you read any documentation ?
You just have to replace your imports by :
import { Client, Intents } from 'discord.js'
Hi !
That's not a bug : the msg shouldn't be updated if you don't update this variable explicitly.
Your second console.log() calls the same variable as the first one.
What's happening here is that the .deleted field isn't set by the method, but by the WS Action:
Both methods in the REST call send it without any mutation:
https://github.com/discordjs/discord.js/blob/622f398f4b36b00d0a347b548f63524703c2d395/src/structures/Message.js#L708-L711
https://github.com/discordjs/discord.js/blob/622f398f4b36b00d0a347b548f63524703c2...
@Mnigos, it's definitely not a bug with Discord.JS...
Did you read any documentation ?You just have to replace your imports by :
import { Client, Intents } from 'discord.js'
No? I importing My Bot class as Client class
It might be possible that your tsconfig.json target version is too low, since discord.js requires node 16 anyway you can safely set it to ES2020
@Mnigos, it's definitely not a bug with Discord.JS...
Did you read any documentation ?
You just have to replace your imports by :
import { Client, Intents } from 'discord.js'
No? I importing My Bot class as Client class
Oh ! My bad ! I didn't read that it was your main.ts file.
Please describe the changes this PR makes and why it should be merged:
Status and versioning classification:
this will throw a syntax error lol, the current code isn't even broken
~/lastjs-music$ node index.js
/home/runner/lastjs-music/node_modules/discord.js/src/rest/RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^
SyntaxError: Unexpected token '?'
i am getting this error
~/lastjs-music$ node index.js
/home/runner/lastjs-music/node_modules/discord.js/src/rest/RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^SyntaxError: Unexpected token '?'
i am getting this error
update to node 16.6
I can't update because I'm using repl.it :(
You forgot to update the ApplicationCommand types, otherwise LGTM!
You also need to update the ApplicationCommandOption interface (directly below your change) to reflect that options is ApplicationCommandOption[].
See: https://github.com/discordjs/discord.js/pull/5679#discussion_r640091017
5f1def3 types(ImageURLOptions): allow 'gif' format (#6342) - almeidx
options?: ApplicationCommandOption[];
39b53b4 Docs build for branch main: 5f1def37930605bea47... - iCrawl
efc20ff types(ApplicationCommandOptionData) changed opt... - JeroenoBoy
039635c Docs build for branch main: efc20ff669514b2b504... - iCrawl
public readonly channel: TextBasedChannels | null;
Please describe the changes this PR makes and why it should be merged:
updates the conventional commit url, to use discord.js-modules instead of discord.js-next
Status and versioning classification:
- This PR only includes non-code changes, like changes to documentation, README, etc.
cd393fd chore: update conventional commit URL (#6351) - NotSugden
0ba687b Docs build for branch main: cd393fd4214e111f1cf... - iCrawl
I was just doing my thing making a discord bot then I try to run it with Node.js and this error always pops up
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\ellio\Desktop\Discord-Bot\node_modules\discord.js\src\client\Client.js:544:13)
at new Client (C:\Users\ellio\Desktop\Discord-Bot\node_modules\discord.js\src\client\Client.js:73:10)
at Object. (C:\Users\ellio\Desktop\Discord-Bot\index.js:2:16)
...
v13?
No I was using V16.6.1
I was just doing my thing making a discord bot then I try to run it with Node.js and this error always pops up
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\ellio\Desktop\Discord-Bot\node_modules\discord.js\src\client\Client.js:544:13)
at new Client (C:\Users\ellio\Desktop\Discord-Bot\node_modules\discord.js\src\client\Client.js:73:10)
at Object. (C:\Users\ellio\Desktop\Discord-Bot\index.js:2:16)
at...
Okay
I was just doing my thing making a discord bot then I try to run it with Node.js and this error always pops up
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\ellio\Desktop\Discord-Bot\node_modules\discord.js\src\client\Client.js:544:13)
at new Client (C:\Users\ellio\Desktop\Discord-Bot\node_modules\discord.js\src\client\Client.js:73:10)
at Object. (C:\Users\ellio\Desktop\Discord-Bot\index...
Thanks that helped a lot @blackopss :D
I was just doing my thing making a discord bot then I try to run it with Node.js and this error always pops up
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\ellio\Desktop\Discord-Bot\node_modules\discord.js\src\client\Client.js:544:13)
at new Client (C:\Users\ellio\Desktop\Discord-Bot\node_modules\discord.js\src\client\Client.js:73:10)
at Object. (C:\Users\ellio\Desktop\Discord-Bot\index.js:2:16)...
I am having trouble with the .env I try to import it into my code but this error happens
ReferenceError: dotenv is not defined
at Object. (C:\Users\ellio\Desktop\Discord-Bot\index.js:5:9)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.ex...
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue โ you will get redirected there anyway.
This error is totally unrelated to the discord.js package.
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue โ you will get redirected there anyway.
Why this change should be merged:
Because some people keep installing discord-api-types using discord-api-types/v9 which is not available.
Status and versioning classification:
- This PR only includes non-code changes, like changes to documentation, README, etc.
error: `C:\Users\miniozoid\node_modules\discord.js\src\client\Client.js:544
throw new TypeError('CLIENT_MISSING_INTENTS');
^
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\miniozoid\node_modules\โ[4mdiscord.jsโ[24m\src\client\Client.js:544:13)
at new Client (C:\Users\miniozoid\node_modules\โ[4mdiscord.jsโ[24m\src\client\Client.js:73:10)
at Object. (C:\Users\miniozoid\Desktop\New folder\nuk...
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue โ you will get redirected there anyway.
Hello when I try to make my bot send embeds it sends the embed but the next embed doesn't get sent and I get this error,
home/ubuntu/bbarevamp/node_modules/discord.js/src/structures/MessagePayload.js:184
embeds: this.options.embeds?.map(embed => new MessageEmbed(embed).toJSON()),
^
TypeError: this.options.embeds?.map is not a function
at MessagePayload.resolveData (/home/ubuntu/bbarevamp/node_modules/discord.js/src/structures/MessagePay...
Embeds are sent as an array: embeds: [embed1, embed2, ...embed10]
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue โ you will get redirected there anyway.
Embeds are sent as an array:
embeds: [embed1, embed2, ..., embed10]The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue โ you will get redirected there anyway.
I have all my commands with embeds are sent like this
The error comes from line 70 of /home/ubuntu/bbarevamp/events/guild/message.js:70:36 - on that line it seems you arent.
That line is like message.channel.send(embeds:new Discord.MessageEmbed) is there a way I can keep it that way without entirely needing to make a new variable?
if there isn't I will fix up my code and close the issue
Just put it in an array. Issue should have been closed and taken to the server already.
everytime i try to Run the bot
it shows this error :
const token = this.client.token ?? this.client.accessToken;
^
SyntaxError: Unexpected token '?'
my coding is good no errors i even try to research but no results of fixing this please fix this
If an invalid string is passed into resolveColor, it never actually throws a COLOR_CONVERT error and will return NaN. Why is this? Well because of this line:
https://github.com/discordjs/discord.js/blob/cd393fd4214e111f1cf6de779cfcc07315e80fbd/src/util/Util.js#L473
Because [NaN isn't a truthy value](https://cdn.discordapp.com/attachments/768856355255484469/874136189278519346/node_IBC...
Please describe the problem you are having in as much detail as possible:
I can't send a image as a file. I can send text as a file though.
Include a reproducible code sample here, if possible:
// This wont work, even if i write the buffer to a file and try to directly pass the file path to D.JS like so:
/// fs.writeFileSync('./file.png', canvas.toBuffer())
/// message.channel.send({files: [./file.png]})
const canvas = Canvas.createCanvas(len * 30, 50)
...
never-fucking-mind im stupid
thanks @monbrey, this v13 change got me all over the place
Is your feature request related to a problem? Please describe.
I've been using unstable discord.js on 14.17.4 LTS Node.js version with no problems, but I can't install stable release because of the strict version requirement.
Describe the ideal solution
Node engine version requirements being revised.
Describe alternatives you've considered
nvm - too hacky
containers, virtual machines - too clumsy to operate
Additional context
yarn add discord.js
yarn ad...
Why can't you upgrade to 16.6?
Node 16 will be LTS in a couple of months, we decided to set the version requirement now in preparation, so we don't have to release a v14 to use it's features.
Just so color isn't casted to a number (even when it's a string):
else if (Number.isNaN(color)) throw new TypeError('COLOR_CONVERT');
Please describe the changes this PR makes and why it should be merged:
Fixes a doc typo. Should be MANAGE_CHANNELS
Status and versioning classification:
- This PR only includes non-code changes, like changes to documentation, README, etc.
Please describe the problem you are having in as much detail as possible:
I have been trying to connect to the API to register the basic slash commands using the sample code on the discord.js.org. (ref. pastebin below), however, when I start the bot up, the bot itself logs in fine, however, it says that my application is unknown. I recognised that the method changes my inputted IDs. My CLIENT_ID and GUILD_ID are 603340037056102453 and 593830690777333770 respectively but they are change...
Forgot to add that I also use @discordjs/rest@0.1.0-canary.0
You seem to be storing them as numbers instead of strings - Javascript cant handle numbers that large and is truncating them.
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue โ you will get redirected there anyway.
I'll try parse them as string instead so, I remember something in guide that discord.js doesn't parse numbers as string automatically anymore. Thanks for pointing that out!
Looks like that fixed the issue, thank you so much!
Thank you so much! This really helped me out! I had to change a few things, but this is the code I used to make it work:
const allIntents = new Discord.Intents();
const client = new Discord.Client({ intents: allIntents });
Please describe the problem you are having in as much detail as possible:
Trying to upgrade to the new CacheFactory, but the code editor is noting that I am not typing the correct format. The error is:
Argument type {MessageManager: {sweepFilter: SweepFilter, sweepInterval: number}} is not assignable to parameter type CacheWithLimitsOptions | undefined
Include a reproducible code sample here, if possible:
Options.cacheWithLimits({
MessageManager: {
...
export interface Caches {
ApplicationCommandManager: [manager: typeof ApplicationCommandManager, holds: typeof ApplicationCommand];
BaseGuildEmojiManager: [manager: typeof BaseGuildEmojiManager, holds: typeof GuildEmoji];
// TODO: ChannelManager: [manager: typeof ChannelManager, holds: typeof Channel];
// TODO: GuildChannelManager: [manager: typeof GuildChannelManager, holds: typeof GuildChannel];
// TODO: GuildManager: [manager: typeof GuildManager, holds: typeof Guild];
...
Aren't these supposed to be marked optional?
Discord.js don't work with the foloowing code, and throws out this error:
UnhandledPromiseRejectionWarning: ReferenceError: AbortController is not defined
at RequestHandler.execute (K:\GitHub\taxibot\node_modules\discord.js\src\rest\RequestHandler.js:172:15)
at RequestHandler.execute (K:\GitHub\taxibot\node_modules\discord.js\src\rest\RequestHandler.js:176:19)
at RequestHandler.push (K:\GitHub\taxibot\node_modules\discord.js\src\rest\RequestHandler.js:50:25)
at...
You must be using Node 16.6.0 or higher to use Discord.js v13
Please describe the changes this PR makes and why it should be merged:
fix defaultMakeCacheSettings to be consistant with the actual name.
- This PR only includes non-code changes, like changes to documentation, README, etc.
ea8d77e docs(Options): defaultMakeCacheSettings typo (#... - Koyamie
43f8510 Docs build for branch main: ea8d77ea6236c03747f... - iCrawl
0062aa6 docs(Invite): MANAGE_CHANNELS instead of `MAN... - Dev-CasperTheGhost
6477512 Docs build for branch main: 0062aa6f72f1f6695a6... - iCrawl
IMO, mandating Node 16.6.0 or above really blocks a lot of applications from upgrading to the latest and greatest version of discord.js. For example, in my case, AWS Elastic BeanStalk only supports Node 12.x.
@raymondfeng, while AWS doesn't yet support Node 16, you're still able to bundle whatever it is yourself with Docker. Additionally, you can always make your own layers, see this example for lambda.
Hi,
I want to add a custom emoji as a reaction on a message
with unicode emoji, it work, but with custom it won't
this is the code :
//element contain the id of the emoji, on my test : '806586883240230913'
console.log(message.guild.emojis.cache.get(element));
message.react(message.guild.emojis.cache.get(element)).catch(console.error);
I got this :
GuildEmoji {
animated: false,
name: 'xbirdSga',
id: '806586883240230913',
deleted: false,
[...]
...
Don't know if it's worth reopening, but I was able to reproduce this when a server that has my bot had 250 roles. I had expected the create call to throw an error code of MAXIMUM_ROLES: 30005 but it just hangs indefinitely.
I can make a new issue if needed
@Fyko Thank you for the pointer. I'm fully aware of such paths to use Node 16.x but most of them will have to change how applications are operated to some extent.
It's really boils down how we open source developers to strive to make users life easy.
- Project maintainers and contributors are eager to use latest and greatest syntax. I'm all for it!
- Users are keen on backward compatibility as much as possible.
I think the middle-ground is to use TypeScript or Babel and have a bu...
I cannot reproduce this. My only guess is that the emoji is not accessible to the client.
I cannot reproduce this. My only guess is that the emoji is not accessible to the client (the client is not in the server the emoji is from).
Hi, actually the bot is on the same server as the emoji :/
This allows to import from specific paths.
Why?
In my case:
Jest does not currently support exports. So when ESM is enabled, and discord.js is imported, Jest resolves the CJS version (main). This commit will allow to import from discord.js/src/index.mjs into the source code to avoid problems with discord.js.
In other cases it would allow to import a specific path which is rather interesting.
Status and versioning classification:
- This PR only includes non-cod...
Did you try to fetch the emoji instead? Maybe the name is outdated or it was deleted.
The types are correct, it is saying the entire object is not assignable to CacheWithLimitsOptions, there should be a nested error that tells you why.
Here it is though, SweepFilter<unknown, unknown> isn't assignable to SweepFilter<string, Message>
Did you try to fetch the emoji instead? Maybe the name is outdated or it was deleted.
Also I see that the emoji is managed by an external service (managedproperty is true), so maybe the bot can't use it.
Managed was the key, this emoji come from twitch, so it can't be used by the bot
thanks a lot !
Please describe the problem you are having in as much detail as possible:
When I try getting the reactions of a message from .reactions.cache, I'm left with an empty collection. I was told in the support server to open an issue if I could make it reproducible.
Include a reproducible code sample here, if possible:
//Import Modules
const { Client, Intents, Collection } = require('discord.js');
//Create the Client
const client = new Client({ intents: [Intents.F...
AWS Elastic BeanStalk only supports Node 12.x.
Sounds like a bad hosting solution if you ask me, I can understand a service not supporting non-LTS versions, but I can't for a version that has been LTS for 10 months (v14).
I think the middle-ground is to use TypeScript or Babel and have a build step to produce JS code that is compatible with all LTS versions of Node, including 12.x.
It's not just language features, also Node.js features, please read the second half of https://gith...
