* Split extra fields into their own types
For now they are added back to the types they belong to to avoid
breaking in this pr
* fix type errors
* Fix typo 1
Co-authored-by: Link <lts20050703@gmail.com>
* Fix typo 2
Co-authored-by: Link <lts20050703@gmail.com>
* Use omit and not partial on guild voice_states
Co-authored-by: Link <lts20050703@gmail.com>
* Remove unused `ts-expect-error`
---------
Co-authored-by: Link <lts20050703@gmail.com>
* feat(types): Add new rich presence url & status display type fields
* Update packages/types/src/discord/gateway.ts
Co-authored-by: Link <lts20050703@gmail.com>
* Use examples in DiscordStatusDisplayType
---------
Co-authored-by: Link <lts20050703@gmail.com>
They exited in the types but didn't in the runtime object causing a runtime error when the code needed to transform a nameplate
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Update docusaurus to v3.8, improve performance
Docusaurus:
- Update to v3.8.0
- Enable new faster features, rspack bundler cache and worker threads
- Update CI to cache rspack bundler cache
- Update dependencies to latest versions
- Update blog posts to use the truncate tag
- Update caniuse-lite
Removed duplicated type documentation generation for bot package
* Use .jsonc files for typedoc
And use the readme option instead of a custom script
* remvoe typedoc script
---------
Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
* Use DesiredPropertiesError instead of strings
Using an object allows typescript to error in more cases as with strings
if the original propriety was a string it would not error for stuff like
`.endsWith(...)`
We use a symbol to make sure the type doesn't actually become a generic
object, but instead is a specific type that can be checked against.
* Update docs
* Spawn one shard at a time
* remove useless code in ShardIdentified handling
* update comment on tellWorkerToIdentify
* fix mistake
* Use request identify
This also makes some unrelated changes needed to make the example
comple when using the build from this branch.
* remove debug logs
The limit is still in place however it is 40 total,
so it is a bit more complicated to explain and the discord docs
are better at doing so than what we can do with JSDoc
* Remove incorrect, reorder and fixes in channel
- Updated comments to be more clear
- Remove `Channel.newly_created`, doesn't seem to exist in the api docs
- Fix nullability for some fields
- Remove DiscordActiveThreads, DiscordArchivedThreads and DiscordListActiveThreads as they don't seem to match anything in the api
* Add back DiscordListActiveThreads but under Guild
and fix type errors
* Update packages/types/src/discord/channel.ts
Co-authored-by: LTS (Link) <lts20050703@gmail.com>
* Revert newly_created removal
* Apply suggestions from code review
Co-authored-by: LTS (Link) <lts20050703@gmail.com>
---------
Co-authored-by: LTS (Link) <lts20050703@gmail.com>
* Update Slash Command Command Name regex
* Update comments to reflect the change
* Use the correct apostrophe in the regex
While the docs use the regular ', discord accepts
the unicode apostrophe ʼ.
* Add lobby support
* Fix CI
Apparently for extends a bot was a LobbyMember since both had
a required id property and even if LobbyMember had other properties
as well that did not matter
* update LobbyMember flags to use ToggleBitfield
While discord does not say anything explicit about deprecating the
createGuildFromTemplate endpoint, it is a fair assumption to make that
it is included in this change
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Fix optionals for some props in autoModeration.
Also fix some comments to be more clear
* Fix type error in automodActionExecution
* Fix type error in automod.spec.ts e2e test
---------
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Keep state to avoid unwanted disconnections
This keeps a state to know that we wanted to end the connection with a
code of 1000 or 1001 to avoid unwanted disconnections in case discord /
someone in the middle of the TCP connection (such as cloudflare) sends a
close code of 1000 or 1001.
* Apply suggestions from code review
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
---------
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Use mocha for both deno and bun
* Use any Bun 1.1
* remove build:type dependency in lib-check.yml
* Pin point 1.1.42
* remove packages/bot/.mocharc.json
* Remove TBot, Use SetupDesiredProps
* Remove even more clutter from intellisense
* Use type instead of interfaces for some types
This avoids the need for mapped types in Bot
* docs: add info about removing ts clutter to desired props guide
* docs: improve ts clutter section in desired props guide more
---------
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Fix type errors when using commandOptionsParser
* remove export from TransformProperty
* use TransformProperty in InteractionResolvedData
* Fix CI
* Remove the union on GetErrorWhenUndesired
* Rework the test for urlToBase64.
Currently urlToBase64 used the website logo however with #3990 the test
started failing as the logo changed so the base64 of it changed.
The test now mocks fetch() to return 8 empty bytes and checks for that
base64 string instead
* test: explicity import beforeeach and aftereach
* test: stub depend on runtime
* test: use try catch instead
* test: try itoh typeof
---------
Co-authored-by: H01001000 <heiheiho000@gmail.com>
* Update docs for desired properties
* Update examples to use createBot desiredProperties
The BigBot and reaction roles examples use the Discordeno CLI
* Migrate examples to v19 stable
* Docs work
* Add type helpers for typeLevel based desired props
This also fixes / added a few stuff that was missing in exiting
types & transformers, however due to this a few transformers got a
breaking change due to the need to pass down the shardId
* Fix benchmark type error
* Add the generics to createBot / Bot / ..
This caused a lot of breaking changed due to the required generics on a
bunch of types
* Fix benchmark type error?
* Fix benchmarks type error
* Fix E2E test type error
* remove defaultDesiredPropertiesValue
* Remove `internal` jsdoc from CompleteDesiredProprieties
* Add tests for createDesiredPropertiesObject
* Fix interaction.bot type
* Remove Capitalize type helper
It is already built-in into typescript as an intrinsic
* Fix typo
* Update message on missing desired properties
* Fix CI
* Move infer types to 'transformers.$inferredTypes'
* Fix CI
* Fix CI, again
* Use GatewayHandlers in params of create function
* change default behavior to remove key
* Fix CI
* fix types for e2e test