Commit Graph

84 Commits

Author SHA1 Message Date
Skillz4Killz
ea9fca102a fix: add option to enable all desire props 2023-10-28 13:25:02 +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
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
Awesome Stickz
4a38f1a6e4 refactor: ignore handlers if events for an handler isnt provided (#3148)
* refactor: ignore handlers if events for an handler isnt provided

* style: use !event instead of event === undefined check

* fix: handleGuildDelete check
2023-10-15 04:27:55 +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
Skillz4Killz
6e8f15557c Pr/livelove1987/3138 (#3143)
* feat: Adding invite helper use transformer

* fix: Fix type error

* Update packages/bot/src/transformers/invite.ts

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

* fixes

* fix: Fixed invite transformer

* Remove < > in comment

* Fix: remove useless const

* fix invite

* fix: ts error

---------

Co-authored-by: livelove1987 <mateusz.luboinski@gmail.com>
Co-authored-by: livelove1987 <82705913+livelove1987@users.noreply.github.com>
2023-09-30 14:58:14 -05:00
Awesome Stickz
45c878d390 fix(bot): bug with overriding lastShardId if it's not provided in createBot() options (#3141)
* fix(gateway): bug with overriding lastShardId if it's not provided in createBot() options

* fix the fix
2023-09-30 14:14:05 +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
Sam Teeuwisse
1355d54035 Fix commandOptionsParser and move to bot package (#3135) 2023-09-20 14:04:41 +00:00
Fleny
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
livelove1987
ceb3d4dbe2 Fix: added getActiveThreads return value transformer (#3118) 2023-09-02 15:53:06 +00:00
livelove1987
cd29c5f0b1 fix(bot): properly handle thread list sync event (#3116)
* fix: Added threadListSync event support

* fix: Added threadListSync event support

* Update packages/bot/src/bot.ts

---------

Co-authored-by: ITOH <to@itoh.at>
2023-08-28 21:47:30 +00:00
Skillz
db8c464081 fix: docs update Closes #3054 2023-08-20 11:16:17 -05:00
Skillz
63156f3f49 Merge branch 'main' of https://github.com/discordeno/discordeno into main 2023-08-20 11:10:14 -05:00
Skillz
15fd5d123c fix: applicationId supports strings. Closes #3038 2023-08-20 11:09:40 -05:00
Awesome Stickz
6e231b5276 feat: add message_author_id to Message Reaction Add event (#3101) 2023-08-19 14:59:11 +00:00
Endy
2d0f76ec5c fix(bot): channel transformer bitrate prop (#3100) 2023-08-08 16:38:23 +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
NeKz
1424e5552b fix(bot): Transform hashes correctly (#3091) 2023-08-05 18:26:16 +00:00
8au
d0db3420f7 fix: 'INVITE_DELETE' event now uses 'handleInviteDelete' (previously used 'handleInviteCreate') (#3064)
* fix: Fixed an issue which would cause the 'INVITE_DELETE' event to be passed into 'INVITE_CREATE'.

* chore: updated guild counts for appy and ai image generator

* chore: removed duplicate line in the message transformer
2023-07-23 15:54:34 -05:00
Jovan Jovanovic
9f0e4d3dd7 fix(types,bot) Fix global name typing (#3053)
* fix(types,bot): fix global_name typing

* fix(types): include global_name in the comment

* fix(utils): add global_name to users
2023-06-17 19:15:57 -05:00
Andreas Fink
0d08c57d56 feat(bot): Add guildUnavailable event, fixes #3028 (#3044)
* feat(bot): Add guildUnavailable event, fixes #3028

* Update packages/bot/src/handlers/guilds/GUILD_DELETE.ts

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-06-13 15:39:48 +00:00
Awesome Stickz
f9a5fc1afe feat: add support for new username system (#3035)
* feat: add support for new username system

* fix: default avatar calculation in avatarUrl(), also remove support for old system

* fix: use description from docs for user.globalName

* fix: typings

* fix: avatarUrl() to support both old and new username system
2023-06-13 15:39:06 +00:00
Endy
dcc121af46 fix(gateway): Use Deno's WebSocket (#3030)
* fix(gateway): Use Deno's WebSocket

* invert runtime check
2023-06-05 02:27:38 +00:00
Skillz
c675b450c1 fix: deno ws fix 2023-05-08 14:02:18 -05:00
Skillz
9de1f66bca fix: guild object should accept thread channels Closes #3024 2023-05-08 13:43:42 -05:00
Endy
c76a173655 Add channel_types prop to channel select menu (#3027)
https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure
2023-05-08 16:33:57 +00:00
Endy
dfbee47667 Fix BaseInteraction.respond & response validation (#3023) 2023-05-08 15:58:33 +00:00
Endy
2b83d691b3 Toggle Interaction.acknowledged in defer (#3022) 2023-05-06 14:57:43 +00:00
Skillz4Killz
1d232ac34a fix: interaction.edit type 2023-05-05 23:27:40 +00:00
Endy
37aa4198c2 feat(bot): add more helper functions to BaseInteraction (#3018)
* Add more helper functions for `BaseInteraction`

- Breaking changes for `respond`
  - `response` now takes `InteractionCallbackData`
  - `options` is now `ephemeral: boolean`
- Added `edit`, `defer` and `delete`

* Add comments and `acknowledged` check for `defer`

* Update packages/bot/src/transformers/interaction.ts

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

* Revert `respond` options, rename `ephemeral` to `private`

* Fix typo

* Fix arg name

- Renamed `private` to `isPrivate` to prevent reserved name collision
- Optional chaining for `options`

* Apply suggestions from code review

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-05-05 15:52:49 +00:00
Skillz
5c42bdd3ed Merge branch 'main' of https://github.com/discordeno/discordeno into main 2023-04-28 14:14:33 -05:00
Skillz
4dd7ca71c5 fix: interaction.respond typing 2023-04-28 14:14:29 -05:00
livelove1987
be142101e9 fix: Fixed message transformers (#3013) 2023-04-27 22:44:26 +00:00
Skillz
e2d86ea644 fix: channel.parentId 2023-04-19 14:33:45 -05:00
Skillz
b044211b27 fix: missing helpers 2023-04-19 14:00:42 -05:00
Skillz
a6c5cc4ca9 fix: mark acknowledged when responding 2023-04-19 13:16:52 -05:00
Skillz4Killz
e54f51a7af fix: hack in helpers again (#3008)
* fix: hack in helpers again

* fix: remaining type errors

* fix: weird linter issue
2023-04-19 12:57:36 -05:00
Skillz4Killz
7b06df4b1c feat:i interaction.respond 2023-04-19 04:21:50 +00:00
Yaikava
fd518cb554 🐛 - fix: bot pkg - gateway - prefer snakecase by default (#3006) 2023-04-16 23:53:02 +00:00
Awesome Stickz
85ea2d9b8c fix(bot): missing exports of types (#3004)
* fix(bot): missing exports of types

* fix: add other exports
2023-04-16 23:51:17 +00:00
Skillz4Killz
e19eca5e80 fix: transformer customizers for channel, member, role, user 2023-04-10 04:09:45 +00:00