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>
* 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>
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
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
* 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
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>
* 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>