Commit Graph

118 Commits

Author SHA1 Message Date
Fleny
3daf71a507 Use bigint for permission flags (#3726)
Also convert the enum to an object as typescript doesn't like bigint in an enum
2024-07-09 09:23:46 -05:00
Fleny
2f89d4da30 Add partial guild to interaction (#3618)
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2024-07-07 16:32:06 -05:00
Fleny
24ea6f8af8 fix(bot)!: Guild features type (#3719)
* Fix guild features type, remove useless features des prop

* Add missing guild features
2024-07-07 16:14:13 -05:00
Fleny
aecc55d150 fix(bot)!: Add guild.features to guild transformer (#3705)
* Add guild.features to guild transformer

* Use a getter on the toggles for features
2024-07-07 10:39:04 -05:00
Fleny
2def050845 feat(types)!: Add flags enums (#3717)
* Add flags enums

* Remove extra MessageFlags enum from `@discordeno/bot`

This is not a breaking in itself as `@discordeno/types` has this enum

* Fix CI error, remove usage of MessageFlags and SkuFlags

* Revert "remove usage of MessageFlags and SkuFlags"

This reverts part of commit 954b347ebb.

* fix ci error
2024-07-07 10:37:49 -05:00
Fleny
49ce2e44df feat(bot,rest,types): Add burst (super reaction) informations on events & DiscordReactionType (#3615)
* Add GetReactions#type & DiscordReactionType

* Add burst and burstColors to reaction add/remove events

The reaction remove event only has burst, not burstColors

* Add type to message reaction add/remove

* Fix type error

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2024-07-07 10:26:35 -05:00
Fleny
a1af1ff910 Adds premium interaction (#3680)
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2024-07-06 17:04:05 -05:00
Fleny
9cea65f761 Add invite type (#3614) 2024-07-06 16:30:05 -05:00
Fleny
9cca689688 Add Attachment title (#3691) 2024-07-06 16:19:06 -05:00
Fleny
f57e2e962f Add guildId to guildStickersUpdate event (#3706) 2024-07-06 16:08:25 -05:00
Fleny
39b18a1682 Use bot.transformers.emoji in handleGuildEmojisUpdate (#3704) 2024-07-06 19:12:54 +00:00
Fleny
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
Fleny
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
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
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
Fleny
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
Fleny
a361a53d57 Add poll transformer export (#3550)
& fix a typedoc warning for the oauth2 func
2024-05-06 07:40:08 +00:00
Fleny
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
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
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
Dorian Oszczęda
05a20c3bf8 refactor(bot, gateway, rest)!: Improve the interface of the createBot() function. (#3422)
* misc: Make the token a required property on the rest manager.

* refactor: Make unnecessarily required properties optional.

* misc: Improve interface for `createBot()` and allow passing in `transformers`/`handlers`.

* fix: Test made redundant by changes still being included.

* fix: Missing non-null assertions.

* fix: Benchmarks failing.

* misc: Remove `cache.requestMembers.pending` as an exposed option.

* style: Switch back to interface approach.
2024-03-07 22:39:48 -06:00
Fleny
46c93385c1 Update interaction helpers (#3465) 2024-03-07 22:35:55 -06:00
Dorian Oszczęda
100039b1bd feat: Add voice state to the desired properties object. (#3424)
* feat: Add voice state to the desired properties object.

* chore: Remove unnecessary check.
2024-02-21 14:20:23 +00:00
Fleny
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
493f4d15e9 Use helpers in interaction methods (#3395) 2024-02-09 17:58:13 +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
dependabot[bot]
e31c4d0a8a build(deps-dev): bump eslint-config-standard-with-typescript from 40.0.0 to 42.0.0 (#3297)
* build(deps-dev): bump eslint-config-standard-with-typescript

Bumps [eslint-config-standard-with-typescript](https://github.com/standard/eslint-config-standard-with-typescript) from 40.0.0 to 42.0.0.
- [Release notes](https://github.com/standard/eslint-config-standard-with-typescript/releases)
- [Changelog](https://github.com/standard/eslint-config-standard-with-typescript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/standard/eslint-config-standard-with-typescript/compare/v40.0.0...v42.0.0)

---
updated-dependencies:
- dependency-name: eslint-config-standard-with-typescript
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Disable @typescript-eslint/no-unsafe-argument for the logger

* Fix eslint errors

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Fleny <Fleny113@outlook.com>
2023-12-11 22:04:40 +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
Matthew Hatcher
e47242a9e0 feat: api docs catchup part 1 (#3257)
* feat: add voice message support

Closes #3009

* fix: pre-commit hook EACCESS npx issue

* feat: add channel to interaction

Closes #2979

* feat: add role flags

Closes #3070

* feat: adds creator monetization, message flagged, and member timeout audit log event

Closes #3075

* feat: add attachment flags

Closes #3071

* feat: add avatar decorations

Closes #3081

* feat: update description for guild and channel permissions

Closes #3106

* feat: rename Nitro sticker packs to just sticker packs

Closes #3107

* feat: add integration type to audit log entry

Closes #3108

* feat: make position optional on modify guild channel position

Closes #3086

* feat: add guild media channel type and associated flag

Closes #3093

* feat: update remark for activities.write scope

Closes  #3213

* feat: add support for super reactions

Closes #3113

* fix: attempt to fix benchmarks

* fix: benchmark attempt #2

---------

Co-authored-by: Fleny <Fleny113@outlook.com>
2023-12-04 21:54:39 +00:00
Matthew Hatcher
8b3bc4bad7 feat: only require one guild delete event (#3194) 2023-12-02 11:30:25 +00:00
Skillz4Killz
ea9dc10589 craete bot prop 2023-10-28 13:28:35 +00:00
Skillz4Killz
59631f2fac format 2023-10-28 13:25:09 +00:00
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