* 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
* Attempt to fix shard reconnecting in a loop
* Add a bit of logging on READY & RESUMED
* Fix integration tests
* Revert turbo.json change
* Pass down the logger to LeakyBucket on HELLO
* Update some logs
---------
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Add webhook events types
We will not support all the signing part for the handling of http
requests, however we do still provide the types for these requests
* Apply suggestions from code review
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Use union on DiscordEventWebhookEventBody data
---------
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Add zlib-stream transport-compression support
* remove external buffer, add the url param
this also fixes the CI Deno error
* use a queue and promises
instead of calling handleDiscordPacket from the callback of inflate.on('data')
* Add zstd support
* Re-add payload compression, set fzstd as optional, refactor
* add comment for decompressionPromisesQueue
* fix comment for isCompressed
* Don't create a new Uint8Array if the input is a Buffer
* Use a Uint8Array buffer instead of parsing incomplete JSON chunks
* remove old commented code
* Change ts expect error message
* use type import for ShardGatewayConfig
* Apply suggestions from code review
Co-authored-by: LTS (Link) <lts20050703@gmail.com>
---------
Co-authored-by: LTS (Link) <lts20050703@gmail.com>
* Update website deps, remove 1s load time
* Run biome migrate
* Test without terser plugin
* Do not always default to MDX
* remove webpack terser plugin
* Add some exclusions to website/tsconfig
* Use the native WebSocket implementation when available
* merge types.js import in shard
* Apply suggestions from code review
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Do not use the WebSocket global on Node
---------
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Use a _ check instead of the manual one on the switch
* invert the check, as the current one is wrong
* move the check to before indexing the object
---------
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Add env to test:e2e turbo task
Turbo in v2 does not pass down the environment variables unless manually specified (by default)
* use the correct env name for the test guild
* Improve logging, keep shard collections separated
* revert to erroring in getSessionInfo. Fill the value in createBot
* removed useless if
* remove same number of shards check
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Update manager.ts
* revert shard.events.message assignment for the spread
* use new Collection instead of .clear() + for-of
* Use fixed formula and note in the comment the inaccuracy
* Apply suggestions from code review
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
* Add a remark to shardsFullPercentage to let the user know of the inaccuracy
* Update comment and add a clearInterval
The clearInterval is not strictly needed, however it is better to ensure there is always one and only one internal running at a given point
* revert check for all shards online
It was bugged as gateway.resharding.shards gets populated overtime and not instantly
---------
Co-authored-by: Awesome Stickz <awesome@stickz.dev>