fix: update refreshAttachmentURL to accept rest parameters for improved flexibility
This commit is contained in:
@@ -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
2
typings/index.d.ts
vendored
@@ -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. */
|
||||||
|
|||||||
Reference in New Issue
Block a user