Merge pull request #407 from hocsinhgioitoan/main

Doc: fix sleep return type
This commit is contained in:
Elysia 2022-11-19 17:25:35 +07:00 committed by GitHub
commit 99882764ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -980,7 +980,7 @@ class Client extends BaseClient {
/** /**
* Makes waiting time for Client. * Makes waiting time for Client.
* @param {number} miliseconds Sleeping time as milliseconds. * @param {number} miliseconds Sleeping time as milliseconds.
* @returns {Promise<void>} * @returns {Promise<void> | null}
*/ */
sleep(miliseconds) { sleep(miliseconds) {
return typeof miliseconds === 'number' ? new Promise(r => setTimeout(r, miliseconds)) : null; return typeof miliseconds === 'number' ? new Promise(r => setTimeout(r, miliseconds)) : null;

2
typings/index.d.ts vendored
View File

@ -878,7 +878,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
public sweepMessages(lifetime?: number): number; public sweepMessages(lifetime?: number): number;
public customStatusAuto(client?: this): undefined; public customStatusAuto(client?: this): undefined;
public authorizeURL(url: string, options?: object): Promise<boolean>; public authorizeURL(url: string, options?: object): Promise<boolean>;
public sleep(milliseconds: number): Promise<void>; public sleep(milliseconds: number): Promise<void> | null;
public toJSON(): unknown; public toJSON(): unknown;
public on<K extends keyof ClientEvents>(event: K, listener: (...args: ClientEvents[K]) => Awaitable<void>): this; public on<K extends keyof ClientEvents>(event: K, listener: (...args: ClientEvents[K]) => Awaitable<void>): this;