feat: add Client#webhooksUpdate (#9732)

* feat: add `Client#webhooksUpdate`

* feat: add deprecation in the types

* docs: add full stops

* types: reference non-deprecated type

This helps with future-proofing (deduplication).

* docs(ClientEvents): fix reference link

This now hyperlinks correctly with IntelliSense.

---------

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Synbulat Biishev
2023-08-09 19:15:00 +05:00
committed by GitHub
parent 99194fc270
commit 0de071d0a5
3 changed files with 23 additions and 4 deletions

View File

@@ -4861,7 +4861,9 @@ export interface ClientEvents {
typingStart: [typing: Typing];
userUpdate: [oldUser: User | PartialUser, newUser: User];
voiceStateUpdate: [oldState: VoiceState, newState: VoiceState];
webhookUpdate: [channel: TextChannel | NewsChannel | VoiceChannel | ForumChannel];
/** @deprecated Use {@link webhooksUpdate} instead. */
webhookUpdate: ClientEvents['webhooksUpdate'];
webhooksUpdate: [channel: TextChannel | NewsChannel | VoiceChannel | ForumChannel];
interactionCreate: [interaction: Interaction];
shardDisconnect: [closeEvent: CloseEvent, shardId: number];
shardError: [error: Error, shardId: number];

View File

@@ -1170,7 +1170,7 @@ client.on('voiceStateUpdate', ({ client: oldClient }, { client: newClient }) =>
expectType<Client<true>>(newClient);
});
client.on('webhookUpdate', ({ client }) => expectType<Client<true>>(client));
client.on('webhooksUpdate', ({ client }) => expectType<Client<true>>(client));
client.on('guildCreate', async g => {
expectType<Client<true>>(g.client);