* 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.
* feat(transformers)!: Handle partials in transformers
* Add expiresAt to invite create event
* Use Equals helper, clean up a bit the code
* Explicit the IsKeyDesired TProps never behavior
* Fix type errors
* format
* Add all trasformer objects to bot.transformers.$inferredTypes
* Use transfromerInformations for bot.transformers.$inferredTypes
* code review
* code review
* fix component transformer
* fix
* Update packages/bot/src/transformers/types.ts
* Fixes from Tri (+ GPT sol) code review
---------
Co-authored-by: Link <link20050703@gmail.com>
* refactor(rest)!: rename rest.editBotMember() to rest.editCurrentMember() to be consistent with rest.getCurrentMember()
* refactor(type)!: rename ModifyCurrentMemberOptions to ModifyCurrentMember to be consistent with other types
* fix(types): make value of emoji property in DiscordButtonComponent and DiscordSelectOption partial
* fix: type error
* don't partial tranformer
* undo partial in EmojiToggles
* 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>
* 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
* 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
* 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
* 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
* 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
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.
* 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>
* 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(components): File upload component for modals
* Update comments
upstream has been merged into the file uploads pr
* reverse transform, comment typo fix
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>
* 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>