fix(TextBasedChannel): Add a detailed response for sendTyping

Co-Authored-By: NekoCyan <cyanhijirikawa88@gmail.com>
This commit is contained in:
Elysia
2025-02-27 22:57:07 +07:00
parent b057e048af
commit e6ea07856d
2 changed files with 6 additions and 4 deletions

View File

@@ -388,13 +388,13 @@ class TextBasedChannel {
/** /**
* Sends a typing indicator in the channel. * Sends a typing indicator in the channel.
* @returns {Promise<void>} Resolves upon the typing status being sent * @returns {Promise<{ message_send_cooldown_ms: number, thread_create_cooldown_ms: number }|void>} Resolves upon the typing status being sent
* @example * @example
* // Start typing in a channel * // Start typing in a channel
* channel.sendTyping(); * channel.sendTyping();
*/ */
async sendTyping() { sendTyping() {
await this.client.api.channels(this.id).typing.post(); return this.client.api.channels(this.id).typing.post();
} }
/** /**

4
typings/index.d.ts vendored
View File

@@ -985,6 +985,8 @@ export class BaseDispatcher extends Writable {
public timestamp: number; public timestamp: number;
public mtu: number; public mtu: number;
public fps: number; public fps: number;
public payloadType: number;
public extensionEnabled: boolean;
public pause(silence?: boolean): void; public pause(silence?: boolean): void;
public resume(): void; public resume(): void;
@@ -4819,7 +4821,7 @@ export interface TextBasedChannelFields extends PartialTextBasedChannelFields {
setRateLimitPerUser(rateLimitPerUser: number, reason?: string): Promise<this>; setRateLimitPerUser(rateLimitPerUser: number, reason?: string): Promise<this>;
setNSFW(nsfw?: boolean, reason?: string): Promise<this>; setNSFW(nsfw?: boolean, reason?: string): Promise<this>;
fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>; fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
sendTyping(): Promise<void>; sendTyping(): Promise<{ message_send_cooldown_ms: number; thread_create_cooldown_ms: number } | void>;
sendSlash(target: UserResolvable, commandName: string, ...args: any[]): Promise<Message | Modal>; sendSlash(target: UserResolvable, commandName: string, ...args: any[]): Promise<Message | Modal>;
} }