Commit Graph
100 Commits
Author SHA1 Message Date
Fleny 6a5c346546 feat(rest): unref queue timers to prevent process hang (#4693)
Currently if a queue is pending deletion or waiting to refill its ratelimit will keep the process alive, this is not ideal for scripts like command deployment ones
This does not impact the functionality of the queues in any way, just allows the process to exit if nothing else is pending in which case you would be loosing the ratelimit information anyway
2026-01-20 12:00:21 +05:30
Fleny 83c2fef9c5 chore(.vscode): use unix path for typescript tsdk (#4684)
While windows accepts both (or gets normalized, i don't actually know), Linux does not
2026-01-20 11:52:11 +05:30
FlenyandAwesome Stickz a3bb9fc1a0 ci: Remove CI hard time limit on E2E (#4683)
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2026-01-20 11:47:34 +05:30
Fleny 27c261fee2 formatter: Use semicolons (#4686)
I prefer semicolors, they also help avoiding certain pitfalls in JavaScript/TypeScript, such as the following code sample:
```js
const xyz = "test"
(something.else as string) = "another"
```
This results in a TypeError: "test" is not a function, this is because js thinks we are trying to call the string "test" as a function.
To fix this it requires a `;` somewhere before the `(`, such as `;(something ... ` which in my opinion is ugly and less clean overall.
2026-01-17 21:54:15 +01:00
Fleny c1445e4600 fix(rest): Always encode URI component in routes (#4609)
* fix(rest): Always encode URI component in routes

Instead of using the implicit behavior of `fetch` and `Request` we do it explicitly in the routes.

* Add checks for numbers and digits-only strings

* Add option to disable uri encode
2026-01-12 12:12:54 -05:00
FlenyandAwesome Stickz 5ff9822759 fix(bot): make Interaction.guild a Partial<Guild> (#4556)
* fix(bot): make Interaction.guild a Partial<Guild>

* Update packages/bot/src/transformers/types.ts

Co-authored-by: Awesome Stickz <awesome@stickz.dev>

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2026-01-09 01:52:56 +05:30
Fleny 72677dc6cc fix(bot): Add colors to the role transformers (#4610)
It wasn't added when discord added the feature and the roleColors transformer was added
2026-01-07 14:30:40 -06:00
Fleny ed4967751c fix(bot): Add missing AutoModerationRuleTriggerMetadata.mentionRaidProtectionEnabled (#4611)
Also copy the comments from the Discord-prefixed type
2026-01-07 14:08:03 -06:00
Fleny 59f76685de api-docs: Add BYPASS_SLOWMODE permission flag (#4607) 2026-01-07 14:03:52 -06:00
Fleny f917b164dd api-docs: Add entitlement delete and update webhook events (#4627) 2026-01-07 14:00:41 -06:00
Fleny 1b9394244b api-docs: Guild Role Member Counts endpoint (#4628) 2026-01-07 13:55:42 -06:00
Fleny 8d90f28307 test: Refactor mocha config & test scripts (#4664)
* Merge mocha config file

* Simplify scripts, remove coverage path fixing

Codecov is able to fix the coverage paths on its own

* Readd coveragePathFixing script

* Fix coverage path fix script
2026-01-07 13:51:26 -06:00
FlenyandSkillz4Killz 011f0fe0dc ci: Use turbo remote cache (#4666)
* Use a turbo remote cache server for CI

`rharkor/caching-for-turbo` uses github actions cache to provide a remote cache server for turbo, so we can use previuously created cache if available and requested by turbo, and this doesn't have the downside of having the cache growing indefinitely like with normal github actions cache as since the single caches are uploaded to the github actions cache, github can evict the old cache when it's not used or there is no space left.

Also add turbo to website so we can cache the build

* Use turbo for website build & build:doc

* fix typo, tubo -> turbo

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2026-01-07 13:40:27 -06:00
FlenyandSkillz4Killz 86c5601d5e Use a single afterEach hook to clean up resources (#4665)
Using `after` in the single tests is a bit messy as it runs after all the tests and if one fails sometime it won't run properly.
This approach uses a single `afterEach` hook to clean up all resources created during the tests after each test run.

Also remove `async` from describe functions as it is not supported and can lead to issues

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2026-01-07 13:34:38 -06:00
Fleny 839cc2473b ci: Use trusted publishing for npm packages (#4644) 2025-12-18 09:14:37 +01:00
Fleny 5867d11415 feat(components): File upload component for modals (#4468)
* feat(components): File upload component for modals

* Update comments

upstream has been merged into the file uploads pr

* reverse transform, comment typo fix
2025-10-28 20:26:07 +01:00
FlenyandAwesome Stickz 3d2ff13e4d feat(oauth2): PKCE support (#4425)
* feat(utils): Add base64url encoding

RFC 7636 (Proof Key for Code Exchange by OAuth Public Clients) requires to encode the data with base64url encoding.

We don't support decoding as we don't need it for PKCE.

* feat(oauth2): Add PKCE support

* make PKCE code verifier optional, fixup comments

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-10-27 19:43:55 +01:00
FlenyandAwesome Stickz d8fc6ec02d feat(bot)!: make desiredProperties generic in transformers (#4469)
Updated desiredProperties in transformers to be generic so that it can be used to retrive the bot desired properties, and removed the option from `CreateBotOptions.transformers.desiredProperties` as that would cause the typings for the bot to be incorrect

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-10-27 19:35:27 +01:00
FlenyandAwesome Stickz bd4e6f148c api-docs!: Modal Selects (#4467)
* api-docs!: Modal Selects

* Fix transformer to handle the new response types

* Remove `Component` for consistency

Other interaction response types do not have `Component` in their names, so neither should the TextDisplay and Label interaction response types.

* Fix type errors in component transformers

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-10-27 19:32:00 +01:00
Fleny fdf94c379d api-docs: Add invite_cover_image to activity assets (#4537) 2025-10-25 16:20:43 +02:00
FlenyandLink bbdd2d1183 fix(types): update message.resolved description (#4511)
Co-authored-by: Link <link20050703@gmail.com>
2025-10-21 14:57:00 -07:00
Fleny cc9b97220b fix(types): Fix bounds for ApplicationCommandOptionTypes.Integer (#4512) 2025-10-06 18:19:28 +02:00
Fleny df8cc46882 fix(types,bot): Update channel.permissions description (#4513) 2025-10-06 18:16:22 +02:00
Fleny fde6751b77 chore(website): Update deps and remove styled-components (#4466)
* chore(website): Remove styled-components

This also allows us to remove the loading screen on page load as the styles are now loaded by the browser itself.

* chore(website): Update dependencies

* Remove clsx

* Update dependencies

Also update markdown onBrokenMarkdownLinks options as it now deprecated in favor of markdown.hooks.onBrokenMarkdownLinks

* Update dependencies
2025-10-02 21:41:54 +02:00
Fleny b7c433056f Change dependabot update intervals to weekly (#4480)
Also add the website folder to be checked for npm updates
2025-10-02 21:33:22 +02:00
Fleny 2545bff5a6 Remove benchmarks page & package (#4479)
* Remove benchmarks package and page

* Remove benchmarks CI
2025-10-02 21:30:06 +02:00
FlenyandAwesome Stickz b294cca654 fix(transformers): Always set customId for InputText components (#4472)
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-09-23 05:52:33 +02:00
Fleny a4c0159b9d docs(bigbot): fix REST body handling (#4464) 2025-09-19 19:22:07 +05:30
FlenyandAwesome Stickz 3ee8b48658 build(rest-passthrough): Use typescript to build (#4432)
* build(rest-passthrough): Use typescript to build

It doesn't make a lot of sense for something like this to use SWC to build + this needed typescript with a tsconfig anyway for a typecheck

* Add tsconfig

* Remove .swcrc and copy tsconfig in docker

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-09-18 01:08:34 +05:30
FlenyandAwesome Stickz df1658d923 build(packages): Remove swc --delete-dir-on-start (#4433)
Since we build the .js files and the .d.ts files in 2 different steps, you could run the tsc build and then the swc one, making swc delete the tsc build.

This is somewhat mitigated if you ran the tsc build with turbo as it will restore the cache, but it is annoying + the TS server in vscode for example will someone require you to restart it as it did not found the declration files for the package while it was building.

I did not find any good reason for this flag to be present, as while it will preserve files that no longer have a source, this matters only for local builds, as CI will always cleanly build the packages (and this issue exists with type declration as well anyway)

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-09-18 00:58:00 +05:30
FlenyandAwesome Stickz 87d16dd9ba feat(types,bot): Add Label component and new modal stuff (#4304)
* feat(types,bot): Add Label component and new modal stuff

Since now there are some fields that are only in responses the types got a bit more complicated

* Add char limits to label label & desc

* update comments

* fix format

* Move Require to shared.ts

* code review

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-09-18 00:50:59 +05:30
FlenyandAwesome Stickz 35133a1575 api-docs: Fix some stuff in interactions (#4457)
* api-docs: Fix some stuff in interactions

* Apply and fix code review suggestions

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-09-17 00:56:50 +05:30
FlenyandAwesome Stickz 0d4f17472f api-docs: banner, avatar, and bio on modify current member (#4458)
* api-docs: banner, avatar, and bio on modify current member

* Update packages/types/src/discordeno/guild.ts

Co-authored-by: Awesome Stickz <awesome@stickz.dev>

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-09-16 21:03:39 +05:30
Fleny 3a99a7e085 api-docs: Social SDK webhook events (#4459) 2025-09-15 15:45:11 +05:30
FlenyandAwesome Stickz d8dbcda383 api-docs!: Remove stage_instance, add expires_at to invites (#4445)
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-09-11 17:29:27 +05:30
FlenyandAwesome Stickz 9aec72df44 test(mocha): Update mocha to 11.7.2 and remove patch (#4429)
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-09-11 17:26:22 +05:30
FlenyandAwesome Stickz ba7ca458b6 docs(bigbot): Send snake_case packets to bot (#4430)
Currently the big bot gateway worker was sending camelCase packets to the bot which caused the transformers in `@discordeno/bot` to not find most of the properties they need in the payload.

This changes the docs to show to override the forwardToBot method to send the packets as-is to the bot.

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2025-09-11 17:09:41 +05:30
Fleny 11c5147d6f refactor(bot)!: Remove debug event (#4437) 2025-09-08 17:23:17 +02:00
Fleny 96fa6e3a3f chore(gateway)!: Remove Shard forwardToBot (#4431)
forwardToBot has been removed in favor of directly using the events.message.

the default implementation for forwardToBot used to camelize the packet, however in most cases you want to preserve the snake_case, and for those that need camelCase it can be easly done in the message event function.

This also removes the gateway.preferSnakeCase option as it no longer has a use
2025-09-05 08:28:48 +02:00
Fleny 4e08703eab feat(types): Add JSON error code 400001 (#4426) 2025-09-04 08:52:13 +02:00
Fleny 0832500f01 docs(rest): Update documentation for get invites endpoint (#4427) 2025-09-04 08:47:45 +02:00
FlenyandLink 8efd604be3 ci: Add if for image scan job (#4416)
Co-authored-by: Link <link20050703@gmail.com>
2025-09-02 19:01:30 +02:00
Fleny ae650a04d9 refactor(typedoc): update typedoc configuration and mark internal APIs as private (#4405)
The typedoc config is now only in the top-level config file instead of also being one per package
and all internal APIs are now marked as private so typedoc won't generate documentation for them, however we still need to export them to avoid typedoc warnings

The new internal APIs that are exported, since are marked as `@private` can have breaking changes without notices
2025-09-02 08:17:59 +02:00
Fleny 2a7cd9b2a5 refactor(transformers)!: Use type helper to define customizers (#4404)
* refactor(transformers)!: Use type helper to define customizers

This allows us to ensure that customizers always follow the correct types for the transformers and we don't have 2 places to add the types.

* remove outdated comment in transformInteractionDataResolved

* remove not needed cast

* remove not needed cast
2025-09-02 06:54:38 +02:00
Fleny 304aacdba9 feat(bot)!: Camelize the AuditLogEntry changes (#4403)
* feat(bot)!: Camelize the AuditLogEntry changes

* fix type errors
2025-08-29 11:02:33 +02:00
FlenyandLink e94308c8f2 chore: Imports directly from files instead of index files (#4400)
Currently we import from `index.js` files where we could simply import the actual file(s) or module we need.

This also creates a bit of confusion since it isn't obvious from where stuff is coming from, especially when we are importing types such as `Discord<XYZ>` types both from `@discordeno/types` and a `index.js` in the same file, one such example is `transformers/reverse/component.ts`.

As far as I can tell, this does not have any specific advantage beside readability, maybe something with tree-shaking. (and for us, tree-shaking doesn't really matter)

The only files that still import index.js files are:
- index.js files themself
- bot/src/handlers.js since it does a `import * as handlers from './handlers/index.js'` and the alternative is like 90 lines of imports

Co-authored-by: Link <link20050703@gmail.com>
2025-08-26 20:41:14 +02:00
FlenyandLink 3af54ca144 ci: Use biome ci in lib-check format (#4399)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-26 20:00:36 +02:00
FlenyandLink b7db305dee refactor: Use TransformerFunction to define transformers (#4402)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-26 10:56:43 -07:00
FlenyandLink c7074d7837 fix(types): Update which messages can be forwarded (#4398)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-26 10:32:01 -07:00
FlenyandLink 274b5972dd feat(types,bot): Add RATE_LIMITED & RESUMED handler & event (#4391)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-24 14:14:14 -07:00
Fleny 33ea279714 feat(types): Add PIN_MESSAGES permission (#4390) 2025-08-24 14:01:40 -07:00
Fleny 590653f572 fix(bot): Remove VOICE_STATE_UPDATE payload check (#4389) 2025-08-22 21:37:26 +02:00
FlenyandLink 269a5bf5f5 chore: Bump version to v22-beta.1 (#4377)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-22 10:55:03 -07:00
FlenyandLink bd37023847 ESM-only build (#4227)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-22 10:48:28 -07:00
FlenyandLink 8996169b9d build(deps-dev): Update typescript & @types/node (#4325)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-22 09:39:52 -07:00
FlenyandLink 2ccf3c1437 ci: Fix snyk scan (#4317)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 20:44:11 -07:00
FlenyandLink 52fc7b8c97 build(deps-dev): Update @biomejs/biome (#4327)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 20:39:23 -07:00
FlenyandLink b6f2d914b8 ci: Use biome ci in lib-check format (#4319)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 20:35:25 -07:00
FlenyandLink 5d0cef5dca build(deps): Update ws & @types/ws (#4332)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 20:32:03 -07:00
FlenyandLink 7a97340bdb build(deps-dev): Update lint-staged (#4328)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 20:28:46 -07:00
FlenyandLink 9759eba986 ci: Specify permissions for CI (#4338)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 19:07:49 -07:00
FlenyandLink be3e2abd69 build(deps-dev): Update @types/sinon & @types/chai-as-promised (#4331)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 18:42:09 -07:00
Fleny a9cfdcff9a build(deps-dev): Update @swc/cli (#4329) 2025-08-20 16:15:05 -04:00
Fleny 41d58f8d2a build(deps-dev): Update turbo (#4326) 2025-08-20 16:07:22 -04:00
Fleny d5b2974d9f chore: use biome check instead of separate lint and format commands (#4320) 2025-08-20 16:03:42 -04:00
FlenyandLink 49a8cd1aa6 Double the REST E2E testing timeout (#4318)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 12:57:40 -07:00
FlenyandLink c429ec9c36 feat(bot)!: Use an "extra" params for transformers (#4372)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 12:10:35 -07:00
FlenyandLink 27e53b801a fix(types)!: Fix discordeno/user.ts (#4365)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 11:11:14 -07:00
FlenyandLink df3cfebb86 chore(.github): Assign @discordeno/team to most codeowners (#4379)
* chore(.github): Add @discordeno/team to most codeowners

Also removes /.github/sync.yml, that file does not exist

* Remove explit mentions

They are already in the team, so they do get the perms anyway

* Update .github/CODEOWNERS

Co-authored-by: Link <link20050703@gmail.com>

---------

Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 11:52:12 -05:00
FlenyandLink 702b252396 fix(types)!: Fix discordeno/interactions.ts (#4360)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-17 20:20:23 -07:00
FlenyandLink d79e672f5a feat(gateway): Use node:zlib zstd when available (#4373)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-17 13:38:46 -07:00
FlenyandLink fca0b40be5 feat(bot)!: Make desiredProperties required (#4381)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-17 13:01:58 -07:00
Fleny 83a075e64b docs: Add desired properties to examples (#4380) 2025-08-17 12:59:11 -07:00
Fleny b47feae4fa fix(bot): Remove handlers payload checks (#4374)
To remove the check from VOICE_STATE_UPDATE we need to wait for #4372 to get merged
2025-08-17 09:16:03 +02:00
Fleny 0b073a151d chore(rest): Remove todo about GET bodies (#4375)
We do not need to do anythng with GET bodies, fetch() will even throw if a body is passed to a GET
2025-08-17 09:10:46 +02:00
FlenyandLink ed85fe9a5f chore(bot): Remove incorrect joinedAt (#4376)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-17 09:00:37 +02:00
Fleny 7d09a05ea1 docs: switch bigbot and caching guide position in docs (#4378) 2025-08-16 22:57:19 +05:30
Fleny 825906aed7 fix(bot): Check nullable in transformPresence (#4370)
Despite the type not having the optional, it may get called with an partial object
2025-08-16 20:53:07 +05:30
Fleny 38d1707788 fix(types)!: Fix discordeno/message.ts (#4362) 2025-08-15 22:13:02 -04:00
Fleny 84087917ef fix(types)!: Fix discordeno/channel.ts (#4355) 2025-08-15 22:09:56 -04:00
Fleny 5de802e352 fix(types)!: Fix discordeno/guild.ts (#4357) 2025-08-15 22:06:29 -04:00
Fleny d203fc780f fix(types): Fix discordeno/guildTemplate.ts (#4359) 2025-08-15 22:02:30 -04:00
Fleny ba9402e5d2 fix(types): Fix discordeno/stageInstance.ts (#4364) 2025-08-15 16:15:57 -04:00
Fleny 6f8191516a fix(types): Fix discordeno/autoModeration.ts (#4354) 2025-08-15 16:07:13 -04:00
FlenyandLink 033023f0a3 fix(types)!: Fix discordeno/guildScheduledEvent.ts (#4358)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-15 15:58:01 -04:00
FlenyandLink eabf34b511 fix(types)!: Fix discordeno/application.ts (#4353)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-15 15:54:00 -04:00
FlenyandLink 01dd69b482 fix(types): Fix discordeno/lobby.ts (#4361)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-15 15:18:54 -04:00
FlenyandLink 511022fcd0 fix(types): Fix discordeno/emoji.ts (#4356)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-15 15:11:09 -04:00
FlenyandLink 0c0ff4e07a fix(types): Fix discordeno/reference.ts (#4363)
* fix(types): Fix discordeno/reference.ts

* Apply suggestions from code review

---------

Co-authored-by: Link <link20050703@gmail.com>
2025-08-15 14:15:31 -04:00
Fleny 9de5d93014 feat(bot): Add guildId to ThreadMember (#4335) 2025-08-14 19:21:22 -07:00
Fleny 6679f2c0e4 chore(bot,utils): Move snowflake utils to @discordeno/utils (#4345) 2025-08-14 12:08:19 -07:00
FlenyandLink 247fd4b348 fix(rest): Rewrite rest.simplifyUrl (#4305)
* fix(rest): Rewrite rest.simplifyUrl

* Update packages/rest/src/manager.ts

Co-authored-by: Link <lts20050703@gmail.com>

---------

Co-authored-by: Link <lts20050703@gmail.com>
2025-08-14 20:38:03 +02:00
Fleny 86f8fbd589 fix(bot)!: Remove InternalBot, add messagePin transformer (#4302) 2025-08-14 18:43:34 +02:00
FlenyandLink 65cbe5d1e6 fix(types)!: Split and fix discordeno.ts (#4301)
* fix(types)!: Split and fix discordeno.ts

* fix some mistakes

* remove now not needed @ts-expect-error

* Apply code review suggestions

* Fix test type errors

* Revert "Apply code review suggestions"

This reverts commit 7a0cea84b3.

* Restore some of the changes from the revert

---------

Co-authored-by: Link <lts20050703@gmail.com>
2025-08-14 18:37:52 +02:00
Fleny d50d47ec99 feat(gateway)!: Rename shard.events.identified to shard.events.ready (#4334) 2025-08-14 08:29:19 +02:00
Fleny b70cf76165 feat(bot)!: Remove bot.events.guildUnavailable (#4336)
It is now merged with the guildDelete event
2025-08-13 16:18:03 +05:30
Fleny 51158071ad api-docs!: remove GetInvite.withExpiration, remove optional from DiscordInvite.expires_at (#4321) 2025-08-13 11:09:39 +02:00
Fleny a5a3e412ac Remove the deno benchmark code (#4322)
This is not the actual benchmark we have (and we don't even run the one we do have)
instead this is a Deno version of the benchmark and i can't find anything
that uses this benchmark

This is also somewhat annoying to keep as something the Typescript Server
may decide to typecheck those files and it will complain no stop because
it can't find what `Deno` is and doesn't understand importing urls
2025-08-13 10:58:14 +02:00
Fleny f4eb8f1f67 build(deps): Update fastify in docker-apps/rest-passthrough (#4324) 2025-08-13 10:51:50 +02:00
Fleny 6ed7cfc8a8 build(deps): Migrate to React Flow v12 and update website dependencies (#4330)
* build(deps): Update dependencies in website

* Update reactflow to @xyflow/react
2025-08-13 10:39:15 +02:00