#discord.js (monorepo)
7945 messages · Page 8 of 8 (latest)
3122da4 ci(deprecate-tag): Remove comment (#11246) - Jiralite
dafdc78 chore: upgrade actions/setup-node to v6 and nod... - almeidx
[discordjs/discord.js] New branch created: feat/mainlib-fetch-g-member-limit
[discordjs/discord.js] New branch created: feat/14-mainlib-fetch-g-member-limit
Please describe the changes this PR makes and why it should be merged:
Since the introduction of discord-api-types on our docs site the linking needs to use the correct version of dependencies that aren't in the monorepo.
Fixes the wrong links on APIEmbed and similar on https://discord.js.org/docs/packages/builders/1.13.0/EmbedBuilder:Class#toJSON and others
Status and versioning classification:
This PR fixes typos in the file file using codespell.
These kind of changes should instead be made upstream:
6f365a1 chore: merge builders (and formatters) - Jiralite
[discordjs/discord.js] New branch created: chore/merge-builders-to-v14
44aa2bd chore: match cliff.toml - Jiralite
551ad69 chore: update README.mds - Jiralite
[discord.js] Branch chore/merge-builders-to-v14 was force-pushed to `0d8711a`
73bc314 build: discord-api-types 0.38.32 - Jiralite
b6a8264 chore: Merge builders/1.x into v14 (#11260) - Jiralite
For housekeeping purposes, removing distribution tags instead of only deprecating the associated version. Don't want to end up with a bunch of distribution tags listed in pnpm view discord.js, for example.
Couldn't find a tool that removes distribution tags from multiple packages like @favware/npm-deprecate does for versions, so had to use a matrix.
I request an unban from the discord. Find a ban fairly harsh, just because I pointed out someone was autistically focusing on words instead of the actual question. User: 211441083434008576
[discordjs/discord.js] New branch created: release-v14-node-22
e0908ea ci(release): back to Node.js v22 - Jiralite
b4c4fff refactor: requested changes - didinele
Pretty sure this should be a regular dependency
why? I'm only importing a type and it wasn't used for anything previously
Because GatewayRateLimitedDispatchData<keyof GatewayOpcodeRateLimitMetadataMap> is being used in the constructor, which will be in dist/index.d.ts
implements FileBodyEncodeable<RESTPostAPIChannelMessageJSONBody>
This is redundant considering FileBodyEncodeable extends JSONEncodable
From what I can tell from docs it seems like support for boolean | number in RawFile in @discordjs/rest is for when not using payload_json but instead sending all properties as form data. So this should probably not be supported as parameters here.
public setFileData(data: Buffer | Uint8Array | string): this {
* that will wind up being included in the multipart/form-data request, if used with the `MessageBuilder`.
* This data is not included in the output of `toJSON()`. For this class specifically, this refers to binary data
data: z.union([z.instanceof(Buffer), z.instanceof(Uint8Array), z.string()]),
export interface FileBodyEncodableResult<BodyValue> {
Apart from dtypes as dependency LGTM
[discordjs/discord.js] New branch created: 14/no-apps
/**
* The payload data that lead to this rate limit
*
* @privateRemarks
*
* Too complicated to type properly here (i.e. extract the ['data']
* of event payloads that have t = keyof GatewayOpcodeRateLimitMetadataMap)
*/
b6a8264 chore: Merge builders/1.x into v14 (#11260) - Jiralite
1c57016 fix: improve handling of italics in the presenc... - KTibow
2da2fa0 feat: optimize role manager cache getter (#11239) - WhatCats
bf0430f feat: add email and phoneNumber formatters ... - almeidx
169b05f refactor(formatters): Change :_: emoji name p... - cobaltt7
Pretty sure this listener is wrong, you should check for the data (nonce, etc)
That check used to be there... not sure why, but it was removed in the last commit
https://github.com/discordjs/discord.js/pull/11251/commits/b4c4fffadb584c9713cc492ca4824b05585376d6
542afab fix: suggested changes - didinele
4da0c03 chore: add guide issue template (#11247) - almostSouji
3122da4 ci(deprecate-tag): Remove comment (#11246) - Jiralite
dafdc78 chore: upgrade actions/setup-node to v6 and nod... - almeidx
3cb3eca docs(BaseSelectMenu): Adjust maximum wording (#... - Jiralite
9723cc5 fix: improve handling of italics in the presenc... - KTibow
d3d6777 feat(core): handle request all guild members ra... - didinele
[discordjs/discord.js] New branch created: feat/support-new-timestamp-styles
[discordjs/discord.js] New branch created: feat/add-new-timestamp-styles-v14
9723cc5 fix: improve handling of italics in the presenc... - KTibow
c85f18c feat: optimize role manager cache getter (#11239) - WhatCats
37a3888 refactor(publish-dev): take ref instead (#11236) - didinele
d3d6777 feat(core): handle request all guild members ra... - didinele
8e6bc50 Merge branch 'main' into issuetemplate/guide - kodiakhq[bot]
35996b7 fix: issue template guide (#11254) - almostSouji
5619137 feat(api-extractor-model): use correct version ... - Qjuh
Bot test1
Please describe the changes this PR makes and why it should be merged:
Status and versioning classification:
9723cc5 fix: improve handling of italics in the presenc... - KTibow
c85f18c feat: optimize role manager cache getter (#11239) - WhatCats
37a3888 refactor(publish-dev): take ref instead (#11236) - didinele
d3d6777 feat(core): handle request all guild members ra... - didinele
35996b7 fix: issue template guide (#11254) - almostSouji
Words have meanings, permissions are not roles, honoring that difference is not autistic, but just honoring the question.
You not seeing that you completely derailed that conversation while also being immensely rude and with a history of similar behavior has led to your exclusion from the server.
Since you still don't seem to understand that this is inappropriate and disturbing a learning environment, we have denied your appeal after internal discussion in the server staff team.
We may r...
9723cc5 fix: improve handling of italics in the presenc... - KTibow
c85f18c feat: optimize role manager cache getter (#11239) - WhatCats
37a3888 refactor(publish-dev): take ref instead (#11236) - didinele
d3d6777 feat(core): handle request all guild members ra... - didinele
35996b7 fix: issue template guide (#11254) - almostSouji
I'm aware, but I'm honestly for leaving it in just for extra readability without knowing what a FileBodyEncodeable is (arguably beneficial for docs too?). Thoughts @vladfrangu
35996b7 fix: issue template guide (#11254) - almostSouji
5619137 feat(api-extractor-model): use correct version ... - Qjuh
8ed93b3 types(DiscordjsErrorCodes): Add missing permiss... - Jiralite
d923e90 chore: migrate eslint configs (#11234) - sdanialraza
538b47d feat: upgrade zod to v4 (#11258) - almeidx
For docs it would (should) show the toJSON() on the extended interface already, so not sure of the benefit
[discordjs/discord.js] New branch created: refactor/remove-base-client
This should probably check if fileData.data is undefined as well, since you aren't deleting keys when you clear.
(I do see you check this in the message builder but why not do it here)
isn't the placeholder supposed to be \d+ only?
I'm actually a bit unclear from the docs. It seems like no generally, but maybe for messages specifically?
35996b7 fix: issue template guide (#11254) - almostSouji
5619137 feat(api-extractor-model): use correct version ... - Qjuh
8ed93b3 types(DiscordjsErrorCodes): Add missing permiss... - Jiralite
d923e90 chore: migrate eslint configs (#11234) - sdanialraza
538b47d feat: upgrade zod to v4 (#11258) - almeidx
* @example 'image.png'
* @example 'document.pdf'
* @example 'SPOILER_secret.jpeg'
From here:
It should be numbers, it seems. I wouldn't limit it to just those because the documentation says files[42] can be used.^1
[discordjs/discord.js] New branch created: docs/fix-doc-pin
17d573d chore: requested changes - didinele
[discord.js] Branch feat/builders-file-output was force-pushed to `3d820ee`
I'm assuming there will be a follow-up pull request to add support for this in mainlib
* Content-Type of the file.
* If not provided, it will be inferred from the file data when possible
*
* @example 'image/png'
* @example 'application/pdf'
According to the spec, you can only use keys 0-9 here
https://github.com/discord/discord-api-spec/blob/28ef48483b4745bcf176b2b53b931a27142e2f55/specs/openapi.json#L2815-L2858
const fileKeyRegex = /^files\[(?<placeholder>\d)]$/;
* @param data - The file data
export type { RawFile } from '@discordjs/util';
* @remarks Note that this data is NOT included in the {@link toJSON} output. To retrieve it, use {@link getRawFile}.
files: rawFilePredicate.array().max(10),
I'm assuming there will be a follow-up pull request to add support for this in mainlib
Yeah, especially because #11273.
Technically true, you can only upload 10 images at a time, but i thought you can provide any value in the files[<key>] part, up to 10 elements tho
Gonna link what I said here: https://github.com/discordjs/discord.js/pull/11248#discussion_r2528955051
Their documentation says you can even pass files[42], so...
Yeah, I'm not sure what's correct here, spec or docs.
See #internals message (internals)
We're leaving this as is
[discordjs/discord.js] New branch created: refactor/mainlib-for-builders-updates
[discord.js] Branch refactor/mainlib-for-builders-updates was force-pushed to `fb226c2`
Ready for review, but blocked until the other PR is merged.
45ffe83 chore: remove usage of the prefer-global rules - didinele
[discordjs/discord.js] New branch created: chore/no-prefer-global
should I have ignored api-extractor?
I think we should get rid of it. Especially considering the implementation of isFileBodyEncodable().
In the end it doesn't matter all that much regardless
including api-extractor in this change is correct
why was the shebang removed?
Contribution by Gittensor, learn more at https://gittensor.io/
6727634 chore(util): release @discordjs/[email protected] - vladfrangu
d500d97 chore(formatters): release @discordjs/formatter... - vladfrangu
f4b4918 chore(core): release @discordjs/[email protected] - vladfrangu
cce8194 chore(discord.js): release [email protected] - vladfrangu
Hi. Some time ago I was banned after sharing an open-source package I built on top of Discord.js that adds JSX syntax for creating Discord components.
I had looked for a channel that seemed appropriate for that kind of project, posted it there, and was banned instantly without any warning or message. It wasn’t commercial, it wasn’t spam — it’s an open-source project and I don’t earn anything from it.
If the issue was breaking a rule, I’m sorry — reading rules is different from memorizing ev...
I can't think of any multipart form data endpoint that doesn't also take in json properties... they don't serve "different purposes", FileBodyEncodable fundamentally relies on this.toJSON(), the implementation being made in this PR behaves in this fashion too.
[discord.js] Branch feat/builders-file-output was force-pushed to `036a221`
[discord.js] Branch feat/builders-file-output was force-pushed to `f39b630`
[discord.js] Branch feat/builders-file-output was force-pushed to `bc474a5`
68bb8af feat(builders): multipart form data output supp... - didinele
This only works for the legacy website, which this package does not have documentation for.
* @remarks Please note that the `id` field is required, it's rather easy to miss!
Oh. I searched the codebase and noticed there was one even in the util package so I assumed it worked...
I'd prefer if there was still a way to pass an AttachmentBuilder into here, albeit not sure what type would make sense to put for that here.
Another helper type like RawFileEncodable which extends JSONEncodable with the additional getRawFile() method? Seems clunky but 🤷♂️
The main issue I have with this is that AttachmentBuilder includes data tied to.. well, the attachments array.
What do we do when the user sets that data and they also provide attachments manually?
9723cc5 fix: improve handling of italics in the presenc... - KTibow
c85f18c feat: optimize role manager cache getter (#11239) - WhatCats
37a3888 refactor(publish-dev): take ref instead (#11236) - didinele
d3d6777 feat(core): handle request all guild members ra... - didinele
35996b7 fix: issue template guide (#11254) - almostSouji
[discordjs/discord.js] New branch created: fix/pkg-entrypoint-link
5dea946 ci: Remove tags instead of only deprecating (#1... - Jiralite
I've been adopting Discord.js's way of naming enum values—PascalCase for both the enum object and its value names—but I've made the discovery recently that the convention, according to a Stack Overflow answer with a few notable sources, is PascalCase for the enum and SCREAMING_SNAKE_CASE for the value names. I quite favor this convention and have been adopting that instead, as it differentiates values from the rest of the nota...
I've recently discovered that VSCode highlights SCREAMING_SNAKE_CASE properties differently from PascalCase:
Makes one of the bigger reasons why I'd prefer enum properties cased like such. I, however, haven't yet found any other syntax highlighter that does this, e.g. GitHub's markdown:
// Syntax highlight test
const enumTest = Enum.SOME_VALUE;
const miscTest ...
Ah, I forgot about TS. That makes a bit more sense.
Ah, I forgot about TS. That makes a bit more sense
[discordjs/discord.js] New branch created: fix/guide-typos
of course it does in the validator already, the remark is there because it's super not obvious considering older APIs, I spoke about this with Jira briefly in internals
That is absolutely awful in terms of library behavior. That snippet effectively means that if you pass both files and attachments at the same time, it's a guaranteed API error, unless it's a message edit and the elements the user passed to the attachments array specifically refer to existing attachments.
In essence, this renders the attachments field as edit-only, we're just completely taking over it with this behavior, largely hiding how the API payload works too (which I am not f...
But that's what AttachmentBuilder does too... it hides the same things the same way.
No. This isn't about hiding thihgs, it's allowing the user to easily pass garbage. AttachmentBuilder on its own is fundamentally different from what you want, it removes your granular control of the files/attachments fields, it ties them together completely. There is no way when using it to get non-sense miss-matched arrays. All the more so when you use MessageBuilder
Circling back on this, the only way I'd accept it is making it a union type that forbids files if attachments is AttachmentBuilder[], I'm not compromising otherwise
Requires disabling the rule for that line, are we okay with that? The alternative is
const { cwd } = process;
but that also requires a rule disable because of unbound methods
Looks like those files had a bunch of lint errors but eslint never really ran on them. Fixed it up
Hey! After internal discussion we have decided to grant your appeal request. Feel free to rejoin the server whenever you want!
Thing is that all the other types allowed for files here will also fill the attachments. So if anything it would make sense to completely disallow attachments in create Message options
In that case I retract my comment, your change seems fine.
Sure. I'm okay with designing the API that way, but we do also have to acknowledge the complexity it adds
Can you update the eslint.config.js files in the templates for create-discord-bot too? Otherwise the linter will (probably) fail when people create a new project using it
[discordjs/discord.js] New branch created: Jiralite-patch-1
93f6e49 Delete .github/PULL_REQUEST_TEMPLATE.md - Jiralite
Before the monorepo, discord.js was only the discord.js package. The pull request template made sense (test your API changes, shout if your changes are breaking, and more).
Now, it contains packages like @discordjs/brokers, @discordjs/actions, the api-extractor packages, as well as the website and guide applications. Semantic versioning doesn't really apply to these, and testing API changes certainly doesn't apply for the websites.
I'm moving towards removing the file. At the very least...
[discordjs/discord.js] Pull request review submitted: #11301 chore: Delete the pull request template
I feel like we could've kept at least the first header but I know even we struggle to write proper content in there 😄
[discordjs/discord.js] New branch created: refactor/validation-on-chatinputcommand
Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.
Original prompt
This section details on the original issue you should resolve
Refactor chat input command subcommands overrides
Investigate whether the validation override can be changed tofalse.
0 actually gets set to undefined:
_Originally posted by @Jiralite in https://github.com/discordjs/discord.js/pull/11290#discussion_r2568537025_
I just wanted to report a small bug in the discord.js module, but it turned out that I was banned from the discord.js server (I don't even know why, because I don't even participate there, I only report bugs sometimes, I'm only there for update announcements). Could I get unbanned? Or at least find out what the ban is for?
The problem is that I logged into Discord today for the first time in a week.
While we don't mind a little trolling or fun with reactions on our announcements, you chose to react with a sequence of letters representing a racial slur (or rather a softened version often used to bypass filters and spin up excuses) on the latest release announcement. That action has lead us to exclude you from the community.
is there any chance of unban?
[discordjs/discord.js] New branch created: fix/label-limits
Since you mentioned "unjust" and "no reason" I felt I should clarify. Do you have anything to say regarding that?
[discordjs/discord.js] New branch created: fix/14-labels
[discordjs/discord.js] New branch created: fix/rest-file-uploads
[discordjs/discord.js] New branch created: test/builders-validation
I feel like now that we overwrite this.options.attachments either way it should probably not be overwriting the options at all and instead be a const we assign or make attachments a let and modify in the if case.
Feels wrong to use this.options.attachments in the returned payload when it never will be the actual passed value at that point.
89320dc fix: revert to the previous approach - almeidx
Tbh the global dispatcher being a problem is a major issue, but yeah. Why not just instantiate Agent once outside the function call and do ??= like the original commit?
Done.
Yes there's the potential to set the global dispatcher later than importing the strategy though...
Honestly, don't think this is a problem at all. The fact that undici is being used here is an implementation detail, and we have an official way of providing an agent if the user wants (via the agent option o...
[discordjs/discord.js] New branch created: refactor/embed-length-util
4ecf947 refactor!: move embedLength function to util ... - almeidx
BREAKING CHANGE: Builders no longer exports a embedLength function. Import it from @discordjs/util instead.
This unblocks us from removing the dependency of @discordjs/builders from the discord.js package completely.
old issue but the global WebSocket performance is on par with ws (from the creator of ws) https://github.com/nodejs/undici/pull/3203#issuecomment-2972747818
BREAKING CHANGE: Builders no longer exports a
embedLengthfunction. Import it from@discordjs/utilinstead.
Unsure about telling users to download a package we use primarily for sharing stuff across the other packages. Shouldn't we export this in builders still?
b2cbdf1 feat(guide): updated modal page for label (#11169) - bowenjw
444e55a feat(guide): updating section (#11322) - almostSouji
aeb8986 fix(Client): Move client initialization code (#... - vakiliner
19253f6 feat: message structures (#10982) - Qjuh
d59857e fix(builders): add proper snowflake validation ... - rie03p
b2cbdf1 feat(guide): updated modal page for label (#11169) - bowenjw
444e55a feat(guide): updating section (#11322) - almostSouji
aeb8986 fix(Client): Move client initialization code (#... - vakiliner
19253f6 feat: message structures (#10982) - Qjuh
d59857e fix(builders): add proper snowflake validation ... - rie03p
I'd say we should keep this test, import embedLength from /util. Since this doesn't (only) test the embedLength function but also that it works correctly with EmbedBuilder
b2cbdf1 feat(guide): updated modal page for label (#11169) - bowenjw
444e55a feat(guide): updating section (#11322) - almostSouji
aeb8986 fix(Client): Move client initialization code (#... - vakiliner
19253f6 feat: message structures (#10982) - Qjuh
d59857e fix(builders): add proper snowflake validation ... - rie03p
[discordjs/discord.js] New branch created: chore/cliff-jumper-schema
There exists a schema for @favware/cliff-jumper. Adding it in and bumped the package too (we are unaffected by the breaking changes).
[discord.js] Branch chore/cliff-jumper-schema was force-pushed to `8c33605`
da7a9cf build: remove from docgen - Jiralite
b2cbdf1 feat(guide): updated modal page for label (#11169) - bowenjw
444e55a feat(guide): updating section (#11322) - almostSouji
aeb8986 fix(Client): Move client initialization code (#... - vakiliner
19253f6 feat: message structures (#10982) - Qjuh
d59857e fix(builders): add proper snowflake validation ... - rie03p
2520a0f chore: @favware/cliff-jumper schema (#11328) - Jiralite
ec70475 chore: Delete the pull request template (#11301) - Jiralite
d59857e fix(builders): add proper snowflake validation ... - rie03p
ace834b fix: Adjust label predicates and fix buttons em... - Jiralite
8162ae8 test: Add toJSON() to tests (#11321) - Jiralite
a57b4d4 fix: Allow mixing subcommands with subcommand g... - Jiralite
2520a0f chore: @favware/cliff-jumper schema (#11328) - Jiralite
Unsure about telling users to download a package we use primarily for sharing stuff across the other packages. Shouldn't we export this in builders still?
I actually agree with this. I'm a bit uncertain if it's builders that should be re-exporting it, though. Probably whatever our "entrypoint" high-level libs? core, discord.js
b2cbdf1 feat(guide): updated modal page for label (#11169) - bowenjw
444e55a feat(guide): updating section (#11322) - almostSouji
aeb8986 fix(Client): Move client initialization code (#... - vakiliner
19253f6 feat: message structures (#10982) - Qjuh
d59857e fix(builders): add proper snowflake validation ... - rie03p
0aaba03 fix(undiciRequest): file uploading (#11320) - almeidx
5dea946 ci: Remove tags instead of only deprecating (#1... - Jiralite
5130d6f fix: Sort package versions (#11284) - Jiralite
456a6f4 fix: header link on packages with entrypoints (... - almeidx
0b12263 fix(GuildEmojiManager)!: Allow CreateGuildExpr... - Jiralite [179525d`](https://github.com/discordjs/discord.js/commit/179525d9fcb98e4abed56194568b34e210cd1e8c) fix: typos (#11293) - sdanialraza
Discord.js continues to export it.
https://github.com/discordjs/discord.js/blob/0aaba0305fb29d25e4caac333fbb5be8a05fb271/packages/discord.js/src/index.js#L259
Core does not currently, and I don't think it should either
Isn't this supposed to use Mocked?
When I suggested removing the imports from built-ins, I was referring to standard globals (URL, URLSearchParams, Blob, etc.).
I think we should keep the node-specific things imported still. While they will (probably) work on other runtimes without the explicit import, I think it's better in this case to have an explicit import so it's extremely clear that we are expecting the implementation from/for node.
Additionally, I found some other globals which are still being imported whi...
[discordjs/discord.js] New branch created: feat/guide-turbopack-prod-build
d59857e fix(builders): add proper snowflake validation ... - rie03p
ace834b fix: Adjust label predicates and fix buttons em... - Jiralite
8162ae8 test: Add toJSON() to tests (#11321) - Jiralite
a57b4d4 fix: Allow mixing subcommands with subcommand g... - Jiralite
2520a0f chore: @favware/cliff-jumper schema (#11328) - Jiralite
Additionally, I found some other globals which are still being imported while skimming over: File, Blob, and performance.
Unfortunately, there's no ESLint rules for those. Even so
- I could not find any instances of
Filebeing imported. Maybe my search was improper? Blobin only imported withinRESTonce for undici request, removing it poses the following problem:
Argument of type 'Blob' is not assignable to parameter of type 'BodyInit | undefined'.
Property 'sli...
Let's remove these too. The exception being imports from node:timers/promises
[discordjs/discord.js] New branch created: chore/bits-and-bobs
26b3bdb chore: update deps and script refactor - almeidx
- Updated pnpm, dependencies and regenerated the lockfile
- Removed immer and some eslint plugins that weren't being used
- Updated the version of
@types/nodeto v24 on internal packages as that's the version that is being used on github actions - Refactored the uploadSearchIndices action slightly and upgraded the meilisearch dependency
Pull request overview
This PR updates project dependencies and refactors the uploadSearchIndices GitHub action with improved type safety and error handling.
Key Changes:
- Updated pnpm to 10.25.0 and various dependencies (typescript-eslint, vercel, lucide-react, vite, etc.)
- Removed unused
immerdependency and eslint plugins (eslint-plugin-import,eslint-plugin-jsdoc) - Upgraded meilisearch from 0.38.0/0.53.0 to 0.54.0 and refactored the upload action to use the updated API
- ...
jotai-immer was kept in this package but removed from apps/website/package.json. Since immer was removed from both packages, this creates an inconsistency. If jotai-immer is still needed here, it should bundle its own immer dependency, or if it's not needed, it should be removed like in the website package.
[discordjs/discord.js] New branch created: chore/workflow-updates
833c077 chore: workflow and docker image tweaks - almeidx
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: skip review by coderabbit.ai -->
[!IMPORTANT]
Review skipped
Draft detected.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration...
11a0def fix: switch back to for await - Jiralite
ec76b17 chore: workflow and docker image tweaks (#11341) - almeidx
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
Identify and suggest improvements to slow or inefficient code
✨ Let Copilot coding agent [set things up for you](https://github.com/discordjs/discord.js/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure instructions for this repository as documented in [Best practices for Copilot%...
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
Identify and suggest improvements to inefficient code
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
Identify and suggest improvements to inefficient code
✨ Let Copilot coding agent [set things up for you](https://github.com/discordjs/discord.js/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure instructions for this repository as documented in [Best practices for Copilot coding...
fa43c40 fix(builders): handle 0 as valid attachment ID ... - Exodo0
d90a86a fix(Message): Optional parameter for setting al... - Jiralite
ec76b17 chore: workflow and docker image tweaks (#11341) - almeidx
f38395e fix: update MeiliSearch API key - iCrawl
f814c07 Merge branch 'main' into fix/string-option-vali... - Jiralite
The boilerplate for the templates is already there, but the code is missing.
- packages/create-discord-bot/template/Bun/TypeScript
- packages/create-discord-bot/template/Bun/JavaScript
They should be similar to the regular (Node.js) ones:
- [packages/create-discord-bot/template/TypeScr...
06c8da2 chore: update deps & search indice action refac... - almeidx
[discordjs/discord.js] New branch created: fix/lockfile
[discordjs/discord.js] New branch created: coderabbitai/utg/4066109
dccbaf1 CodeRabbit Generated Unit Tests: Add pnpm-lock.... - coderabbitai[bot]
3d1a580 Fix UTG issues (iteration 1) - coderabbitai[bot]
ccc1f73 Fix UTG issues (iteration 2) - coderabbitai[bot]
56fc8e4 Fix UTG issues (iteration 3) - coderabbitai[bot]
Hello, REST is useful for making calls to the discord rest API, as it will handle the rate limits, retries, bucket changes, etc.
The problem with it is that it won't provide information to the developer about the current status of the buckets, the actual rate limits. As a consequence it's impossible to nicely manage rate limits beforehand.
Example: Editing a message.
Suppose we are editing a message every few ms, let's say we are updating the current weather condition, the temperatur...
d59857e fix(builders): add proper snowflake validation ... - rie03p
ace834b fix: Adjust label predicates and fix buttons em... - Jiralite
8162ae8 test: Add toJSON() to tests (#11321) - Jiralite
a57b4d4 fix: Allow mixing subcommands with subcommand g... - Jiralite
2520a0f chore: @favware/cliff-jumper schema (#11328) - Jiralite
[discordjs/discord.js] New branch created: chore/index-lower-concurrency
09bae4a chore: lower concurrency on index upload - almeidx
f38395e fix: update MeiliSearch API key - iCrawl
c9bc33c fix(stringOptionPredicate): min_length and max_... - almeidx
ec3ef7b feat: use native node typescript (#11259) - almeidx
2c3bf5c ci: Upload README.md files (#11342) - Jiralite
06c8da2 chore: update deps & search indice action refac... - almeidx
No? According to docs that's "A function that determines whether the rate limit hit should throw an Error". I'm talking of having information about the rate limits before hitting the limit.
If you do a manual request you'll get headers such as
- x-ratelimit-remaining
- x-ratelimit-limit
- x-ratelimit-reset-after
These are present in the responses of any request to the API. If you know how many requests you've got left, and when is the limit resetting you can prevent 429 and queuing s...
[discordjs/discord.js] New branch created: feat/core-guild-role-member-counts
[discordjs/discord.js] New branch created: feat/guild-role-member-counts
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
Overview
As part of the greenfield rewrite plan for discord.js, we need to expand the @discordjs/structures package with missing entity structures. This PR focuses on Sprint 1: adding Guild-related structures and additional bitfields that are foundational for most bot functionality.
Current State
The `packages/structur...
We very deliberately abatract this away from you. You can indeed accomplish what you want by using rejectOnRateLimit. With your example in fact, simply wrapping your message edit call with a try..catch block, where errors other than Ratelimit are discarded accomplishes exactly what you desire.
Even beyond that basic example, you can accomplish just about every reasonable usecase I can think about. For the record, your use case is not actually reasonable, it's API abuse, I entertained it fo...
Should be at the top of the file, where it used to be. Otherwise LGTM
[discord.js] Branch feat/totally-a-new-feature was force-pushed to `e636950`
[discordjs/discord.js] New branch created: chore/bump-deps-esm
Bumps dependencies, including ones that became ESM-only, which are:
@noble/ciphersuuid
This should not be a problem since the minimum required Node.js version in main is 22.12 which has require(esm).
4db1092 docs(voice): add DAVE dependency section (#11061) - jNullj
f60d3d6 refactor!: move embedLength function to util ... - almeidx
6a129bc chore: lower concurrency on index upload (#11351) - almeidx
548d752 perf: Optimize Collection.equals() to reduce re... - Copilot
9bf1f73 chore: remove usage of the prefer-global rules ... - didinele
548d752 perf: Optimize Collection.equals() to reduce re... - Copilot
9bf1f73 chore: remove usage of the prefer-global rules ... - didinele
01f31f3 chore: bump dependencies (#11356) - almeidx
451a638 fix: handle github api errors gracefully (#11357) - almeidx
7468465 Merge branch 'main' into feat/core-guild-role-m... - Jiralite
fa43c40 fix(builders): handle 0 as valid attachment ID ... - Exodo0
d90a86a fix(Message): Optional parameter for setting al... - Jiralite
ec76b17 chore: workflow and docker image tweaks (#11341) - almeidx
f38395e fix: update MeiliSearch API key - iCrawl
c9bc33c fix(stringOptionPredicate): min_length and max_... - almeidx
📦 Packages from this PR have been published with the tag pr-11006.
Example installation:
npm install discord.js@pr-11006
I'm testing out v15 and ran bun install earlier and since my package.json had a caret on discord.js' version it updated to this version - is this intended?
<img width="418" height="97" alt="image" src="https://github.com/user-attachments/assets/d1437b81-9e63-4ace-811f-54d4012a15c8" />
[discordjs/discord.js] New branch created: refactor/remove-reexport
39d6f3c chore: update lockfile - didinele
until recently it was impossible (i.e. disabled) to connect to the gateway api from Cloudflare Workers, but they seem to have enabled this now.
https://github.com/discord/discord-api-docs/issues/6145#issuecomment-3618601748
[discordjs/discord.js] New branch created: feat/v15-proper-structure-for-authorization-map
548d752 perf: Optimize Collection.equals() to reduce re... - Copilot
9bf1f73 chore: remove usage of the prefer-global rules ... - didinele
01f31f3 chore: bump dependencies (#11356) - almeidx
451a638 fix: handle github api errors gracefully (#11357) - almeidx
df0c28a feat(GuildsAPI): add getRoleMemberCounts (#11... - almeidx
boosting does not generate an audit log
discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
Alright, after digging a little bit more yes, most of the information I could need is in the errors thrown, if enabled.
[discordjs/discord.js] New branch created: guide/membersarrive
[discordjs/discord.js] New branch created: fix/emoji-predicate-custom-emoji-length
5f93fbd fix(voice): handle negative timeouts (#11362) - markokajzer
51b5d38 feat: proper authorizing integration owners str... - vladfrangu
cad826f feat(RoleManager): add fetchMemberCounts (#11... - almeidx
427636e types(Message): specify rawData arg type (#11... - Pavel-Boyazov
7884ecd fix(emojiPredicate): wrong min name length (#11... - yokkkoso
5b4dbd5 feat: zstd streaming support (#10758) - vladfrangu
c4fc79a fix(voice): handle multiple transitions simulta... - Snazzah
5f93fbd fix(voice): handle negative timeouts (#11362) - markokajzer
51b5d38 feat: proper authorizing integration owners str... - vladfrangu
cad826f feat(RoleManager): add fetchMemberCounts (#11... - almeidx
69432a1 feat(structures): add emoji structure (#11369) - AsadHumayun
3d74122 feat(structures): add entitlement structure (#1... - AsadHumayun
52a69d7 feat(create-discord-bot): allow certain files/f... - jacobhumston
be78e26 feat: add Bun templates for create-discord-bot ... - ManInTheHam
6b00baa Merge branch 'main' into refactor/validation-on... - kodiakhq[bot]
Package
@discordjs/voice version 0.19.0
Description
The DAVE protocol availability check in createDaveSession() uses strict equality (===) when checking if getMaxProtocolVersion() returns null. However, when the @snazzah/davey library is not installed, getMaxProtocolVersion() returns undefined instead of null, causing the check to fail and preventing voice connections from working.
Root Cause
Location: dist/index.mjs around line 1405
Current code:
[discordjs/discord.js] New branch created: voice/make-davey-required
This can throw an error when a text channel is toggled into an announcement channel
I'm not 100% confident we want this. We're not gonna be plainly re-emitting events from the CoreClient anyway. There's a case to be made it's cleaner/easier for us to plainly handle a Gateway (imported from Core) and a API (which perhaps we can construct ourselves from a REST instance. depends what we want the user to pass)
Are we sure we want to provide this abstraction? Considering how easy we've made the structure <-> api data conversion, can't we justify keeping the caching stuff simpler and making it only interact with raw API data, so the caller is responsible for conversion?
Are the semantics of a collection that much more desired here rather than a plain object? Even with plain module augmentation I still think objects are a bit more desirable.
There's a silly argument to be made about performance, assuming this is still valid, but other than that, I just find the semantics to be better?
As it stands, you're overloading get and has, which goes to imply that's the main interaction we're expecting users to have with the...
few initial thoughts, not particularly related to caching just yet.
One thing I absolutely want (and I'd even want to do in current djs) is to always have a client['api'] which is the /core API class. I also agree that maybe we should have two separate properties for the gateway/rest, since the idea with next is that you should be able to wire up your own gw implementation too
Also it should be protected, not private (so we can do major bumps without needing major releases on this module's end but users can also use it should they desire)
Just saying it to say it. I was under the assumption that we would have core (or at least the api half of core) as a prop like this on the client, and we'd use that in all of [whatever managers becomes]. Totally fine with me to access it with client['api'] on internals.
[discordjs/discord.js] New branch created: fix/builders-disable-option-validation
Wouldn't that mean that we slow down collection cache by always converting from/to JSON for the benefit of implementers of alternative caching solutions (pretty sure that's not the majority of our users) only having to handle the JSON?
I have a usecase in which i would want to add or remove user's role if the server tag changes. On searching i found this discussion https://github.com/discordjs/discord.js/discussions/10954#discussion-8495120 which mentions this:
This feature is not documented by Discord. It currently exists in the API, however. It will be added to discord.js once documented.
Just wanted to know if this is available in discord.js now in Jan-2026 because the date on this is July-2025?
As of January 2026, this is unfortunately still not possible for real-time detection.
The Reason: While the Server Tag feature exists in the client, the Discord API currently does not send a Gateway Event when a user changes their Server Tag.
This means that even though the data exists, Discord does not "notify" the bot when a change happens. Without this specific event trigger, discord.js (or any other library) cannot listen for the change to automatically add or remove roles in real-t...
Ok thanks for the reply @HaskaZuki .
ok thanks for the reply @HaskaZuki .
I have no idea where @HaskaZuki got that information from, but it's wrong and sounds like LLM garbage.
This information is available in the userUpdate event in discord.js and GUILD_MEMBER_UPDATE on the Discord gateway. [^1]
To confirm this, i tested with the below code in discord.js version 14.25.1 and received the attached log.
client.on(Events.UserUpdate, (pU, nU) => {
console.log({ pU: pU?.primaryGuild, nU: nU?.primaryGuild });
});
application-1 | {
appli...
Sidenote: since Discord does not send the "old" user, it has to be retrieved from cache. If the previous user is not cached there is no way to know what the user's previous state was. You can opt into partials, however you will not be able to determine what exactly the update was (username change, tag change, ...). You can still determine the "now" state and see if the user (still or newly, indistinguishable) represents a specific guild.
More on partials: https://discordjs.guide/legacy/pop...
Thanks for the correction @almostSouji
My previous assumption was based on the fact that this feature remained undocumented for so long. I was under the impression that the Server Tag change was still a 'silent' client-side update that didn't trigger a Gateway event, which is why I thought real-time detection wasn't possible yet. I clearly missed the latest update on how "primaryGuild" is being handled in the recent versions.
I incorrectly assumed that for a bot to see a Server Tag cha...
thanks @almostSouji . Now that i look closely on the orignal reply and the latest reply from @HaskaZuki it does sound like LLM Talk. Anyways thanks for the help!
Another problem. voiceServerUpdate event not exists in ClientEventTypes
_Originally posted by @Pavel-Boyazov in https://github.com/discordjs/discord.js/issues/11121#issuecomment-3346410729_
Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.
Original prompt
This section details on the original issue you should resolve
voiceServerUpdateevent not exists inClientEventTypes
Another problem.voiceServerUpdateevent not exists inClientEventTypes_Originally posted by @Pavel-Boyazov in https://github.com/discordjs/discord.js/issues/11121#is...
[discordjs/discord.js] New branch created: feat/emit-voice-server-update
[discordjs/discord.js] New branch created: docs/missing-app-permissions-doc
Can I get an unban please?
userId: 211441083434008576 username: kipbo
Which package is this bug report for?
voice (@discordjs/voice 0.19.0)
Issue description
DAVE E2E encryption handling in @discordjs/voice 0.19.x is broken in practice — bots enter reconnect loops and capture zero audio on voice channels with DAVE enabled (now the default on most channels).
This may be related to previously closed issues #11384 and #11387, but the core problem persists: voice connections are unusable.
Steps to reproduce
- Install
@discordjs/voice0.19.0 + ...
- Upgrades dependencies
- Upgrades pnpm to 10.29.3
- Fixes an emerging voice test issue
- If the fix isn't desirable, can revert what introduced it
- Fixes issues reported by ESLint in packages/api-extractor
- Regenerated pnpm-lock.yaml
- Unblocks #11395
- Unblocks builders for https://github.com/discord/discord-api-docs/pull/8123
Voice receiving has always been on a "it may work" basis. And I've personally used DAVE fine for sending audio, so this is strictly a voice receiving issue that we need to fix
Please don't do version bumps on these pinned versions. We follow upstream here and do the bumps when we merge upstream changes bumping dependency versions.
Why? Apart from it not being lowercase there is no reason to change this for ae runs.
I avoided upgrading these dependencies too (not just the @rusthstack/* ones) on my bump prs. Especially typescript. Not sure if this is wanted
cc @Qjuh
You're right, dependencies should follow upstream. Only devDeps should be bumped here.
Fixes a regression of #11278 which causes issues when passing AttachmentBuilder in MessagePayload#options#files in any send method
That is a general issue with patching that kind of channel then and would need to be addressed as special case later anyway.
Nothing to add to the initial denial from the end of last year:
Words have meanings, permissions are not roles, noticing that difference is not autistic, but just honoring the question.
You not seeing that you completely derailed that conversation while also being immensely rude and having a history of similar behavior has led to your exclusion from the server.Since you still don't seem to understand that this is inappropriate and disturbing a learning environment, we have de...
Maybe just disable this rule completely on
https://github.com/discordjs/discord.js/blob/ccce987fa1ada0b3791127fad0c0ebb43ac6c524/eslint.config.js#L125-L132
Maybe @typescript-eslint/no-duplicate-type-constituents too
Any chance we can prevent these changes?
Disable the latter, fix the former. Or let me fix them. Because they indeed are invalid. And the irony here is that AE knows it is: https://github.com/discordjs/discord.js/blob/4876bb310096a6140eb3acec5e3da79f4c4af534/packages/api-extractor/src/api/ExtractorMessageId.ts#L101
We already did once, I wonder why they are here at all.
https://github.com/discordjs/discord.js/pull/10876#discussion_r2072477146
https://github.com/discordjs/discord.js/blob/ccce987fa1ada0b3791127fad0c0ebb43ac6c524/eslint.config.js#L223 should prevent this, unless that rule was renamed
Did you test this? There's a reason why we pin undici version and I'd hate to find out they messed up once again only after we release...
// TODO: add back @ts-expect-error This case can still occur if we get a newer unsupported component type
This will at least make eslint warn about it still being there, in case it gets forgotten.
77e7672 build: Upgrade dependencies and pnpm (#11420) - Jiralite
Logs: https://github.com/discordjs/discord.js/actions/runs/22245979203/job/64359888761
Running this locally with logs, I see this:
{
pkg: "@discordjs/docgen",
version: "0.12.1",
devTag: "dev",
timestamp: 1771638836,
commitHash: "77e767277",
}
ERR_PNPM_RECURSIVE_RUN_NO_SCRIPT None of the selected packages has a "release" script
79 | } else if (dry) {
80 | info(`[DRY] Bumping ${pkg.name} via git-cliff.`);
81 | ...
It's possible there's an oversight with add being so highly-responsible (i.e. functioning as more of an upsert).
I think that this is fine. My thought here is that there is a high chance that an async cache does not store our constructed objects, but rather the raw json. This means that get needs to construct from json anyways (hence your StructureCreator).
I see why it's called add rather than upsert I think? Because it deals with raw data when nothing else does?
Given this, I'd either l...
[discordjs/discord.js] New branch created: build/14-deps
523ad38 chore: fix docs by using bundler - Jiralite
I feel like caches should deal solely with storing the raw data from Discord, and not also mix with creating structures based on it.
I also feel like requiring cache entries to have an id property can become problematic, but I also know that basically all the structures we store have an id property so it'll probably be fine
I also don't know how to feel about Cache#add. It does resemble [Map#getOrInsertComputed](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Glo...
I feel like caches should deal solely with storing the raw data from Discord, and not also mix with creating structures based on it.
The consideration here is primarily that it vastly simplifies patching logic. It is fair to say that they shouldn't be interacting with high-level constructs, but this means that the caller needs to be responsible for:
- Getting the raw data
- Constructing the appropriate structure
- Calling
kPatch - Storing the new one
This isn't necessarily the end o...
Besides the unwanted bump to api-extractor dependencies, lgtm
It actually does cause type errors in your proposed interface
It always will, due to the nature of it being async, I think they meant it should have a similar interface to Maps, right?
No, it wouldn't type error if the return type was Awaitable<this> which is what Map does. The error is caused by the return type, not the async nature.
Well.. that's pretty annoying considering void works. I suppose that one needs explicit overriding.
Explicit overriding on CollectionCache extends Collection implements Cache is erroring too though, as the override doesn't match the parent signature. One alternative would be to have Awaitable<this> | Awaitable<void> as return type, but that effectively makes the interface more complex while still not really be usable as anything but void.
Then I think the question is whether we go for "Map just works" or something else "just works", because I'd see no problem with simply Awaitable<this> even if it's not that useful, so that we don't need an adapter layer for every implementation
Hey there d.js community, i haven't been active in developing Discord bots for like months and kind of ended the projects i was making after getting banned. but finally started to get back into developing bots because of Discord buttons v2. I'm pretty confident I got banned because I was trying to bypass a timeout (could be wrong tho, its been awhile). I do apologize for my previous actions, as they won't happen again if you let me back in or not. Anyway, I appreciate your consideration and h...
I feel like we should aim for a map-like interface, but not literally implements Map because that is impossible to achieve in an async-cache context
Yeah. I think this stuff isn't that big of a deal anyways. Are there any other major concerns? Regarding cache lookup errors, I'll be appending another section sometime this week addressing it.
We have decided to grant the appeal; feel free to join the server whenever you see fit.
let attachments = this.options.files?.map((file, index) =>
if (Array.isArray(this.options.attachments)) {
attachments ??= [];
Another regression caused by the mentioned pull request, since you're touching this area of MessagePayload
It is not currently possible to edit a message's attachments (e.g., removing all the attachments), as it causes:
/home/cyph/discord.js/packages/discord.js/src/structures/MessagePayload.js:210
attachments.push(
^
TypeError: Cannot read properties of undefined (reading 'push')
at MessagePayload.resolveBody (/home/cyph/discord.js/packages/discord.js/src...
[discordjs/discord.js] New branch created: chore/private-docgen
9ff67a0 chore: make docgen package private - almeidx
Fixes https://github.com/discordjs/discord.js/actions/runs/22256430186/job/64387918343#step:9:181
This package has not had any releases on the last 4 years anyways, and the only package which uses it is discord.js, which uses the workspace: protocol, not an npm-hosted version
307b64f chore: make docgen package private (#11434) - almeidx
One question I have is this: the way this RFC is designed and how my POC PR was made is that the cache can store the structures directly or decide to store the raw json and reconstruct the structure on get.
- Do we want to allow that, leaving users under the assumption the structures would update like they do currently, although they won't because patching means cloning?
- or do we want to always store raw JSON and always reconstruct? Then the structureCreator can be moved to manager and cac...
Another question came up. With stuff like Reactions or Embeds that are substructures of Message:
- does the Message cache store all of those and the implementation needs to account for separating them for storage/recombine them on get() or does the structure get a manager itself again responsible for interacting with and storing its substructures?
- does the Cache need information about the place the structures to be cached exist (e.g. the message id for caching a reaction) or does the struct...
c460a92 feat(structure): add Webhook structure (#11401) - AsadHumayun
a3e189d feat: emit voiceServerUpdate event (#11414) - almeidx
ccce987 types: broadcastEval overload order (#11421) - Qjuh
77e7672 build: Upgrade dependencies and pnpm (#11420) - Jiralite
0cb8be4 docs(builders): edited docs to correctly link t... - faceboy1392
[discordjs/discord.js] New branch created: chore/proxy-container-to-apps
[discord.js] Branch chore/proxy-container-to-apps was force-pushed to `b31598b`
It is not a package. It's mostly a deployable app, just like the website and the guide.
This also allows us to remove the special logic from generateReleaseTree that was handling this special "package"
What happened
When connecting to a Discord voice channel with @discordjs/voice 0.19.0, an unhandled promise rejection occurs intermittently, crashing the entire Node.js process. The error originates from VoiceUDPSocket.ts during the IP discovery phase.
Stack trace
Error: Cannot perform IP discovery - socket closed
at Socket. (@discordjs/voice/src/networking/VoiceUDPSocket.ts:167:38)
at Object.onceWrapper (node:events:621:28)
at Socket.emit (node:events:519:35)
a...
[discord.js] Branch chore/proxy-container-to-apps was force-pushed to `f5e086d`
This looks like a symptom of eslint.config.json needing adjustments because it currently assumes all apps are nextjs applications.
3135c35 chore: limit next/react rules to next apps - almeidx
We could change this to discordjs/proxy since in practice that's the actual identifier of the container.
Thoughts? @Jiralite
Could do, sure.
Could also create a new issue template for this since this is a package bug report. The other apps are called "Websites bug report". I personally see no problem with having another issue template for this, even if it is unused. It's good for organisation and is different enough to warrant it?
Expanding on the above. For a concrete example, let's assume a cache key messages:<message_id> for message data storage by a Guild Message Manager.
In this case, would it keep the "author" data (which is a user, which might end up duplicating the data of users:<user_id>, potentially causing staleness issues..), or would that be extracted out for it to be solely stored on users:<user_id> (by a User Manager). If extracted, how do we link the author back to the message? (note that the Mess...
I would assume this is a task for the cache layer to figure out, but for something like a redis impl could have something like {messages:<id>} and {messages:<id>}:field_references or similar which could remap certain fields to other redis keys
So in your message example, field_references for that message would be a hashmap of author -> users:<id>
This changes the documentation workflow on v14 branch to only work on tags (which it already did anyway, since the only branch it runs on is main) and make sure it runs the main workflow where necessary.
This should fix the docs regression where linking to the source code of re-exported members incorrectly linked to generated dist/*.d.ts files of the imported subpackages instead of the actual source.
Which package is this bug report for?
voice (@discordjs/voice 0.19.0)
Issue description
During DAVE E2E encryption, 34% of Opus voice packets are silently dropped during MLS key transitions. No errors are surfaced to the consumer — packets simply vanish. This makes voice receive unreliable for any application that processes speech (STT, recording, moderation).
Separated from #11419 per @Qjuh's request — this is a distinct issue from the reconnect-loop behavior reported there.
...
py-cord doesn't even support DAVE yet, let alone voice recieve: https://github.com/Pycord-Development/pycord/pull/2873
Thanks for the correction @Snazzah — you're right. I referenced the py-cord comparison from the original issue (#11419) without verifying their DAVE support status. That comparison is invalid and I've struck it from the issue description.
The core finding stands independently of any cross-library comparison:
Over 55 seconds of continuous speech with @discordjs/voice 0.19.0 + @snazzah/davey 0.1.10:
- 272,894 bytes captured out of ~412,500 expected (64kbps Opus)
- **34% of packets sil...
Following up with a deeper analysis of the captured PCM data.
Segment size distribution is bimodal
25 segments over 74.1 seconds show two distinct populations:
| Group | Count | Mean size | % of segments |
|---|---|---|---|
| Tiny (<2KB) | 7 | 772 bytes | 28% |
| Normal (≥2KB) | 18 | 14,860 bytes | 72% |
That's a 19× difference between groups. Coefficient of variation is 98% — far outside what's expected for continuous speech (typically 10–20%).
Thre...
It seems like you're encountering a common issue with short audio buffers on cloud environments like AWS EC2. This usually happens because the UDP packet stream doesn't have enough time to stabilize before the audio resource ends, or due to resource throttling on T2/T3 instances.
Here are a few things you can try to resolve this:
Enable Inline Volume: Even if you don't change the volume, enabling inlineVolume forces the resource to be processed through a transformer, which sometimes hel...
307b64f chore: make docgen package private (#11434) - almeidx
fce4989 fix(structures): add missing toJSON method on... - AsadHumayun
f194927 docs: add missing ApplicationCommandPermissions... - almeidx
ec796ca fix(GuildChannel): Handle empty overwrite must ... - vakiliner
3c9d90a chore: move proxy-container to apps (#11435) - almeidx
[discordjs/discord.js] New branch created: chore/remove-file
Had this in my work tree because of course I would, forgot, did a git add . and git commit last moment before a merge and now it's in the main branch. oops!
ngl we could've just kept it in a rfcs folder but 😄
Apart from the nit pointed out by coderabbit LGTM
323d8e7 fix(voice): always install Davey as DAVE is bec... - vladfrangu
7a7fecb fix(structures): correctly check if flags are p... - Qjuh
fc5ba6b feat(structures): add Subscription structure (#... - AsadHumayun
c126367 feat(structures): add Team structure (#11396) - AsadHumayun
693fcbc feat(structures): add Stage Instance structure ... - AsadHumayun
And with this library still not possible?
@miguilimzero Correct, the comments above by the team are up to date. It's unlikely d.js will ever support it since it's entire purpose is to make gateway-connected bots. Like the comments above said, you can use @discordjs/core/http-only to make rest calls though.
@discordjs/voice 0.19.0: DAVE audio receive decryption fails — DecryptionFailed(UnencryptedWhenPassthroughDisabled)
Note: This may be a duplicate of or related to discordjs/discord.js#11419. Filing with additional diagnostic data.
Bug
After successfully connecting to a DAVE-enabled voice channel with @snazzah/davey installed, incoming audio packets cannot be decrypted. All voice capture attempts result in empty transcription because the raw audio is corrupted/undecryptable.
...
py-cord does not have DAVE yet (https://github.com/Pycord-Development/pycord/pull/3143)
I will be closing this as yet-another-ai-slop-issue unless proven otherwise. Please follow up with reproduction steps and samples if I assumed your issue is AI by mistake.
I would like to explicitly note that at this stage our (py-cord) implementation should not be taken as reference and is not in a stable working state.
52173b6 fix: disable per option validation on chat inpu... - almeidx
84b85f4 refactor!: remove builders and formatters re-ex... - didinele
f3942a6 chore: Release @discordjs/voice 0.19.1 (#11446) - Jiralite
c486fb8 fix(voice): strip padding from packets and add ... - Snazzah
2b39350 Merge branch 'main' into chore/remove-file - kodiakhq[bot]
fe5e3c2 chore: remove file from root (#11442) - didinele
Hi, about 2 years ago, I was hacked and banned from many servers. I am developing a bot, so I would like to get an unban on your server. I would like to point out that I was also banned from the Discord Developers server, but I have already successfully unbanned it there. I hope that I can also get unban on your server.
id - 992686529652736000
Glad you got your account back! You can rejoin whenever you want!
[discordjs/discord.js] New branch created: fix/core-send-soundboard-sound-return
Both the explicit return type and the cast are wrong, because the data can be omitted by extending classes. The same applies to all other getters in this class.
So this is a substructure and shouldn't be exposed as a getter. Instead it should be added to the remark on the class and downstream implementers are responsible for it.
While coderabbit got the core issue correct here, it's suggestion inherently causes the same issue. If someone doesn't pass this option, it will fallback to null. We should not be doing that unless user explicitly do so. This should be fine I think
base_theme: this.options.sharedClientTheme.baseTheme,
Pretty sure ?number should be BaseThemeType and that should be defined in the JSDoc file for discord-api-types?
Summary
Fixed spelling error in packages/api-extractor/CHANGELOG.md line 2665. Changed 'Seperated' to 'Separated'.
Details
- File: packages/api-extractor/CHANGELOG.md
- Change: Line 2665 in version 1.1.14 entry
- Before: 'Seperated the ApiItem initialization...'
- After: 'Separated the ApiItem initialization...'
Why This Matters
This typo appears in the public CHANGELOG viewed by 100k+ discord.js developers when reviewing release notes. Fixing spelling errors in C...
These kind of changes to the api-extractor package should be done upstream instead.
https://github.com/microsoft/rushstack/tree/main/apps/api-extractor
[discordjs/discord.js] New branch created: chore/disable-tagging-from-cliff-jumper
d40e7d0 chore: disable tagging when running cliff-jumper - vladfrangu
We don't need it to make tags
base_theme: z.enum(BaseThemeType).nullish(),
gradient_angle: z.int().min(0).max(360),
base_mix: z.int().min(0).max(100),
shared_client_theme: sharedClientThemePredicate.nullish(),
colors: z.array(z.string().regex(/^[\da-f]{6}$/i)).min(1).max(5),
[discordjs/discord.js] New branch created: feat/guild-member-collectibles
shared_client_theme: sharedClientThemePredicate.optional(),
shared_client_theme is not nullable.
* @property {?BaseThemeType} [baseTheme] The mode of the theme
public setColors(colors: readonly string[]): this {
otherwise this won't accept passing a readonly string[].
Why is this not simply BaseThemeType.Dark?
Since this is only used in one interface (BaseMessageCreateOptions) it can be moved into that interface and doesn't need its own interface.
};
if ('base_theme' in data.shared_client_theme) {
this.sharedClientTheme.baseTheme = data.shared_client_theme.baseTheme;
}
It is nullable in the spec
[discordjs/discord.js] New branch created: chore/bump-deps
Some major bumps are included in this pr, split into individual commits
I don't think this is worth blocking the pull request over. I suppose we can go with what the docs say
discord-api-types has been bumped on this repository, and I updated your pull request to have the new version.
Tests are failing
discord-api-types has been bumped on this repository, and I updated your pull request to have the new version. Tests are failing
Updated tests, should pass now.
Add more attachment and embeds fields
Discord API Docs reference:
Depends on:
[discordjs/discord.js] New branch created: feat/activity-instance
[discordjs/discord.js] New branch created: feat/core-activity-instance
[discordjs/discord.js] New branch created: fix/core-misc
[discordjs/discord.js] New branch created: feat/core-thread-members-query
When building AI chatbots on Discord, streaming LLM responses requires repeatedly calling message.edit() which hits rate limits quickly.
Request: A built-in streaming message helper that batches edits intelligently (e.g. every 500ms) to show real-time AI generation without hitting Discord rate limits.
Use case: AI agent platform with Discord channel adapter that streams Claude/GPT responses in real-time.
It won't matter whether you call message.edit(), stream a response, do it through an MCP, make a CLI, or whatever you want to edit your message, as it'll all translate to the same requests to Discord, so you'll still hit the ratelimit. It's simply not a platform for that kind of stuff.
Consider:
- Showing the user the response only when it's done, not repeatedly editing the message.
- If using interactions, usingthe
editReply()method on the interaction which uses the interaction webhook ...
The Related library link in README.md was broken. Updated it to the documentation page I belive it was originally intended to reference.
Almost all app/package READMEs have this link as well. They also need updating
aa2767b fix(MessagePayload): allow AttachmentBuilder in... - Qjuh
[discordjs/discord.js] New branch created: fix/github-icon-size
Thank you for the report. We're aware of the breaking change, however, this has been a problem for a year with a fix already released, so we will not devote any effort to creating new releases for all affected versions.
To confirm, this means that new versions like 14.26.1 won't be broken by SemVer-comptaible upgrades to @discordjs/builders and others in the future, right?
[discordjs/discord.js] New branch created: ci/empty-deprecation-message
a39fb54 ci: fix empty message - Jiralite
Since moving to packages/actions, calls always pass message:
This means the default message will not be used as a value is present. Moved the handling of the default to the command instead.
58c5ebd chore(readme): update related libraries link (#... - 2hoch1
Can we move the default here instead?
aaf55c4 refactor: move default again - Jiralite
d0e7013 fix: move others too - Jiralite
Are there any updates since then?
Being able to mock the api would be so good
Hello 👋 I Want to fetch message . How Do i do it in v14 ??
Hello 👋 I Want to fetch message . How Do i do it in v14 ??
It hasn't changed for ages, example bellow:
<TextChannel>.messages.fetch('id')
can we update to typescript 6.0
No, because tsup doesn't support it. We will probably need to move away from tsup first since it seemingly is no longer maintained.
On Wednesday, 15 April 2026 at 16:58, lajczi @.***> wrote:
lajczi left a comment (discordjs/discord.js#11492)
can we update to typescript 6.0
—
Reply to this email directly, [view it on GitHub](https://github.com/discordjs/discord.js/pull/11492#issuecomment-425355001...
No, because tsup doesn't support it. We will probably need to move away from tsup first since it seemingly is no longer maintained.
…
On Wednesday, 15 April 2026 at 16:58, lajczi @.***> wrote: lajczi left a comment [(discordjs/discord.js#11492)](#11492 (comment)) can we update to typescript 6.0 — Reply to this email directly, [view it on GitHub...
Summary
Small, documentation-only fixes across a few packages and the guide. No code behavior is changed.
Please describe the changes this PR makes and why it should be merged:
packages/brokers/src/brokers/redis/RedisGateway.ts— fixwether→whetheranddependant→dependentin theRedisGatewayclass JSDoc.apps/guide/content/docs/legacy/miscellaneous/useful-packages.mdx— remove duplicated word: "Check the the documentation" → "Check the documentation".- ...
Also shouldn't be raw API data.
This should use UserManager#_add instead to add/patch those users into the cache, not raw API data. So I assume Attachment should just store the clipParticipantIds and clipParticipants would be a getter, not a property.
If it's present then it should be a date. The field is not documented as being nullable, so the ternary here is weird.
This whole class is obsolete now and should be deleted. EmbedImage already exists.
Should probably add these as getters to mainlib packages/discord.js/src/structures/UnfurledMediaItem.js too.
Also a substructure, no getter, add a remark to class' JSDoc.
These are substructures and shouldn't have a getter. Instead add a remark on the JSDoc for the class. Or rather add a JSDoc to the class at all, guess that was missed when writing this class.
aa2767b fix(MessagePayload): allow AttachmentBuilder in... - Qjuh
aa1e6be fix: github icon size (#11488) - almeidx
58c5ebd chore(readme): update related libraries link (#... - 2hoch1
8ea7c7c fix(collection): preserve ReadonlyCollection th... - Dramex
fc6a67c Merge branch 'main' into feat/core-activity-ins... - kodiakhq[bot]
Misssing DataTemplate static override
Let's name this SharedClientTheme instead to match the documentation?
this.sharedClientTheme.baseTheme = data.shared_client_theme.base_theme;
Let's rename the file to match the class name?
public clipCreatedAt: Date | null;
export class Attachment<Omitted extends keyof APIAttachment | '' = 'clip_created_at'> extends Structure<APIAttachment, Omitted> {
Always returned
flags: Readonly<EmbedMediaFlagsBitField>;
Never returns null
public get flags(): EmbedFlagsBitField;
Since we're optimizing this prop out, we need to override the toJSON method to add it back
This is an array, not sure if we want to expose this or leave it to consumers? cc @Qjuh
* @see {@link https://docs.discord.com/developers/resources/message#shared-client-theme-object}
Let's use the new documentation domain for new links
* @see {@link https://docs.discord.com/developers/resources/message#shared-client-theme-object}
Which package is this bug report for?
discord.js
Issue description
Hey, I'm trying to create a /ban command. I want the users to be able to appeal this ban with a /appeal command that they can execute in the bot's DM, but actually, the bot appears offline when they're banned.
So firtsly, I tried with the /ping command. When the users are on the guild, they can use the command in the bot's DM because it appears online. Then, when they're banned, the bot appears offline, so the user...
This doesn't appear to be a discord.js bug.
~You forgot to add:
new SlashCommandBuilder().setIntegrationTypes([ApplicationIntegrationType.UserInstall])
```~
Hey, I don't understand, I added your code, and they can't. Can you help me ? I don't understand how to do.
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Affiche le ping et la latence du bot.')
.setDefaultMemberPermissions(null)
.setContexts([
InteractionContextType.Guild,
InteractionContextType.BotDM,
InteractionContextType.PrivateChannel
])
.setIntegrationTypes([Appli...
My previous answer was wrong, I corrected it.
So the users need to add the application ?
To use commands without installing them on a server or even having shared servers with the bot - yes.
It's a bit annoying, we didn't need to do that before ?
So the /appeal command isn't the best way, I think.
This doesn't appear to be a discord.js bug.
If the app is offline, it means you forgot to install it in the user.
To install the application for the user, there is the following generated link: https://discord.com/oauth2/authorize?client_id=${APP_ID}&integration_type=1&scope=applications.commands
It's a bit annoying, we didn't need to do that before ? So the /appeal command isn't the best way, I think. Maybe a website with an appeal page can be better.
I specifically use a separate server for accepting appeals, where my bot is installed.
You can use my idea if you want.
Yeah, I already saw that on few servers, but I didn't want to do that because I think that one server for the "main" server and a second server for the appeals, it can be a lot.
I'll see that later.
Thanks you for your help.
So, when I want a command to be accessible in DM, I need to set the contexts and the Integration Type ? Do I need to add the ApplicationIntegrationType.GuildInstall ?
Yeah, I already saw that on few servers, but I didn't want to do that because I think that one server for the "main" server and a second server for the appeals, it can be a lot.
Yes, indeed, I have several servers linked to the server that accepts appeals.
Do I need to add the ApplicationIntegrationType.GuildInstall ?
This can be left if contexts are set only to BOT_DM.
This way, if the user and the application share servers, the user won't need to install the application.
This should fix the issue where the source of re-exported external members links to a /dist/index.d.ts file instead of the documentation of the external package.
Example: https://discord.js.org/docs/packages/discord.js/14.25.0/SlashCommandBuilder:Class
corrected the copied error message in ApiParameterListMixin so it points to the right mixin & renamed the guide and website Nextjs middleware entrypoints to proxy to match the current convention and remove the deprecation warning
The api-extractor change should be made upstream instead:
https://github.com/microsoft/rushstack/blob/3c15b4dc66188e6f014a2da6bda7c3e0069353b3/libraries/api-extractor-model/src/mixins/ApiParameterListMixin.ts#L135
As for the middleware -> proxy changes, @opennextjs/cloudflare doesn't support it, which is what we are using.
Found a few typos in the guide documentation files:
-
apps/guide/CONTRIBUTING.md- Line with "repeating formatting intsructions" → should be "instructions"
- Line with "When descrbing multiple files" → should be "describing"
-
apps/guide/README.md(minor wording improvement)- "check your changes out locally" → could be "check your changes locally" (remove redundant "out")
These are minor documentation fixes that improve readability. Happy to submit a PR ...
I'd like to contribute and fix these typos myself. Will submit a PR shortly.
Forgot to mention in the original issue - I'd like to contribute and fix these typos myself. Will submit a PR shortly.
Does this actually work? From what it looks like, pkgName here would only be e.g. collection, not @discordjs/collection
Also, this line still shows a warning (even though it doesn't show up in the CI here, because of... reasons...) for the unicorn/better-regex rule
I'd rather we disable the rule here with a eslint-disable comment, since it's clearly a false-positive.
Thanks for catching both of these, you're right. It's hard to test this since it only applies to non-main tags.
Arrays of primitve data types like these are fine to expose. Immutability is the bigger concern I'd say, not sure if we want to return a cloned array here instead.
This won't add/patch the user data in cache though, missing UserManager#_add call here.
This should not be a ClientApplication because that's only for the application instance of the logged in Client. But this application could be from any arbitrary application, similar to IntegrationApplication it should be another class extending Application.
still missing proxyURL, height, width, contentType and attachmentId getters.
This is only adding the id to the cache, the full user data is lost at this point. The user should be gotten from cache here, not added.
Smfh I was making a local pull request and fat fingered it please ignore me as I shame myself
error: 'Cannot set content, embeds, stickers, poll, or shared client theme with IsComponentsV2 flag set',
Should support RestOrArray here
Lets keep this file alphabetically sorted
Fixes several issues reported by api-extractor.
- some types that are used as parameters need to be exported by the d.ts file
- some link tags used malformed syntax
When a bot sends a reply, the Discord client sometimes shows the typing indicator stopping and then restarting immediately after the message is sent.
This is visible in a thread context with a bot built on discord.js. Other bots in the same server do not show the same behavior.
Observed behavior:
- typing indicator ends when the message is sent
- then it reappears right after, without a new incoming message
Expected behavior:
- typing should stop once the response is delivered
- it should ...
This isn't a Discord.js bug, but rather a bug in your code.
I've encountered this bug myself, but it's a bug on my end.
58c5ebd chore(readme): update related libraries link (#... - 2hoch1
8ea7c7c fix(collection): preserve ReadonlyCollection th... - Dramex
40ce079 feat(ApplicationsAPI): add getActivityInstance ... - almeidx
1e88dcd feat(DMChannel)!: allow partial DMChannel witho... - Qjuh
e490a23 fix(stringOption): zod validation (#11532) - didinele
e721e51 ci(deprecateVersion): Fix empty message (#11491) - Jiralite
Hello!
It's a problem for a while that DiscordJS based bot might just stop the working even process itslef is still running and not failed. This happens always when there are network failures and disconnects. Is any way to handle the possible disconnect and run the reconnect from the scratch? Or at least self-kill process and let things like SystemD to restart the process. Recently I had two such accidents, like district-wide power surge that caused network fail, my server continued to wor...
The @discordjs/ws library automatically reconnects the bot when the network fails.
Is that a built-in dependency? However, it doesn't work as expected, especially if network failures are longer, like, for 5 or 10 minutes entire network was down (switches are working, but node in a middle is failed, and it's totally no network available). And it doesn't reconnects. And, it also sometimes gets failed after the long time work (the bot is installed as SystemD daemon and works 24/7).
When disconnected from the network for a long time, does your process crash and terminate, or does it freeze?
I had a similar issue where an unhandled error occurred and the process terminated after a long network outage.
I fixed it by adding two handlers: process.addListener('unhandledRejection', (err) => console.error(err)) and process.addListener('uncaughtException', (err) => console.error(err)).
No, it doesn't crash, it just stay working forever and totally no interaction, and totally no errors printed.
Just a simple example of this simple bot: https://github.com/Wohlstand/bastionbot-js
And ye, I need to slightly upgrade it. However, the absolutely same happens with my more complicated bot https://github.com/Wohlstand/FoxyBot/, it works on DiscordJS 14, and the problem I described happens for a long while, since 2018, since 2020, since 2022, and recently it happens too. No matter, simple bot, or complicated. The result is same, they might just stop to do everything and print no errors. But ...
Log files of both bots,
-
Bastion was failed a while ago, and it revived once I rebooted it manually:
dump-bastion.txt -
Foxybot worked until electricity failed and network is gone, and then just periodical memory stats are printed and no messages. dump-foxybot.txt
-
Foxybot also has its own logger that stores errors into separate debug files, er...
Actually, I might try to simulate the same network problem just by unplugging the router cable from my switch (I don't plug my computer directly to the router, only through the middle switch, I do use switches to maintain segments with many devices far from the main router), and show what actually happens.
This and the other update event should also emit the old channel (before patching) as a clone similar to other *Update events.
If you can get us a reproduction sample / steps to reproduce, we can take a look. But discordjs/ws should always attempt to reconnect, no matter what
If you can get us a reproduction sample / steps to reproduce, we can take a look. But discordjs/ws should always attempt to reconnect, no matter what
I forgot to mention, I ran all my bots with the --max-old-space-size=256 --expose-gc arguments of NodeJS, and the periodically ran function calls the garbage collector every half of hour. Is that possible the limited memory and garbage collector might cause such problem?
The test case - the BastionBot that I mentioned before, just now I upgraded it to the latest stable DiscordJS and the code to use new API.
You just fill the JSON config file with the static guild and dedicated text channel, and the token to connect, bot is just replying to any "dance" word mentioned in messages sent at the dedicated guild channel. I ran the bot for 24/7. And the case I mentioned before, just let entire network to go off for a l...
Uhm. Aside of the fact you really shouldn't be limiting your processes to such small amounts of ram (and according to your github for bastionbot, you actually cap it at 128MB of ram) nor touch the GC (it can handle itself), the logs don't really show anything suspicious.
You should listen to debug events on your client and print those, and catch this error you're seeing (client.on('debug', message => {}) but you might want to filter out heartbeat messages), and ideally follow up with tho...
I do such memory limiting knowing NodeJS is a greedy memory eater, and I don't want simple bots eat so much memory of the server (I would like to rebuild entire set of bots just into C++, but available SDKs for Discord aren't well developed).
You should listen to debug events on your client and print those, and catch this error you're seeing (client.on('debug', message => {}) but you might want to filter out heartbeat messages), and ideally follow up with those here when you reproduce th...
And ye, I performed the test now, and seens it's too short time before it will go for a while, I'll set it up on my main server, and once it will hang, then I will dump a debug log.
[discordjs/discord.js] New branch created: fix/sim-resolve-scheduled-event
Good news first, @Trembler34: we're past the scope problem. The new log line is openid-client's iss validation step, and the expected undefined part is the actual clue.
What's happening
When the OIDC config in ProxCenter has the manual override URLs filled in (Authorization URL, Token URL, Userinfo URL), our backend skips OIDC discovery and constructs the provider from those URLs directly. The issuer metadata never gets loaded, so NextAuth's id_token validator has nothing to compare t...
What's Changed?
- This PR adds zizmor to our CI to check for incorrect usage of our workflows. As for now, I tuned the tool to target high confidence and high severity
and it's locked now. what's the point even?
The point is that the thread answers the user's question and can help others that are also trying to play from Spotify. It's not for unknown users to hijack the thread and reply with their own issues, so it being locked should be irrelevant. Also this is a 3 year old post, if you have an issue and the thread didn't answer it, you should make a new one