Commit Graph

7225 Commits

Author SHA1 Message Date
iCrawl
852fae557e chore: deps 2023-03-23 14:28:58 +01:00
Rodry
5f93dcce46 feat: add GuildBasedTextChannelTypes (#9234)
* feat: add GuildBasedTextChannelTypes

* docs(GuildTextBasedChannels): distinguish from non other

Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com>

* fix: spread correct array

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>

---------

Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2023-03-22 22:03:44 +00:00
Erwan
22e880aaa0 fix(Message#editable): update editable check in threads locked (#9216)
* fix(Message#editable): update editable check in threads locked

* fix(Message#editable): add check in archived threads

* fix: check manage threads permission only if thread is locked

* fix: adding a full stop at the end of a sentence

Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com>

---------

Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2023-03-22 21:38:32 +00:00
Jiralite
e9a8eb323f fix(ThreadManager): add members and conditionally include hasMore (#9164)
* fix(ThreadManager): conditionally include `hasMore`

* types: fix tests

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-22 19:24:09 +00:00
Jiralite
cc57563e73 fix(ThreadManager): Respect cache and force in fetching (#9239)
* fix(ThreadManager): Respect `cache` and `force` in fetching

* refactor: remove defaults

These are already defaulted down the line.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-22 19:20:52 +00:00
Jiralite
519e163f8a refactor(FetchThreadsOptions): Remove active (#9241)
* refactor(FetchThreadsOptions): remove `active`

* docs(FetchThreadsOptions): update description

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-22 19:17:47 +00:00
DD
eb81dc982c chore(ws): correct order for debug logs when identifying (#9248)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-22 19:13:56 +00:00
Tetie
bf507ab265 docs: add more examples (#9252)
* docs: add more examples

* fix: fix grammar and syntax

Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com>

* chore: fine-tune examples

* chore: replace double quotes with singles

* fix: remove redundant example tag

* fix: fix timeout logging

* Update packages/discord.js/src/structures/GuildMember.js

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

---------

Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-22 19:09:41 +00:00
Jiralite
178c8dcfee docs(FetchArchivedThreadOptions): before respects archive_timestamp, not creation timestamp (#9240)
docs(FetchArchivedThreadOptions): correct `before` description

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-22 19:01:17 +00:00
Jiralite
56cf138e02 docs: Update APISelectMenuComponent (#9235)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-22 18:57:23 +00:00
Jiralite
950fc47234 ci: Lock ancient issues (#9257)
ci: use dessant/lock-threads@v4
2023-03-20 19:35:58 +00:00
DD
c76b17d3b3 fix(WebSocketShard): don't close in #destroy when status is connecting (#9254) 2023-03-20 19:20:48 +00:00
Jeroen Claassens
229ad077ff fix(rest): remove const enums in favour of regular enums (#9243)
* fix(rest): remove `const enum`s in favour of regular enums

The motivation is that `const enum` produces ambient const enums when
compiling which in turn causes issues with TypeScript 5.x when `verbatimModuleSyntax`
is enabled.

Furthermore, the generally accepted best practice is to avoid `const enum`s
when writing libraries. Can back this up with statements from TS maintainers
if needed, I know they made them, I just can't be bothered to find the GitHub
links lmao. @vladfrangu will probably be able to find those links much easier
than me as it was also the motivation to remove `const enum`'s from discord-api-types

* refactor(rest): restore `const enum` for internal enum

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-19 14:35:27 +00:00
Jeroen Claassens
2e8e95031c build: resolve issue with esbuild-plugin-version-injector not working (#9246)
The issue was two-fold.
First of all, tsup starts using swc when `emitDecoratorMetadata` and `@swc/core` is installed.
`@swc/core` is installed transiently, which still causes the problem.
Okay, sure, so we move the `emitDecoratorMetadata` option to just
`packages/builders/tsconfig.json` seeing as the other packages don't use decorators anyway.
But that still leaves solving the issue for builders. @vladfrangu ended
up finding out that there was a bug in how esbuild handles plugins causing
the esbuild-plugin-version-injector plugin to not get loaded. This is solved
in v1.1.0 where the content is also replaced using the `onEnd` hook, if it
wasn't replaced by `onLoad` yet.
2023-03-19 14:28:06 +00:00
DD
98420826bc fix(WebSocketShard): cancel initial heartbeat in destroy (#9244)
* fix(WebSocketShard): cancel initial heartbeat in destroy

* refactor: use try/catch/finally

* chore: add debug log
2023-03-18 19:32:50 +00:00
n1ck_pro
51edba78bc fix(TextBasedChannelTypes): add GuildStageVoice (#9232)
fix(TextBasedChannelTypes): add GuildStageVoice
2023-03-15 17:32:29 +00:00
Jiralite
41077c96b5 chore: release all packages (#9230)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
@discordjs/builders@1.5.0 @discordjs/collection@1.4.0 @discordjs/core@0.4.0 @discordjs/formatters@0.2.0 @discordjs/proxy@1.3.0 @discordjs/rest@1.6.0 @discordjs/util@0.2.0 @discordjs/ws@0.7.0 14.8.0
2023-03-12 20:54:27 +00:00
Almeida
869153c3fd refactor: compare with undefined directly (#9191)
* refactor: compare with `undefined` directly

* fix: lint
2023-03-12 20:24:22 +00:00
DraftMan
955e8fe312 fix(snowflake): snowflakes length (#9144)
* fix(snowflake): fix snowflakes length

* fix(snowflake): fix length
2023-03-12 20:07:51 +00:00
Rodry
4458a13925 feat(Collector): add lastCollectedTimestamp (#9044)
* feat(Collector): add lastCollectedTimestamp

* docs: mark props as nullable

Co-authored-by: Synbulat Biishev <syjalo.dev@gmail.com>

* refactor: assign property in constructor

---------

Co-authored-by: Synbulat Biishev <syjalo.dev@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2023-03-12 19:59:09 +00:00
Jiralite
334a51240a fix: modify tsup extension (#9157)
fix: modify extension

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-12 19:49:43 +00:00
Suneet Tipirneni
dff131e8e4 refactor(core): move setVoiceState to GuildsAPI (#9228)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-12 19:37:56 +00:00
André Paulo
f5ec1cada5 docs(MessageManager): add clarification to fetch messages (#9222)
* docs(MessageManager): add clarification to fetch messages

[Discord's documentation](https://discord.com/developers/docs/resources/channel#get-channel-messages) mentions that you can only use before, after or around. This is not mentioned in D.JS documentation, and after some time trying to figure out why I was getting more messages than I should, decided to read the documentation.

* docs(MessageManager): remove mutually exclusive description

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-12 19:34:48 +00:00
DD
a99fc64e3f fix(WebSocketShard): #send race condition due to ready state (#9226)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-12 19:28:10 +00:00
DD
6ecff26ec6 feat(WebSocketShard): heartbeat jitter (#9223)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-12 19:24:35 +00:00
Jiralite
646b6ead7e chore(voice): release @discordjs/voice@0.15.0 (#9229)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
@discordjs/voice@0.15.0
2023-03-12 19:13:09 +00:00
Almeida
3492b194b5 types(MappedEvents): add GuildAuditLogEntryCreate (#9175)
* types(MappedEvents): add `GuildAuditLogEntryCreate`

* chore: sort interface alphabetically

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-12 18:15:54 +00:00
Suneet Tipirneni
1b29099ed0 fix(core): use auth: false for interaction callback methods (#9211)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-09 11:15:32 +00:00
Vlad Frangu
c6d98fa0c5 fix(Voice): send keep alives without awaiting a response (#9202) 2023-03-09 12:12:02 +01:00
Almeida
f65ac2ea78 docs: fix /core README example (#9201) 2023-03-09 12:09:44 +01:00
Vlad Frangu
a63ac88fcc fix(Actions): inject built data by using a symbol (#9203)
This fixes the hard crash encountered from message component interactions
where a `channel` property was added to them, causing hard crashes

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-09 11:05:52 +00:00
Synbulat Biishev
4367ab9302 docs(EmbedBuilder#spliceFields): fix a typo (#9159)
fix(EmbedBuilder#spliceFields): fix a typo

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-05 22:42:35 +00:00
iCrawl
dc142c47e4 chore: regen yarn lock 2023-02-27 21:58:49 +01:00
iCrawl
1f86d8578a chore: deps 2023-02-27 21:55:46 +01:00
Synbulat Biishev
71a427f632 types: allow sending messages with SuppressNotifications flag (#9177) 2023-02-27 21:39:03 +01:00
Jaworek
664cccb270 docs: make interactionResponse as optional (#9179) 2023-02-27 21:38:03 +01:00
DD
27e0b32c5f fix(WebSocketShard): wait for hello rather than ready in connect (#9178) 2023-02-27 19:37:16 +00:00
Jaworek
ffdb197f98 feat(StageChannel): add messages (#9134)
* feat(StageChannel): add messages

* fix: missing implements jsdoc

* Apply suggestions from code review

Co-authored-by: MateoDeveloper <79017590+Mateo-tem@users.noreply.github.com>

* Update packages/discord.js/src/util/Constants.js

Co-authored-by: MateoDeveloper <79017590+Mateo-tem@users.noreply.github.com>

* feat: use common class

* Apply suggestions from code review

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

* feat: add stage to text based channels + fix webhook.channel typings

* fix: some fixes

* Update packages/discord.js/src/structures/BaseGuildVoiceChannel.js

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>

* Update packages/discord.js/src/structures/VoiceChannel.js

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

* Update packages/discord.js/src/structures/interfaces/TextBasedChannel.js

Co-authored-by: Aura Román <kyradiscord@gmail.com>

* Update packages/discord.js/src/structures/BaseGuildVoiceChannel.js

Co-authored-by: space <spaceeec@yahoo.com>

---------

Co-authored-by: MateoDeveloper <79017590+Mateo-tem@users.noreply.github.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
Co-authored-by: Aura Román <kyradiscord@gmail.com>
Co-authored-by: space <spaceeec@yahoo.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-25 15:03:18 +00:00
Jaworek
095bd77515 feat(AutoModerationActionExecution): add channel, user and member getters (#9142)
* feat(AutoModerationActionExecution): add channel prop

* feat(AutoModerationActionExecution): add user prop

* fix: sintax

* feat: add guildmember getter

* Apply suggestions from code review

Co-authored-by: Almeida <almeidx@pm.me>

---------

Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-25 14:41:10 +00:00
Synbulat Biishev
e78b8ad3fb fix(Message#deletable): add check for deletable message types (#9168)
* fix(Message#deletable): add check for deletable message types

* docs: update docs

* fix: add check for `AutoModerationAction` message

* style: better style

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-25 14:38:05 +00:00
Jiralite
c1000b86ed feat(AutoModeration): Support custom_message (#9171)
* feat: initial commit

* docs: fix type

* docs: this is probably a better explanation

* docs: optional

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-25 14:34:48 +00:00
Sugden
a9495bd8f0 fix(Message): bulkDeletable permissions should be retrieved later for DMs (#9146)
* fix(Message): permissions check should be done later

the getter will error if used on a message originating from a DM

* refactor: remove unessercary chaining
2023-02-25 14:21:53 +00:00
Jiralite
4e0e125039 refactor(GuildMemberManager): Tidy up fetching guild members (#8972)
* refactor(GuildMemberManager): tidy up fetching guild members

* refactor: no destructure

* fix: throw `nonce` error correctly

* refactor: simplify `resolve()` with ternary

* refactor: prioritise `nonce` check

* fix: allow single user

* refactor: do not use `null`

This is not documented to request over the gateway.

* refactor: better name

* fix: extract correct property
2023-02-21 20:36:25 +00:00
ckohen
6e481f0a30 ci: create publish release workflow (#9150)
* ci: create publish release workflow

* test: fix tests for formatTag

* ci(publish-release): fix string concat

* ci: release action runs with tag as source

* ci(publish-release): no longer testing

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-21 20:15:39 +00:00
Almeida
fd0246ca4c types: remove EscapeMarkdownOptions (#9153) 2023-02-21 20:11:33 +00:00
DD
9681f34877 fix(WebSocketShard): proper error bubbling (#9119)
* fix(WebSocketShard): proper error bubbling

* fix(WebSocketShard): proper success signaling from waitForEvent

* refactor(waitForEvent): better error bubbling behavior

* fix(WebSocketShard): still allow the first connect call to reject

* fix(WebSocketShard): handle potential once error in #send

* refactor(WebSocketShard): waitForEvent & bubbleWaitForEventError

* refactor: success signaling

* chore: bump async EE to allow overwriting the error event
2023-02-19 19:28:34 +00:00
ckohen
7f2ef962ec test: fix coverage reporting (#9148)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-19 18:59:35 +00:00
DD
5c5a5832b9 refactor(WebSocketManager): passing in strategy (#9122)
* refactor(WebSocketManager): passing in strategy

* chore: update tests

* chore: requested nits

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-19 18:57:31 +00:00
Mohamed Ashraf
c6f9c50ba9 feat(core): Adds getWebhooks() function for the channel API and for the guild API (#9043)
* feat(core): Adds `getChannel()` for webhooks

* feat(core): add `getWebhooks()` function for the channel and the guild

* Update packages/core/src/api/guild.ts

Co-authored-by: Almeida <almeidx@pm.me>

* Update packages/core/src/api/channel.ts

Co-authored-by: Almeida <almeidx@pm.me>

* Update packages/core/src/api/channel.ts

Co-authored-by: Almeida <almeidx@pm.me>

* Update packages/core/src/api/guild.ts

Co-authored-by: Almeida <almeidx@pm.me>

* Update packages/core/src/api/guild.ts

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

* Update packages/core/src/api/channel.ts

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

* sorting the types

---------

Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: space <spaceeec@yahoo.com>
2023-02-17 23:35:44 +00:00
Jiralite
765d5a3b2d feat(ThreadMemberManager): Support pagination fetching (#9035)
* feat: initial commit

* fix: `query`

* fix: `GuildMember` for `member`

* types(ThreadMember): constructor types

* fix: send API properties correctly

Co-authored-by: Almeida <almeidx@pm.me>

* docs(FetchThreadMembersOptions): update `cache` description

* fix: retrieve from option

Co-authored-by: Almeida <almeidx@pm.me>

* fix: fix fetch many

* types(FetchThreadMembersOptions): add `withMember`

* types: stricter types

* types: infer possible guild member

* chore: reference member in getter

* types: remove `<false>`

* style: remove line

* chore: markdown

* types: remove `?`

* docs: remove irrelevant part

* fix: prevent crash

* refactor: make `member` `@private`

It will be confusing to have `guildMember` and `member`, specially since the former accounts for the latter.

---------

Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-17 22:14:36 +00:00