Commit Graph
100 Commits
Author SHA1 Message Date
ITOH 7b5d99e5dd refactor(rest): interaction handling (#2944)
* refactor(rest): interaction handling
Currently some interaction handling uses `sendRequest` directly.
This adds the `runThroughQueue` option, which prevents the request to be handled by a queue effectively giving the same effect as using `sendRequest` directly.
This prevents code repetition and supports future endpoints which might not have a rate limit too.

Further more all interaction related endpoints have now been set to not send the bots authorization header.

* fix invalid file

* fix eslint

* fix: followups have a rate limit

* fix awaiting
2023-04-02 16:27:48 +00:00
ITOH 66869ce00b refactor(utils)!: remove unused files utility (#2945)
Since we have changed how files get send to the rest proxy, we do not need this utility anymore.
2023-04-02 16:21:48 +00:00
ITOH 1cb1b09460 refactor!(rest): rest proxy attachment sending (#2924)
* refactor!(rest): rest proxy attachment sending
Currently attachments get encoded as base64 before being send to the proxy. This is not really necessary, instead we can just send `FormData` to the proxy.

* fix lint
2023-04-02 15:43:08 +00:00
ITOH 17a52fec1b fix(rest, types)!: support auditlog reason (#2940)
* fix(rest, types)!: support auditlog reason
Improved the consistency by separating the audit log reason to an optional function parameter.
Also added support for 100% documented reason endpoints.

* missing stuff

* fix this

* fix e3e
2023-04-02 15:38:06 +00:00
ITOH 92e25959ef build: update turbo (#2942) 2023-04-02 15:29:15 +00:00
ITOH 7b0964d24a fix(README): dd logo path (#2943) 2023-04-02 15:20:26 +00:00
ITOH 56946047c1 fix(README): dd logo path (#2941) 2023-04-02 15:38:08 +02:00
ITOH bb5e15d808 trigger tests 2023-04-02 15:30:26 +02:00
ITOH 6359972e38 docs(rest): webhook names cannot contain 'discord' (#2936)
Closes: https://github.com/discordeno/discordeno/issues/2928
2023-04-01 19:18:59 +00:00
ITOH bcfeb5b6ae feat(bot,types): add Guild.maxStageVideoChannelUsers (#2935)
Closes: https://github.com/discordeno/discordeno/issues/2927
2023-04-01 19:18:26 +00:00
ITOH 6890b34d84 feat(types)!: add guild expression & view monetization permissions (#2934)
Closes: https://github.com/discordeno/discordeno/issues/2926
2023-04-01 19:16:14 +00:00
ITOH 92ba532e6c style: fix helix language formatting 2023-04-01 14:16:59 +02:00
ITOH 05fc3fbeba style: format (#2925) 2023-04-01 02:46:46 +02:00
ITOH f6a9d96ab2 feat(types): add ApplicationFlags.ApplicationAutoModerationRuleCreateBadge (#2921)
Closes: https://github.com/discordeno/discordeno/issues/2920
2023-03-31 20:53:09 +00:00
ITOH 6120c79c3c ci: add name to labeler workflow (#2922) 2023-03-31 20:51:19 +00:00
ITOH f5abd83cc5 fix(bot,rest,types)!: attachment sending (#2917)
* fix(bot,rest,types)!: attachment sending

* apply code suggestions

* forgot to add that

* this should not be there i guess

* maybe spell it right

* actually revert the attachments rename

* Change how method gets passed

* more stuff

* improve function name
2023-03-31 20:50:53 +00:00
ITOHandJonathan Ho 65f60af35e ci: move tests into one single workflow file (#2911)
* try

* remove lint

* ci: run checks for pushes only to the main branch

* fix readme

---------

Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
2023-03-30 19:36:58 +00:00
ITOH f41fe4dbb5 ci: add automatic pr labeler (#2912)
* ci: add automatic pr labeler

* ci: add specific pr target types for the labeler
2023-03-30 19:34:38 +00:00
ITOH 678063993a Delete docs directory 2023-03-30 20:58:16 +02:00
ITOH 1093befcad fix(website): move to new url (#2914) 2023-03-30 18:09:02 +00:00
ITOH 84396492a6 fix(website): CNAME (#2913) 2023-03-30 18:08:25 +00:00
ITOHandJonathan Ho d757773e95 perf(rest): remove regex check from RestManager.simplifyUrl (#2910)
Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
2023-03-30 10:05:01 -05:00
ITOHandJonathan Ho 4fe621ef76 fix(utils): leaky bucket slow refill test (#2907)
* fix(utils): leaky bucket slow refill test

* fix the fix

* remove left comments

* Update packages/utils/tests/bucket.spec.ts

Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>

---------

Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
2023-03-30 09:54:37 -05:00
ITOHandSkillz4Killz fdf0d53f9e refactor(rest)!: improve RestManager.createRequest (#2906)
* refactor(rest): simplify `manager.simplifyUrl`
The changes improve readability and performance by a small margin.

* refactor(rest)!: improve `RestManager.createRequest`
- AuditLog Reasons: options.body.reason => options.reason
- options.body can now be FormData

* forgot those

* suggestions

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-03-30 09:54:02 -05:00
ITOH 7fae8c0315 refactor(rest): simplify manager.simplifyUrl (#2905)
* refactor(rest): simplify `manager.simplifyUrl`
The changes improve readability and performance by a small margin.

* fix tests
2023-03-29 22:35:17 +02:00
efcc966adf chore(.github): add leads to CODEOWNERS (#2904)
* chore(.github): add leads to CODEOWNERS

* GitHub Error

* Update CODEOWNERS

* Update .github/CODEOWNERS

* Update .github/CODEOWNERS

* Update CODEOWNERS

* Update .github/CODEOWNERS

Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>

---------

Co-authored-by: meister03 <69507874+meister03@users.noreply.github.com>
Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
2023-03-29 15:22:22 -05:00
ITOH cb27cae74b Create CNAME 2023-03-29 20:25:50 +02:00
ITOH 28cbcee61d fix(client): remove 2023-03-29 19:14:20 +02:00
ITOH 69d818cf84 fix(bot): channel transformer managed 2023-03-29 19:08:19 +02:00
ITOH 9d01eff6fd feat(website): move to discordeno.js.org (#2902) 2023-03-29 11:01:28 -05:00
ITOHandSkillz4Killz bfd1936581 feat(bot,client,types): add role subscriptions (#2899)
Closes: https://github.com/discordeno/discordeno/issues/2859

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-03-29 10:49:04 -05:00
ITOHandSkillz4Killz a715140df6 feat(client,rest,types): add GetAuditLog.after (#2898)
* feat(client,rest,types): add `GetAuditLog.after`

closes: https://github.com/discordeno/discordeno/issues/2860

* Apply suggestions from code review

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-03-29 10:46:21 -05:00
ITOH 08fb3fc5b5 feat(client,types): add FormLayout enum (#2900) 2023-03-29 10:45:15 -05:00
ITOHandSkillz4Killz 6d43ca11a7 feat(bot,types): add Channel.managed (#2897)
Closes: https://github.com/discordeno/discordeno/issues/2871

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-03-29 10:41:05 -05:00
ITOH 8c1baac466 Merge branch 'main' of github.com:discordeno/discordeno 2023-03-29 15:46:36 +02:00
ITOH 520de0fb70 docs(types): update CreateGuildStickerOptions file size (#2889)
Previously the maximum file size has been documented as 500 KB. This has
now been updated to 512 KB.

Closes: https://github.com/discordeno/discordeno/issues/2875
2023-03-29 15:46:32 +02:00
ITOH 776cacc183 feat(client): make MessageTypes up to date (#2888)
Added all missing `MessageTypes`:
 - AUTO_MODERATION_ACTION (24)
 - ROLE_SUBSCRIPTION_PURCHASE (25)
 - INTERACTION_PREMIUM_UPSELL (26)
 - STAGE_START (27)
 - STAGE_END (28)
 - STAGE_SPEAKER (29)
 - STAGE_TOPIC (31)
 - GUILD_APPLICATION_PREMIUM_SUBSCRIPTION (32)

Closes: https://github.com/discordeno/discordeno/issues/2877
2023-03-29 15:46:32 +02:00
ITOH 9cfcc971ca feat(bot,types): add customMessage to AutoModerationActionMetadata (#2887)
* feat(bot,types): add `customMessage` to `AutoModerationActionMetadata`

Closes: https://github.com/discordeno/discordeno/issues/2881

* docs(types):  add clarification for the supported action type
2023-03-29 15:46:31 +02:00
ITOH 41925bc2a7 Merge branch 'main' of github.com:discordeno/discordeno 2023-03-29 14:48:44 +02:00
ITOH cac84204c3 chore(LICENSE): update year 2023-03-29 14:48:05 +02:00
ITOH 3a8172caec docs(types): update CreateGuildStickerOptions file size (#2889)
Previously the maximum file size has been documented as 500 KB. This has
now been updated to 512 KB.

Closes: https://github.com/discordeno/discordeno/issues/2875
2023-03-29 00:33:05 -05:00
ITOH 0936448250 feat(client): make MessageTypes up to date (#2888)
Added all missing `MessageTypes`:
 - AUTO_MODERATION_ACTION (24)
 - ROLE_SUBSCRIPTION_PURCHASE (25)
 - INTERACTION_PREMIUM_UPSELL (26)
 - STAGE_START (27)
 - STAGE_END (28)
 - STAGE_SPEAKER (29)
 - STAGE_TOPIC (31)
 - GUILD_APPLICATION_PREMIUM_SUBSCRIPTION (32)

Closes: https://github.com/discordeno/discordeno/issues/2877
2023-03-29 00:30:45 -05:00
ITOH 08c65e3b11 feat(bot,types): add customMessage to AutoModerationActionMetadata (#2887)
* feat(bot,types): add `customMessage` to `AutoModerationActionMetadata`

Closes: https://github.com/discordeno/discordeno/issues/2881

* docs(types):  add clarification for the supported action type
2023-03-29 00:24:37 -05:00
ITOHandSkillz4Killz 8fa7e89e8c fix(helpers): edit interaction responses & webhook messages does not update files (#2483)
Closes: #2482

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2022-09-30 08:41:09 -05:00
ITOH 23771ea949 feat(types)!: add two_way_link to DiscordConnection (#2481)
When the connection has a corresponding thrid party OAuth2 token
`two_way_link` will be set to `true`.

Reference: https://github.com/discordeno/discordeno/issues/2479

Closes: #2479
2022-09-17 17:06:45 -04:00
ITOH 52cf958b1d fix(dnt): private name errors 2022-09-17 18:00:15 +02:00
ITOH 75abd56f7a Merge branch 'main' of github.com:discordeno/discordeno 2022-09-17 17:22:16 +02:00
ITOH 6ced7044ff fix(dnt): undici security vulnerability 2022-09-17 17:22:03 +02:00
ITOH 0b6471cc1d chore(FUNDING): move to github sponsors 2022-09-17 16:17:37 +01:00
ITOH 03996c5f58 refactor: revert "feat: base plugin lib idea (#2308)" (#2336)
* Revert "feat: base plugin lib idea (#2308)"

This reverts commit ffe7cdbc6f.

* fmt
2022-07-02 14:24:43 +01:00
ITOH c7eb3a9b0c hotfix: release: 13.0.0-rc45
Fixed:
 - startBot shard data calculation
 - propper handling for websocket close code 1000

Changed:
 - shard shutdown code to 3000
2022-05-29 18:22:56 +02:00
ITOH 144e651259 release: 13.0.0-rc44
Fixed:
 - lastShardId & totalShards when starting a bot without pre-set `gatewayBot` information
Removed:
 - Debug handling of close code 1000 for shards
2022-05-29 17:47:40 +02:00
ITOH d50be0834e fix(gateway,bot): socket close debug handling & last/totalShards (#2261) 2022-05-29 17:39:27 +02:00
ITOH 1423df5b8d release: 13.0.0-rc43 2022-05-27 23:51:58 +02:00
ITOH 24f7718566 feat!: make createBot sync (#2255) 2022-05-27 23:50:39 +02:00
ITOH 4d3a01d314 release: 13.0.0-rc42
Fixed:
 - pass intents to `gatewayConfig` in the `createBot` function
2022-05-27 23:48:18 +02:00
ITOH 89c80ed236 release: 13.0.0-rc42
Fixed:
 - pass intents to `gatewayConfig` in the `createBot` function
2022-05-25 23:05:40 +02:00
ITOH c4ba54e4ee fix(bot): pass intents to gatewayConfig (#2253) 2022-05-25 23:05:05 +02:00
ITOH b5acaf11ad release: 13.0.0-rc41
Too many changes to write changelog, please ask in the Discord.
2022-05-25 22:42:24 +02:00
ITOH b469c98527 refactor(gateway,types,util)!: finalize gateway code (#2241)
* push some cursed stuff

* bucket

* fix bugs and hack start ordered

* some management improvements

* more gw stuff

* f

* rename manager to gateway

* remove basic thing

* remove old stuff

* f

* fix imp

* fixes
2022-05-25 22:27:49 +02:00
ITOH b00504ce07 perf(plugins/helpers,rest,site,template)!: uppercase rest methods (#2252)
* perf(plugins/helpers,rest,site,template)!: uppercase rest methods
There is no need for us to pass the methods in lower case and then use the `toUpperCase()` method everywhere. Therefore this PR changes every lowercase method to be uppercase (eg. `"get"` => `"GET"`).

* template is old version
2022-05-25 20:45:51 +02:00
ITOH 1edb3c2110 refactor(bot,plugins/helpers,rest,util)!: improve rest route handling (#2248)
* refactor(bot,helpers,plugins,rest,util)!: improve rest route handling
 - rename endpoints constant to routes
 - simplify routes code by removing bases and function calls
 - url query params can now be passed to the route functions

* style: deno fmt

* fix base stuff

* suggestions
2022-05-25 20:35:25 +02:00
ITOH bc2f66c773 release: 13.0.0-rc40
Added:
 - `convertRestError` function so you can edit the error stack better/add additional handling
 - `Collection#forceSet` method which ignores the `maxSize` limit of the collection

Changed:
 - Intent calculation now needs to be done manually (eg. `Intents.Guilds | Intents.GuildMessages`) **BREAKING**

Fixed:
 - `ApplicationCommandOption#required` is optional
 - `createInvite` sending the wrong value for `target_application_id`
 - `editApplicationCommandPermissions` needs a bearer token to access the related endpoint **BREAKING**
 - `sendInteractionResponse` not uploading files

Removed:
 - leftover console.log in the `spawnShards` and `processGlobalQueue` functions
2022-05-25 19:22:12 +02:00
ITOH 86116787be Merge branch 'main' of github.com:discordeno/discordeno into main 2022-05-25 18:53:46 +02:00
ITOH 72fec3a4c6 fix(rest): sendInteractionResponse file upload (#2239)
* fix(rest): `sendInteractionResponse` file upload

* f
2022-05-25 15:38:13 +01:00
ITOH be5bcb5bbc fix(rest)!: editApplicationCommandPermissions (#2238)
* fix(rest)!: `editApplicationCommandPermissions`
 - add `bearerToken` option
 - add headers to `RestPayload`
 - remove `batchEditApplicationCommandPermissions` since the related endpoint has been removed

* fix header prefix
2022-05-25 09:53:53 -04:00
ITOH 53d7b31041 refactor(.github,README,gateway,plugins/fileloader,tests,types)!: make intent calculation manual (#2243)
This changes the calculation of intents to be manual to the dev.
This is to improve overall consistency of our code base, also it is not a big drawback for users since intents are usually done once and then never (seldom) touched again.
2022-05-25 09:50:31 -04:00
ITOH d7883855ec refactor(.github,README,gateway,plugins/fileloader,tests,types)!: make intent calculation manual
This changes the calculation of intents to be manual to the dev.
This is to improve overall consistency of our code base, also it is not a big drawback for users since intents are usually done once and then never (seldom) touched again.
2022-05-24 23:16:01 +02:00
ITOH 3a5263c4e9 style: deno fmt 2022-05-24 22:01:44 +02:00
ITOH 544cfdbc1c fix(.github): repo syncer remove deleted files (#2216) 2022-05-14 12:02:33 +01:00
ITOH 199d616f04 style: fmt 2022-05-12 19:03:03 +02:00
ITOHandSkillz4Killz 3b5ce7e61a feat(dnt): specify repository (#2164)
Currenty we do not specify out repository in our `package.json` for npm.
This changes that to target our main repository.

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2022-04-15 05:20:43 -04:00
ITOH eb69f54360 Merge branch 'main' of github.com:discordeno/discordeno into main 2022-04-10 19:28:34 +02:00
ITOH ac9434b40a release: 13.0.0-rc35 2022-04-10 19:28:16 +02:00
ITOH f94b6f35bb style(plugins): deno fmt 2022-04-10 14:57:21 +02:00
ITOH c4d43f2b87 release: 13.0.0-rc34 2022-03-31 14:20:31 +02:00
ITOH 9980856eef refactor!: fix some spelling mistakes (#2144)
* refactor!: fix some spelling mistakes
This fixes some spelling mistakes around the code base. Note not all are fixed.

* subComponent
2022-03-31 14:16:34 +02:00
ITOH 34a358f8bf feat(helpers,types)!: slash command localization (#2129)
* feat(helpers,types): slash command localization
Discord has documented the slash command localization feature now.
This adds the full functionality for those to Discordeno.

Additionally a `Locales` has also been added to allow for better typing.

Reference: https://github.com/discord/discord-api-docs/pull/4653

* suggestion

* better locales type

* f

* fix serializing

* stupid direct pushes

* b
2022-03-27 11:02:27 -04:00
ITOH 23ebfac286 feat(types): add premiumSubscriber to RoleToggles (#2141)
In the role tags discord sends a `premium_subscriber` field. It seems that this has been forgotten to add.

Reference: https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure
2022-03-27 11:01:20 -04:00
ITOH 468a85ffa5 feat(types): add image_hash audit log change key (#2142)
This adds the `image_hash` audit log change key which is being used when a guild scheduled event cover image gets updated.

Reference: https://github.com/discord/discord-api-docs/pull/4707
2022-03-27 11:00:50 -04:00
ITOH 2c2ccb252c feat(helpers,types)!: add guild template transformer (#2132)
* feat(helpers,types)!: add guild template transformer
This adds a template transformer. Also this fixes incorrect type definitions regarding templates.

Breaking Change: The previously called `Template` interface which was used for creating templates has been renamed to `CreateTemplate`

* fmt

* forgot to add this

* use data
2022-03-25 06:15:17 -04:00
ITOH 4bdd8330d0 feat(plugins): validate interaction response title (#2130)
Modal titles must have a length between 1 and 45 characters.
This adds a check to the permissions plugin.

Reference: https://github.com/discord/discord-api-docs/pull/4649
2022-03-24 19:04:23 -04:00
ITOH 4b469c7290 ci: fix tests for changes made to the gateway/ directory (#2127) 2022-03-24 10:02:28 -04:00
ITOH 4ad02d0a20 ci: cache template code (#2126)
* ci: cache template code

* f

* f

* f

* f
2022-03-24 10:02:01 -04:00
ITOH 75eb35df6e fix(plugins): createApplicationCommand checks 2022-03-24 14:34:26 +01:00
ITOH b0ecdf1a62 fix(plugins): createApplicationCommand validation 2022-03-24 14:29:01 +01:00
ITOH c830055a52 style: run deno fmt 2022-03-23 21:23:27 +01:00
ITOH c9a9cdc500 feat(plugins): better typing (#2120) 2022-03-21 22:13:15 -04:00
ITOHandSkillz4Killz e4a91b77d0 ci(workflows): fix publish to npm on version constant update (#2118)
GitHub workflows cannot trigger another workflow. Due to this the npm workflow currently did not run on a version constant update.
Since we will only publish with a version constant update there should be no problem when we move the npm release in there.

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2022-03-20 10:50:38 -04:00
ITOH c5d6502464 fix(dnt): add transformers (#2076)
* fix(dnt): add transformers

* Update dnt.ts
2022-02-27 15:17:02 -05:00
ITOHandSkillz4Killz 4e06ed6b2c fix(types): SelectOption#default is not required (#2066)
* fix(types):  is not required

* ddcmp

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2022-02-25 10:07:48 -05:00
ITOH d1cfe1d1d1 fix(README): logo image url 2022-02-21 15:50:41 +00:00
ITOH 72294936e0 Delete r.ts 2022-02-16 18:28:11 +01:00
ITOHandTriForMine 7204665e77 fix(plugins): await old function return (#2065)
* fix(plugins): await old function return

* Update plugins/permissions/src/channels/stage.ts

lol

Co-authored-by: TriForMine <quentin.nicolini@hotmail.fr>

Co-authored-by: TriForMine <quentin.nicolini@hotmail.fr>
2022-02-15 20:06:06 +00:00
ITOH cf747d5a63 feat!: update to api version 10 (#2063)
* testing stuff

* feat: update to api version 10

* broken url import

* do changes

* delete test file
2022-02-14 20:00:58 +01:00
ITOH cfbfb67c8e refactor!: rename the ws folder to gateway (#2037) 2022-02-11 05:21:10 -05:00
ITOH 7f3b86c6bd ci: publish workflow change the name to publish (#2029) 2022-02-09 20:22:05 -05:00
ITOH 75a8aaa064 feat(types): add value to InputTextComponent (#2026) 2022-02-09 14:08:49 -05:00
ITOH 6c500f2d69 style: deny changes to deno.json (#2022) 2022-02-09 12:50:59 -05:00
ITOH 9c7a7a18e3 ci: run local tests on PR (#2024) 2022-02-09 12:34:45 -05:00