Commit Graph

153 Commits

Author SHA1 Message Date
Fleny
dfa7ff4045 feat(bot,rest,gateway,utils,types)!: Add soundboard support (#3919)
* Add soundboard support

* Add rest endpoints

* add comment to gateway requestSoundboardSounds

* Apply suggestions from code review

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

* Update for discord/discord-api-docs#7207

* Update discord.ts

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
Co-authored-by: ITOH <to@itoh.at>
2024-11-05 19:44:37 +05:30
Fleny
87e6cd0c2e feat(bot,rest,types): Add subscriptions (#3892)
* Add subscriptions

* Apply suggestions from code review

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

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2024-11-05 13:38:33 +01:00
Fleny
b1036b24cf feat(types,bot): Add banners to members (#3949)
* Add banners to members

* Fix comments on Member and DiscordMember
2024-11-05 13:17:45 +01:00
Fleny
81b3b28e0e feat(bot,types): Add webhook events types (#3953)
* Add webhook events types

We will not support all the signing part for the handling of http
requests, however we do still provide the types for these requests

* Apply suggestions from code review

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

* Use union on DiscordEventWebhookEventBody data

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2024-11-05 13:16:56 +01:00
Fleny
d58de64704 Add command target to interaction response messages (#3959) 2024-11-05 13:16:41 +01:00
Fleny
84d20a2648 FIx error when transforming a partial message (#3961) 2024-11-05 13:16:10 +01:00
Fleny
eb20050745 Always include the message content if desired (#3965) 2024-11-05 13:15:46 +01:00
Fleny
df5d8630c6 Add null to application urls (#3908) 2024-10-06 23:44:49 -05:00
Fleny
b9200cfd39 Entry Point commands and Interactions updates (#3883) 2024-10-06 23:38:14 -05:00
Fleny
a749905740 update DiscordAuditLogChange to be less manual (#3823) 2024-10-06 23:37:17 -05:00
Fleny
57fa3d4d22 Add new fields to message snapshots (#3897) 2024-09-07 08:40:42 +02:00
Fleny
48902bcb8e Add new member flags (#3896) 2024-09-07 08:27:40 +02:00
Fleny
45bfa059b5 feat(bot,rest,types): Add get activity instance endpoint (#3891)
* Add get activity instance endpoint

* Add ActivityInstance & ActivityLocation transformers
2024-09-07 08:21:14 +02:00
Fleny
a0510da166 Add voiceChannelEffectSend event (#3869) 2024-08-18 14:44:39 +05:30
Fleny
c1b0dc925d fix(bot)!: Remove direct calls to transformers (#3863)
* Remove direct calls to transformers

* Sort transformers by name

* Fix error
2024-08-18 09:04:18 +02:00
Fleny
a80036fc12 Add get guild role endpoint (#3861) 2024-08-18 08:57:22 +02:00
Fleny
4899d0aa66 Add approximate_user_install_count (#3845)
And also a few missing values*
The values were not added to the reverse transformers as well, as a few
reverse transformers are missing for it
2024-08-10 19:36:46 -05:00
Fleny
bb6b8df2cf Add get sticker pack endpoint (#3844) 2024-08-10 19:36:29 -05:00
Fleny
895cc17106 Add voice state http endpoints (#3841) 2024-08-10 19:36:15 -05:00
Fleny
62b3122e89 Add recurrence rule to scheduled event (#3834) 2024-08-10 19:34:55 -05:00
Fleny
746f0a99ac fix(discordeno)!: Fix some errors in DiscordenoConfig (#3824)
* Fix typo, remove RecursivePartial from DiscordenoConfig.desiredProperties.properties

* Fix properties typo

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2024-08-03 10:26:21 +05:30
Fleny
22a611761b Make token in rest and gateway for createBot optional (#3820) 2024-08-03 10:10:09 +05:30
Fleny
e315ee6d95 fix(bot)!: Remove old unprovided params from event params (#3794)
* Remove oldMessage from messageUpdate params

* Remove oldPresence from presenceUpdate as well
2024-07-30 23:36:26 -05:00
Fleny
ef4cc80c63 fix(bot,gateway): Fix (some) resharding bugs (#3792)
* Improve logging, keep shard collections separated

* revert to erroring in getSessionInfo. Fill the value in createBot

* removed useless if

* remove same number of shards check

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

* Update manager.ts

* revert shard.events.message assignment for the spread

* use new Collection instead of .clear() + for-of

* Use fixed formula and note in the comment the inaccuracy

* Apply suggestions from code review

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

* Add a remark to shardsFullPercentage to let the user know of the inaccuracy

* Update comment and add a clearInterval

The clearInterval is not strictly needed, however it is better to ensure there is always one and only one internal running at a given point

* revert check for all shards online
It was bugged as gateway.resharding.shards gets populated overtime and not instantly

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
2024-07-30 23:34:32 +05:30
Fleny
c7b44e5e30 feat(bot): Add desiredProperties to createBot (#3787)
* Add `desiredProperties` to createBot

* remove not used default
2024-07-23 00:29:11 -05:00
Fleny
0819d2be9b feat(bot,types): Type commandOptionsParser, remove any (#3786)
* Type commandOptionsParser, remove any

* fix ts errors
2024-07-23 00:28:36 -05:00
Fleny
402f1b3049 Add message forward (#3764) 2024-07-21 11:49:07 -05:00
Fleny
2421ae24cf Add application emoji endpoints (#3774) 2024-07-20 16:56:00 -05:00
Fleny
c1fd19c0ee Remove DiscordPartialGuild, use Partial<DiscordGuild> (#3768) 2024-07-20 16:55:45 -05:00
Fleny
27fc12ec34 feat(cli)!: CLI generated types (#3453)
* Move transformers types to a single file

* Add script to test TS Compiler api capabilities
Remove nested objects where possible

* Use Partial<Role> and DiscordOverwrite instead of objects in AuditLogChange

* Fix typescript errors

* Remove interfaces.json

It is a generated file from the test script, not something that should be commited

* Start work on the test generation script
The TS version got bumped to 5.5.3

* Fix any type, use node16 module resolution

"node" is a deprecated alias for "node10", node16 is the recommended

Add code to check for type errors when getting the types from the interfaces

Fix errors when TS tries to find the files that the root tsconfig.json handles

* remove some useless compile options in TSApiTest

* Add jsdoc parsing
JSDoc tags with the next right after are not supported

* fix small format issue

* Fix ApplicationCommandPermissions todo

* Fix CI error

* Simplify parseDocumentation

* get type directly from the sourceFile

* remove hasUndefinedUnion as it is no longer used

* fix discordeno bin file name

* Update the yarn lockfile

* Merge scripts into one

* Use `@internal` instead of `@private` + `@deprecated`

* work on .d.ts files

* Process interface members once

* Move emit/preEmit diagnostics to a unit test

they can take quite a while, even 3-4 seconds, so running in the CLI every time does not seem ideal

* test: add build:types to test:unit dependencies

This is a test commit, it will provably get reversed. The scope is to see what CI does with this

* add find-up to deno import map

* add typescript to the deno import map

* Add node:assert to deno import map

* check for this.timeout that exists

deno does not have the timeout

* add build:type to deno-unit

* Temp hack to work-around the script deno tests

* Test with bun running the test as well

* fix turbo deps for unit tests

* remove test scripts

* Update CI to use build:type cache

* Apply code review suggestion

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

* Add code to modify the interface member

* use an actual config

The config source is still a dummy object for now

* Search and use discordeno.config.js file

* provide config from cli options

* Handle props in base objects
The dependencies of an object need to be declared/updated manually, it would be painful to fix this in such a way that would be something that Typescript can give us from the compiler API

* add some tests for desired proprieties

* also check for a .mjs config file

* Add support for .ts config files

We use the typescript compiler to emit an in-memory version of the config file, import it and then remove it. It does not do bundling so if the config imports local files it will not work. Also the file is not type-checked as it would slow down the config loading

* remove compiler host, use callback on program.emit

* fix deno ci error

* add node:fs/promises to deno import map

---------

Co-authored-by: LTS20050703 <lts20050703@gmail.com>
2024-07-20 16:52:21 -05:00
Fleny
9e101a0320 fix: adapt biome formatting of package.json files to match the yarn one (#3745)
* Fix biome formatting of package.json files to match the yarn one

* Ignore package.json

This includes a format on the member toggles as that pr got merged while using ESLint formatting and it didn't get updated before merging
2024-07-14 12:59:19 -05:00
Fleny
87f62d2a4b fix(bot,types): guild members flags (#3617)
* Add flags field to ModifyGuildMember

Also add the GuildMemberFlags enum as that was missing

* Add flags to member object

* Fix type error

* Update member transformer

* Readd flags desired propriety

* Rename enum to MemberFlag for consitency

* Rename to GuildMemberFlags, use number not the enum itself

* Use ToggleBitfield for flags

* Add getters

* Fix build error

* Merge flags in toggles

* change flags getter to return the actual flags

And not our custom toggles values

* Fix reverse transformer
2024-07-13 13:12:02 -05:00
Fleny
919474069d chore: Migrate ESLint and prettier to Biome (#3634)
* Migrate eslint and prettier to biomejs

This does NOT include examples/bigbot as it has its own formatter

* Update to biome 1.8.0

* Readd dotenv dev dependency to rest

During a merge it got lost
2024-07-13 13:05:02 -05:00
Fleny
7836ec393f Add missing proprieties on channel (#3736) 2024-07-13 08:52:05 -05:00
Fleny
727c7104ed Rename channel.autoArchiveDuration to defaultAutoArchiveDuration (#3741) 2024-07-13 08:19:26 -05:00
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