Commit Graph
70 Commits
Author SHA1 Message Date
Fleny e12142daf6 Use %20 instead of ' ' for joining scopes (#3709) 2024-07-06 15:56:48 -05:00
Fleny 39b18a1682 Use bot.transformers.emoji in handleGuildEmojisUpdate (#3704) 2024-07-06 19:12:54 +00:00
008834d389 docs: Reaction roles bot example (#3361)
* Update docusaurus typescript setup for v3

And fix lint-staged and eslint

* Enable automatic JSX runtime

* Remove babel config and dependencies

* update yarn.lock

* add typecheck to site workflow

* update typedoc config

* downgrade docusaurus packages

* Update site.yml

* Type context and options in webpack-docusaurus-plugin.ts

* Add reaction-roles code from docs example

* Finish /roles reactions create command, missing event handler

* Add handler for the role buttons

* Initial update to reactionroles.md

+ code changes accordingly

* Finish reactionroles.md file

* Corrections to reactionroles.md

* update deps & add --strip-leading-paths to swc

* Add a note for the possibile ratelimit on command upsert

* Update website/docs/examples/reactionroles.md

Co-authored-by: LTS20050703 <lts20050703@gmail.com>

* Apply suggestions from code review

Co-authored-by: LTS20050703 <lts20050703@gmail.com>

* Update website/docs/examples/reactionroles.md

Co-authored-by: LTS20050703 <lts20050703@gmail.com>

* Use a register-commands.ts for app commands

* Apply suggestions from code review

Co-authored-by: LTS20050703 <lts20050703@gmail.com>

* Update for the latest version of discordeno

Also add the tsconfig for the reaction roles example as i forgot it and was using the root dir one

* Update deps, add typescript as dev deps, add .swcrc

---------

Co-authored-by: Matt Hatcher <3768988+MatthewSH@users.noreply.github.com>
Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
Co-authored-by: LTS20050703 <lts20050703@gmail.com>
2024-07-06 17:37:33 +00:00
FlenyandSkillz4Killz 5cccaeaf06 fix(rest)!: Fix Basic OAuth2 queues and add method for updating the queues and ratelimit paths after a refresh (#3185)
* fix basic auth requested

* Change queue keys to "{auth}{url}"

* add updateTokenQueues method

* Fix unit tests

* removed interval check for queue clear | needs testing

* hide tokens in debug logs

* Fix 429 & 401 requests, rename queueBaseKey to requestAuthorization

* fix unit tests

* Add proxy.updateBearerTokenEndpoint option

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2024-07-06 17:30:03 +00:00
Fleny 92bf16645a PurchaseNotification message type (#3656) 2024-06-12 15:39:06 +00:00
Fleny f6a42b966a Add USE_EXTERNAL_APPS permission (#3658) 2024-06-12 15:38:17 +00:00
FlenyandAwesome Stickz ad7e74c4cd feat(bot,types)!: Replace userId with User object in interactionMetadata (#3627)
* Replace userId with User object in interactionMetadata

* Fix type error

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2024-05-26 19:36:48 +00:00
FlenyandAwesome Stickz 5290078044 fix(bot,types,utils)!: change avatar decoration url link (#3621)
* Change the avatarDecorationUrl link

* Add User#avatarDecorationData & Member#avatarDecorationData

* Fix type error

* Fix format error

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2024-05-26 19:14:11 +00:00
Fleny 226e3de43e Add auditlog events for onboarding (#3616) 2024-05-26 19:05:53 +00:00
Fleny 7a0d730b1b docs(types): Update some documentation of the options for slash commands (#3619)
* Update some documentation of the options for slash commands

* Update comments
2024-05-26 19:00:46 +00:00
Fleny c6ca749a4f Add botBannerURL to edit current bot banner (#3620) 2024-05-26 18:58:17 +00:00
Fleny f8f976acf4 Add reason to followAnnouncement (#3622) 2024-05-26 18:51:00 +00:00
FlenyandAwesome Stickz 163cebdcd0 Add the poll object to the message transformer (#3624)
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2024-05-26 18:49:05 +00:00
Fleny e33b44e5e5 Add domain connection service type (#3623) 2024-05-26 18:41:11 +00:00
Fleny c570a881cf fix(utils): Use media.discordapp.net for gif stickers (#3625)
* Use media.discordapp.net for gif stickers

And add Gif to StickerFromatTypes as it was missing

* remove return undefined, use return
2024-05-26 18:39:42 +00:00
47d0cea664 feat(bot,rest,types): Add support for one-time entitlements (#3626)
* Add support for one-time entitlements

* Add comment to consumeEntitlement route

Co-authored-by: LTS20050703 <lts20050703@gmail.com>

* Check for undefined instead of falsy values in consumed for entitlements

Co-authored-by: LTS20050703 <lts20050703@gmail.com>

---------

Co-authored-by: LTS20050703 <lts20050703@gmail.com>
Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2024-05-26 18:38:48 +00:00
FlenyandLTS20050703 541dc3b0cf feat(bot,types): Add MessageCall (#3628)
* Add message#call

* Update message transformer for message calls

Co-authored-by: LTS20050703 <lts20050703@gmail.com>

---------

Co-authored-by: LTS20050703 <lts20050703@gmail.com>
2024-05-26 18:07:45 +00:00
8e011210e2 feat(docs): Add getting-started with installation (#3557)
* Add getting-started with installation

* Add minimal example, and helpers and desired proprieties explanation

* Add comment on helper example usage

* fix small grammar error

* Fix GuildMessages being without the Intents. before

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

* Apply code suggestion

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

* Apply suggestions from code review

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

* fix: typo

* remove todo

* Apply suggestions from code review

Co-authored-by: LTS20050703 <lts20050703@gmail.com>

* Remove useless parenthesis

* Apply code review suggestion

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
Co-authored-by: LTS20050703 <lts20050703@gmail.com>
2024-05-24 05:09:35 +00:00
Fleny d0d810dfb5 Remove bot token from the shards logs (#3558) 2024-05-11 14:44:17 +00:00
Fleny a361a53d57 Add poll transformer export (#3550)
& fix a typedoc warning for the oauth2 func
2024-05-06 07:40:08 +00:00
FlenyandMatt Hatcher 687c29dd7a feat(bot,rest,types,utils): Support User-Installed apps, Interaction contexts and install types (#3502)
* Support integrationTypesConfig in Application

* Add support for commands with integrationTypes and contexts

And deprecate the dmPermission boolean, it is being replaced by contexts

* Update contexts comment to make it more clear

* User-Installed apps

* Add integrationType oauth parameter

fixes #3517

* Add null to contexts

closes #3523

* Mark oauth2 install params as nullable

closes #3525

* Fix typescript errors

* Add preview notices

---------

Co-authored-by: Matt Hatcher <3768988+MatthewSH@users.noreply.github.com>
2024-04-29 15:36:29 +00:00
Fleny c411076261 Fix bump script ignoring some @discordeno deps (#3547) 2024-04-29 15:34:42 +00:00
FlenyandLTS20050703 6ad4e1d2e8 feat(bot,rest,types): Add polls support (#3542)
* Add polls support

* Add default for limit on GetPollAnswerVotes

* Apply code rewiew suggestion

Co-authored-by: LTS20050703 <lts20050703@gmail.com>

---------

Co-authored-by: LTS20050703 <lts20050703@gmail.com>
2024-04-28 11:42:19 +00:00
Fleny 75332eecda Add bulk ban (#3543) 2024-04-28 10:50:02 +00:00
Fleny dfa1514577 Update comment for permissions needed when pruning members (#3503) 2024-04-18 09:24:43 +00:00
Fleny 3e99aba7e9 Add bungie discord connection (#3526) 2024-04-18 09:19:02 +00:00
Fleny 06e8ec3888 Add a negative lookahead to prevent .json to be changed (#3536)
This was breaking the REST manager as the fetch() Response object uses a .json method to get the JSON body
2024-04-18 09:06:55 +00:00
Fleny efe56fbe06 feat(bot, rest, gateway, utils): Add support for custom loggers (#3383)
* Add support for custom loggers

* update docs for loggerFactory

* Use union for names in the bot logger factory

* Fix formaating errors
2024-03-17 11:22:45 +00:00
Fleny c5337508fe Check for multipart bodies and handle them (#3481)
Also bump @discordeno/rest
2024-03-17 03:44:58 +00:00
Fleny 2002a2bd6e feat(rest): Improve rest errors (#3382)
* Improve rest errors

* formatting
2024-03-08 04:42:49 +00:00
FlenyandMatt Hatcher edbb134efa docs: Update contributing docs (#3386)
* Update docusaurus typescript setup for v3

And fix lint-staged and eslint

* Enable automatic JSX runtime

* Remove babel config and dependencies

* update yarn.lock

* add typecheck to site workflow

* update typedoc config

* downgrade docusaurus packages

* Update site.yml

* Type context and options in webpack-docusaurus-plugin.ts

* Update contributing docs

remove howToUseTurborepo.md
update devcontainer
update task to remove error matcher
remove useless packages/rest/src/README.md
remove readme.hbs

* Add notice for the clean build

---------

Co-authored-by: Matt Hatcher <3768988+MatthewSH@users.noreply.github.com>
2024-03-08 04:40:27 +00:00
Fleny 46c93385c1 Update interaction helpers (#3465) 2024-03-07 22:35:55 -06:00
FlenyandMatt Hatcher 43d52a6c43 docs: Add examples for Node.js and Bun, update Deno example (#3385)
* Update docusaurus typescript setup for v3

And fix lint-staged and eslint

* Enable automatic JSX runtime

* Remove babel config and dependencies

* update yarn.lock

* add typecheck to site workflow

* update typedoc config

* downgrade docusaurus packages

* Update site.yml

* Type context and options in webpack-docusaurus-plugin.ts

* Update env tips and add minimal examples for node and bun

And update the one from deno that was really out of date

---------

Co-authored-by: Matt Hatcher <3768988+MatthewSH@users.noreply.github.com>
2024-02-25 01:41:44 +00:00
Fleny cee79197e6 Add enforceNone (closes #3431) (#3432) 2024-02-21 14:07:56 +00:00
Fleny 262e6cee7e Add SUPPRESS_NOTIFICATIONS to InteractionCallbackData.flags (#3448) 2024-02-21 13:57:56 +00:00
FlenyandMatt Hatcher f0ac958903 chore(website): Cleanup docusaurus setup (#3355)
* Update docusaurus typescript setup for v3

And fix lint-staged and eslint

* Enable automatic JSX runtime

* Remove babel config and dependencies

* update yarn.lock

* add typecheck to site workflow

* update typedoc config

* downgrade docusaurus packages

* Update site.yml

* Type context and options in webpack-docusaurus-plugin.ts

---------

Co-authored-by: Matt Hatcher <3768988+MatthewSH@users.noreply.github.com>
2024-02-09 20:34:59 +00:00
Fleny 5cb9b76e65 fix(rest): Add support for getGuilds with bot token (#3360)
* Add support for getGuilds with bot token

* Update manager.ts

* Fix prettier error
2024-02-09 18:45:27 +00:00
Fleny 493f4d15e9 Use helpers in interaction methods (#3395) 2024-02-09 17:58:13 +00:00
Fleny 617d41f873 Update locales (#3421)
closes #3420
2024-02-08 22:14:19 +00:00
Fleny 05ccdd9a9b fix(bot): Review checks to prevent JS from excluding values that might be useful (#3188)
* Explicitly check for null or undefined

* fix formatting error

This file isn't even modified by this pr, but ok

* revert checkIfExists, manually review each case

* Update for the RoleFlags and AttachmentFlags

* Fix need for TS bang (!)

* update invite transformer

* update invite transformer

* fix consistency
2023-12-22 05:06:24 +00:00
Fleny e2a34082bc move rtt calculation to HeartbeatACK op code event (#3334) 2023-12-21 17:50:40 +00:00
FlenyandSkillz4Killz d81b28a24b Update help wanted label name (#3262)
Update the label name in the stale action

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-12-07 03:19:23 +00:00
Fleny 721b8a82f6 Fix the TS error in transformers benchmark (#3261) 2023-12-07 00:28:38 +00:00
Fleny 0af084d932 feat: api docs catchup part 2 (#3266)
* add guild safety | closes #3020

* Adds approx guild count | closes #3078

* Team member permissions | closes #3105

According to current documentation DiscordTeamMemberRole#Owner does not have a value anymore, in this commit it still had so it is included to be changed by a later commit

* Default thread ratelimit | closes #3216

* Entitlements and SKUs | closes #3219

The entitlements events needs testing for the typing

* Typing endpoint docs update | closes #3222

* Add guildScheduledEventId to CreateStageInstance | closes #3228

* Add listSkus helper

I did forget it in the commit before

* Update Application Endpoints | closes #3230

* Update documentation | closes #3233

* fix starting a thread in forum | closes #3234 & closes #3036

* Add fired events on get widget endpoint | closes #3235

* Add fired events on get widget endpoint pt2 | closes #3236

* Update SKU and Entitlement fields | closes #3238

* Split permissions for expressions and events | closes #3249

* Make GetEntitlements#excludeEnded more specific | closes #3251

* Fix thread/forum channel docs regression | closes #3252

* Another description change for GetEntitlements#excludeEnded | closes #3253

* Document applied_tags on Execute Webhook | closes #3265

* Fix entitlement event types
2023-12-06 16:18:29 +00:00
Fleny fb947f5672 feat(bot,rest,types): Add support for guild onboarding (#3260)
* Add types from api-docs-commit related to #2930

* Add rest from api-docs-commit related to #2930

* Add types from api-docs-commit related to #3072

* Add rest from api-docs-commit related to #3072

* Add types from api-docs-commit related to #3247

* Add transformers and helpers
2023-12-04 22:16:33 +00:00
Fleny c56bb063cb Add missing image url function (#3259)
Exceptions:
- Achievement Icon and Store Page Asset - Game SDK
- Guild Member Banner - Doesn't have documented the banner asset hash
- User Avatar Decoration - Already included in #3257
2023-12-04 19:12:34 +00:00
Fleny 53d2bb6675 Fix resolution error for prettier (#3258) 2023-12-04 14:09:05 +00:00
Fleny b567c1317d Update stale action config (#3198)
Exclude issues that have the `api-docs-commit`  or the `[HELP WANTED] good first issue` label and run the action once a week
2023-12-01 20:57:37 +00:00
Fleny c22a67b588 Explitly sort the code actions (#3183) 2023-11-19 18:24:57 +00:00
Fleny eb6dd978ed fix LeakyBucket to handle refills, queue process (#3159) 2023-10-28 12:51:06 +00:00
Fleny c0615a2983 refactor(gateway)!: Remove guildMemberChunk shard event (#3151)
* Remove guildMemberChunk shard event

* use DiscordMemberWithUser for requestMembers
2023-10-18 22:21:46 +00:00
Fleny 895b482a02 Add option for the header of auth on rest proxy (#3153) 2023-10-18 22:21:22 +00:00
Fleny f98bb9bf75 fix(rest)!: Update OAuth2 to use the Basic authentication (#3150)
* update exchangeToken and revokeToken to use header

* update helpers file for the new signature
2023-10-15 04:32:04 +00:00
Fleny a8f9e5ec1b feat: allow for custom function to send the payload to shards (#3149)
* Initial work for sendPayload

* fix docs comment
2023-10-15 04:30:58 +00:00
Fleny 730ad9a3dc Add interactionDataOptions customizer (#3146) 2023-10-06 03:54:48 +00:00
Fleny 832df1697a feat: add support for more customizers (#3139)
* feat: add support for customizers

* Fixing typescript build errors

* add customers for transformGatewayBot

and transformThreadMemberGuildCreate customizers and transformer
2023-10-01 17:03:08 +00:00
Fleny 15a7899a28 Add default_values support for SelectMenu (#3144) 2023-09-30 19:50:10 +00:00
Fleny 42873982a2 Use desiredProperties in transformAttachment (#3134)
* Use desiredProperties in transformAttachment

* remove not necessary payload checks

* add checks for payload
2023-09-21 14:05:28 +00:00
Fleny b1a47394a3 Use desiredProperties in transformEmoji (#3133)
* Use desiredProperties in transformEmoji

* remove not necessary payload checks

* add checks for payload
2023-09-21 14:05:11 +00:00
Fleny 39a4c07fac Use desiredProperties in transformScheduledEvent (#3132)
* use desiredProperties in transformScheduledEvent

* add checks for payload
2023-09-21 14:04:51 +00:00
Fleny 59c320beaa Use desiredProperties in transformStageInstance (#3131)
* Use desiredProperties in transformStageInstance

* add checks for payload
2023-09-21 14:04:32 +00:00
Fleny 1341fe0581 Use desiredProperties in transformSticker (#3130)
* Use desiredProperties in transformSticker

* add checks for payload
2023-09-21 14:04:16 +00:00
Fleny a5d23b4924 Use desiredProperties in transformWebhook (#3129)
* Use desiredProperties in transformWebhook

* add checks for payload
2023-09-21 14:03:49 +00:00
Fleny cb4f097510 Use desiredProperties in transformGuild (#3128)
* Use desiredProperties in transformGuild

* join channels and threads, make threads a getter

* remove not necessary payload checks

* readd the payload checks, add missing ones

This reverts commit b12e3f09cb.
2023-09-21 14:02:43 +00:00
Fleny d75a3facc5 Use desiredProperties in transformInvite (#3127)
* Use desiredProperties in transformInvite

* remove not necessary payload checks

* add checks for payload
2023-09-21 13:52:39 +00:00
FlenyandSkillz4Killz a7d645ec4b feat: Implement OAuth2 endpoints (#3114)
* add OAuth2 routes

* Add oauth2 methods to rest

* Add rest manager methods, Add token params

* Add authorization headers

* Add auth to editUserApplicationRoleConnection

* fix logging header always displaying bot as auth

* Add OAuth2Scope enum

* Start testing ratelimit handling

* Fix now scopes are separated by a space

* move webhook object to DiscordAccessTokenResponse

* convert payload to snake_case

* fix some typings

* more types fixes

* add support for upserting commands with tokens

* handle correctly ratelimit and concurrently

* add guild to DiscordAccessTokenResponse

* Add oauth2 create link function

* Fix removeTokenPrefix to support Bearer tokens

* update jsdoc comment for removeTokenPrefix

* fix removeTokenPrefix unit tests

* fix see link on getMember and getCurrentMember

* add bot helpers and fix some types

* Use objects to pass the bearer tokens

* fix Deno issue with Buffer.from

* Merge 'upstream/main' into feat/oauth2 to fix merge conflict

* Fix debug queue logging

* keep only 1 route for current user

* add Bearer prefixed url to the rest of the logs

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-09-19 16:23:22 +00:00
Fleny a087a52d6f Fix(rest) Fix error when serializing payload with a BigInt (#3117)
* Fix error when serializing payload with bigint

* add comment for reason of changeToDiscordFormat
2023-09-08 14:48:47 +00:00
Fleny 1e8edb99c6 bug(rest) Invert unauthorized check (#3104) 2023-08-24 17:21:17 +00:00
Fleny 6bcb529f9a Bug(utils) Fix bucket refill after the first time (#3097)
* bug(bucket) Fix LeakyBucket refill

* Fix formating
2023-08-08 16:37:41 +00:00
Fleny e70a1788f5 Bug(gateway) Fix fetch of discord gateway session information (#3098)
* bug(gateway) Remove update createBot options

Add overrides when fetching discord session info

* Use createBot options instead of defaults
2023-08-05 18:31:35 +00:00