fix: update refreshAttachmentURL to accept rest parameters for improved flexibility

This commit is contained in:
Elysia
2024-12-29 21:49:29 +07:00
parent 053084d082
commit c1f6f5e78c
2 changed files with 3 additions and 3 deletions

View File

@@ -519,10 +519,10 @@ class Client extends BaseClient {
/** /**
* Refresh the Discord CDN links with hashes so they can be usable. * Refresh the Discord CDN links with hashes so they can be usable.
* @param {string[]} urls Discord CDN URLs * @param {...string} urls Discord CDN URLs
* @returns {Promise<Array<{ original: string, refreshed: string }>>} * @returns {Promise<Array<{ original: string, refreshed: string }>>}
*/ */
async refreshAttachmentURL(urls = []) { async refreshAttachmentURL(...urls) {
// Clean up the URLs // Clean up the URLs
urls = urls.map(url => { urls = urls.map(url => {
const urlObject = new URL(url); const urlObject = new URL(url);

2
typings/index.d.ts vendored
View File

@@ -778,7 +778,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
public fetchPremiumStickerPacks(): Promise<Collection<Snowflake, StickerPack>>; public fetchPremiumStickerPacks(): Promise<Collection<Snowflake, StickerPack>>;
public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>; public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>;
public fetchGuildWidget(guild: GuildResolvable): Promise<Widget>; public fetchGuildWidget(guild: GuildResolvable): Promise<Widget>;
public refreshAttachmentURL(urls: string[]): Promise<{ original: string; refreshed: string }[]>; public refreshAttachmentURL(...urls: string[]): Promise<{ original: string; refreshed: string }[]>;
public sleep(timeout: number): Promise<void>; public sleep(timeout: number): Promise<void>;
public login(token?: string): Promise<string>; public login(token?: string): Promise<string>;
/** @deprecated This method will not be updated until I find the most convenient way to implement MFA. */ /** @deprecated This method will not be updated until I find the most convenient way to implement MFA. */