Commit Graph
100 Commits
Author SHA1 Message Date
ITOH 25fd78b93e ci(rest): fix rest proxy image registry (#2978) 2023-04-05 22:09:44 +00:00
ITOH 60d1c2d3eb refactor(types)!: remove PRIVATE_THREADS guild feature (#2974)
Closes: https://github.com/discordeno/discordeno/issues/2847
2023-04-05 13:45:53 -05:00
ITOH f249e58c68 feat(bot,types): add missing automod trigger metadata (#2973) 2023-04-05 17:55:32 +00:00
ITOH 927ee42ce0 fix(rest): set the correct auth header when using proxy (#2969) 2023-04-04 22:24:20 +00:00
ITOH 8c9c3d53bf refactor(rest)!: make invalid bucket lazy (#2967)
* refactor(rest): make invalid bucket lazy
Instead of using timeouts we should aim to use a lazy bucket system.

* that might be better

* fix tests
2023-04-04 03:34:34 +00:00
ITOH e3549a8675 fix(rest): does not need to set the absolute url (#2966) 2023-04-03 20:00:30 +00:00
ITOH 895db84d34 refactor(rest): add header constants (#2962)
* refactor(rest): add header constants

* spelling error

* export
2023-04-03 19:01:14 +00:00
ITOH 0b02607649 ci: do not run on website changes (#2964)
Also removed the sync repo workflow since we do not use the sites repo actively anymore.
2023-04-03 18:05:55 +00:00
ITOH aff0d47acd blog: why we switched from deno to node.js (#2958) 2023-04-03 17:01:03 +00:00
ITOHandSkillz4Killz 088fd12513 fix(bot)!: rename auditLogEntryCreate to guildAuditLogEntryCreate (#2952)
* fix(bot)!: rename `auditLogEntryCreate` to `guildAuditLogEntryCreate`

* need to start small

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>

* also remove this

* suggestions

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-04-03 15:52:34 +00:00
ITOH 7f9459b435 feat(rest): add isProxied (#2957)
Adds the `isProxied` property to rest.
This effectively removes the `startWith('https://discord.com/api')` check.
2023-04-03 15:51:47 +00:00
ITOH 50282f9190 refactor(rest)!: improve sendRequest (#2956)
* refactor(rest)!: refactor `sendRequest`
 - Removed `url` in favour of `route`. This change will effectively remove a bunch of unnecessary checks from dd. Also this changes how rest proxies have to pass the route to the `makeRequest` function. But since it will just require you to pass `req.route + req.query` it is an improvement compared to `rest.baseUrl + req.route + req.query`.
 - Introduced `HttpResponseCodes` an internal enum to remove magic numbers.
 - Improved the rate limted response handling. Made it simpler.
 - Removed unnecessary `JSON.stringify(await result.json())` since `await result.text()` does effectively the same.
 - Changed the anti memor leak `response.json()` to `response.arrayBuffer()` since latter does not do any additional processing.

* .

* forgot to fix that
2023-04-03 15:23:01 +00:00
ITOH bb92a78e6a ci: fix labeler adding style on refactor 2023-04-03 16:43:17 +02:00
ITOH af64b18518 forgot to commit that 2023-04-03 00:16:25 +02:00
ITOH 1f26dd58d1 need to end with .js 2023-04-03 00:08:16 +02:00
ITOH 1aa053a29a more fixes 2023-04-03 00:04:44 +02:00
ITOH 56ae189812 ci: fix benchmarks 2023-04-02 23:58:40 +02:00
ITOH 43844571cc feat(bot): allow passing of applicationId (#2954)
* feat(bot): allow passing of applicationId

* Update packages/bot/src/bot.ts
2023-04-02 23:20:00 +02:00
ITOH 0f41cd302e ci: fix benchmarks (#2953) 2023-04-02 21:06:55 +00:00
ITOH da74ea7e55 docs(types)!: update intents (#2951)
- Added missing event docs
 - Added a note for privileged intents
 - Renamed `GuildBans` to `GuildModeration`
2023-04-02 21:05:08 +00:00
ITOH fd357aeace refactor(rest)!: move routes to their own creator function (#2950)
Currently the route definitions make `createRestManager` massive. Moving them to their own creator function makes it a bit easier to handle.

Also `sessionInfo` has been removed since it's just an alias to `gatewayBot`. Instead `gatewayBot` should be used.
It has been removed since the routes are mainly used internally in the lib. Almost no one should need to touch them outside, but if they do they should know how routes are called.
2023-04-02 21:04:33 +00:00
ITOH 7c031df875 refactor(rest)!: remove falsy token check (#2949)
* refactor(rest): remove falsy token check
This is in favour for interaction only bots, which still need rest but cannot provide a valid bot token.
If you want to use rest for your normal bot it should be your own responsibility to pass a valid token.

Further more `applicationId` is now a required property since we cannot extract the id from the token anymore.

* forgot to commit that

* fix error

* make appid optional again

* app id throw error if undefined

* fix test
2023-04-02 21:39:08 +02:00
ITOH 5e1e56146e fix: eslint no async error (#2947)
* fix: eslint no async error

* just ignore
2023-04-02 19:47:29 +02:00
ITOH 7c51f731cb refactor(rest): improve unauthorized readability (#2946)
Currently we use a double negation in the code which makes it harder to understand what it actually does.

Therefore the check has been changed to be understood easier.
2023-04-02 16:54:36 +00:00
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