Commit Graph

270 Commits

Author SHA1 Message Date
Awesome Stickz
ad2a561ceb fix(types): make value of emoji property in DiscordButtonComponent and DiscordSelectOption partial (#4869)
* fix(types): make value of emoji property in DiscordButtonComponent and DiscordSelectOption partial

* fix: type error

* don't partial tranformer

* undo partial in EmojiToggles
2026-04-05 03:35:22 +05:30
Fleny
f29ab929fc fix: Update schema version in biome.jsonc (#4780)
* Update schema version in biome.jsonc

* Fix biome format errors
2026-02-17 04:21:50 +05:30
adam
70da0ac9ff feat(components): Add radio group, checkbox group & checkbox components (#4763)
* feat(components): implementation of the brand new modal component types Radio Group, Checkbox Group, Checkbox

* refactor(components): streamline checkbox component transformation and enhance type definitions

* Update packages/bot/src/transformers/reverse/component.ts

Co-authored-by: Fleny <Fleny113@outlook.com>

* Update packages/bot/src/transformers/reverse/component.ts

Co-authored-by: Fleny <Fleny113@outlook.com>

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

Co-authored-by: Fleny <Fleny113@outlook.com>

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

Co-authored-by: Fleny <Fleny113@outlook.com>

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

Co-authored-by: Fleny <Fleny113@outlook.com>

* Update packages/bot/src/transformers/reverse/component.ts

Co-authored-by: Fleny <Fleny113@outlook.com>

* Update packages/bot/src/transformers/reverse/component.ts

Co-authored-by: Fleny <Fleny113@outlook.com>

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

Co-authored-by: Fleny <Fleny113@outlook.com>

* refractor(component): transformation logic and update type definitions for options handling

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

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

* refractor(components): move types of new components below file upload to match discord docs

* Update packages/types/src/discord/components.ts

Co-authored-by: Fleny <Fleny113@outlook.com>

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

Co-authored-by: Fleny <Fleny113@outlook.com>

---------

Co-authored-by: Fleny <Fleny113@outlook.com>
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2026-02-17 03:27:39 +05:30
Fleny
3e35160504 fix(bot)!: Split DiscordSelectComponent into specific select components (#4690)
* refactor(bot)!: setup desired properties for all transformers

SetupDesiredProps when is given an object that does not corrispond to a transformer object that supports desired properties will behave like TransformProperty on the entire object as when it tries to get the properties for said object it will find `never` as the props and for `IsKeyDesired` a props of `never` means that all props are desired.

* Use Equals helper, clean up a bit the code

* Explicit the IsKeyDesired TProps never behavior

* fix(bot): Bug with return type in functions

* fix(bot)!: Split DiscordSelectComponent into specific select components

And add missing resolved property from the responses, since this now correctly transformers the responses, resolved has to be added.
The reverse transformer does not transform resolved as it requires a bunch of others, such as a user, role, message reverse transformers etc.

* Apply suggestions from code review

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2026-02-16 23:37:57 +05:30
Fleny
8939cc8492 fix!: Community invites updates (#4724)
* Update permissions for community invites

Use payload_json for invite creation with file upload

The TODO in INVITE_CREATE is to be done after #4436 gets merged as it splits the transformer logic between gateway and the normal invite object, placing the event transformation code in the event itself

* Community invites breaking changes
2026-02-16 23:20:42 +05:30
Fleny
a4a5f172d4 feat: update documentation links to new domain (#4767)
* feat: update documentation links to new domain

* fix some links in the docs
2026-02-16 07:46:51 +05:30
dependabot[bot]
cf26d35f29 build(deps-dev): bump @biomejs/biome from 2.3.13 to 2.3.14 (#4741)
* build(deps-dev): bump @biomejs/biome from 2.3.13 to 2.3.14

Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 2.3.13 to 2.3.14.
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.3.14/packages/@biomejs/biome)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-version: 2.3.14
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump @biomejs/biome from 2.3.13 to 2.3.14 in /website (#4749)

* build(deps-dev): bump @types/react from 19.2.8 to 19.2.13 in /website (#4750)

Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 19.2.8 to 19.2.13.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-version: 19.2.13
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Fleny <Fleny113@outlook.com>

* build(deps-dev): bump @biomejs/biome from 2.3.13 to 2.3.14 in /website

Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 2.3.13 to 2.3.14.
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.3.14/packages/@biomejs/biome)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-version: 2.3.14
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Fleny <Fleny113@outlook.com>

* Update biome schema version

* biome format --write

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Fleny <Fleny113@outlook.com>
2026-02-10 19:39:48 +01:00
Awesome Stickz
f2e8d7e9be fix(bot): use bigint instead of PermissionStrings[] for allow and deny in channel.permissionOverwrites to match Overwrite type (#4736) 2026-02-04 13:21:34 +01:00
Fleny
758e75f7d9 fix(bot): Bug with return type in functions (#4689)
* refactor(bot)!: setup desired properties for all transformers

SetupDesiredProps when is given an object that does not corrispond to a transformer object that supports desired properties will behave like TransformProperty on the entire object as when it tries to get the properties for said object it will find `never` as the props and for `IsKeyDesired` a props of `never` means that all props are desired.

* Use Equals helper, clean up a bit the code

* Explicit the IsKeyDesired TProps never behavior

* fix(bot): Bug with return type in functions
2026-01-29 00:36:39 +05:30
Fleny
cf02481086 refactor(bot)!: setup desired properties for all transformers (#4435)
* refactor(bot)!: setup desired properties for all transformers

SetupDesiredProps when is given an object that does not corrispond to a transformer object that supports desired properties will behave like TransformProperty on the entire object as when it tries to get the properties for said object it will find `never` as the props and for `IsKeyDesired` a props of `never` means that all props are desired.

* Use Equals helper, clean up a bit the code

* Explicit the IsKeyDesired TProps never behavior

* Add all trasformer objects to bot.transformers.$inferredTypes
2026-01-28 10:13:35 +05:30
Fleny
bd01ded6bf feat: Community Invites (#4685)
* api-docs: Community Invites

Add support for invites that gives roles to users.
Add support for target users on invites.

Sort-of unrleated change required: `restManager.makeRequest` `resolve` function had to changed or else the `getTargetUsers` would hang forever due to a JSON parsing issue.

* fix type error & add bot helpers
2026-01-27 19:08:08 +01:00
Fleny
4eccbea89f fix(rest)!: Remove calculateBits from changeToDiscordFormat (#4557)
* fix(rest)!: Remove calculateBits from changeToDiscordFormat

The rest manager currently has to assume that request bodies that have "permissions", "allow", "deny", "defaultMemberPermissions" fields are always meant as a permissions.
If these are not, for user error or future discord changes, this will break.

Also Discord expects these as strings, and discordeno does not abstract too much from the discord api, so it doesn't really makes sense for us to accept PermissionStrings[], the user should call calculateBits themselves, there is an argument to be made about accepting bigints since these are bitfields but that's another discussion.

* Channel.permissionOverwrites use PermissionStrings

For the transformed type we can keep the fact that it uses PermissionStrings

* Fix e2e test

* remove comment
2026-01-27 18:46:19 +01:00
Awesome Stickz
a794c2068a feat(bot): add interaction.sendFollowupMessage() (#4701)
* feat(bot): add interaction.sendFollowupMessage

* fix: sendFollowupMessage return type

Co-authored-by: Fleny <Fleny113@outlook.com>

---------

Co-authored-by: Fleny <Fleny113@outlook.com>
2026-01-22 17:43:47 +01:00
Awesome Stickz
8a2eb9594d feat(bot): add options.type to interaction.respond() (#4692) 2026-01-18 09:07:49 +01:00
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
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
1b9394244b api-docs: Guild Role Member Counts endpoint (#4628) 2026-01-07 13:55:42 -06:00
Louis Johnson
288904fef9 feat(user)!: add more getters for user transformer (#4661)
* feat: enhance user tag getter

* feat(user): add `0000` condition and better jsdoc for tag

* chore(user): use this keyword instead of destructuring assignment

* fix(user): correct isLegacy logic

* feat(images): add ImageOptions

* refactor(images)!: split avatarUrl into more specific functions and add displayAvatarUrl

* feat(user)!: add more useful getters for user

* fix: update tests for images

* chore: using n suffix for bigint instead of converting to bigint

Co-authored-by: Fleny <Fleny113@outlook.com>

* fix: update dependencies for avatarUrl

Co-authored-by: Fleny <Fleny113@outlook.com>

* fix(user): correct the avatarUrl second parameter to avatar hash

Co-authored-by: Fleny <Fleny113@outlook.com>

* chore: undo unnecessary // from auto comment hotkey

Co-authored-by: Fleny <Fleny113@outlook.com>

---------

Co-authored-by: Fleny <Fleny113@outlook.com>
2025-12-31 17:46:11 +01:00
Louis Johnson
624364e759 feat(user)!: enhance user tag getter (#4652)
* feat: enhance user tag getter

* feat(user): add `0000` condition and better jsdoc for tag

* chore(user): use this keyword instead of destructuring assignment

* fix(user): correct isLegacy logic
2025-12-23 17:24:01 +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
Fleny
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
Fleny
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
Fleny
bbdd2d1183 fix(types): update message.resolved description (#4511)
Co-authored-by: Link <link20050703@gmail.com>
2025-10-21 14:57:00 -07:00
Fleny
df8cc46882 fix(types,bot): Update channel.permissions description (#4513) 2025-10-06 18:16:22 +02:00
Fleny
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
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
Fleny
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
Fleny
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
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
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
Fleny
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
Fleny
b7db305dee refactor: Use TransformerFunction to define transformers (#4402)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-26 10:56:43 -07:00
Fleny
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
590653f572 fix(bot): Remove VOICE_STATE_UPDATE payload check (#4389) 2025-08-22 21:37:26 +02:00
Fleny
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
Fleny
27e53b801a fix(types)!: Fix discordeno/user.ts (#4365)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-20 11:11:14 -07:00
Fleny
fca0b40be5 feat(bot)!: Make desiredProperties required (#4381)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-17 13:01:58 -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
ed85fe9a5f chore(bot): Remove incorrect joinedAt (#4376)
Co-authored-by: Link <link20050703@gmail.com>
2025-08-17 09:00:37 +02:00
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
84087917ef fix(types)!: Fix discordeno/channel.ts (#4355) 2025-08-15 22:09:56 -04:00
Link
8b41c9fe24 feat(bot,rest,types)!: Remove Discord JSON Params (#4351)
- Remove `createApplicationCommand` reverse transformer (Unused - `createGuildApplicationCommand` and `createGlobalApplicationCommand` use `snakelize`)
- Remove `DiscordModifyChannel`, `DiscordFollowAnnouncementChannel`, `DiscordCreateForumPostWithMessage`, `DiscordCreateGuildEmoji`, `DiscordModifyGuildEmoji`, `DiscordCreateGuildChannel`, `DiscordModifyGuildChannelPositions`, `DiscordCreateApplicationCommand`, `DiscordCreateMessage`, and `DiscordCreateWebhook` (unused)
- Remove `DiscordModifyGuildWelcomeScreen` (and replace it with `ModifyGuildWelcomeScreen`)

Fixes: https://github.com/discordeno/discordeno/issues/4308
2025-08-15 13:35:25 -04:00
Link
8baea8c771 feat(bot,rest,types): Add withLocalization (#4350)
- Add `withLocalization` to `getGlobalApplicationCommands` and `getGuildApplicationCommands`

fixes: https://github.com/discordeno/discordeno/issues/4340
2025-08-15 08:20:29 +02:00
Fleny
9de5d93014 feat(bot): Add guildId to ThreadMember (#4335) 2025-08-14 19:21:22 -07:00