feat: refresh discord attachment api
This commit is contained in:
@@ -517,6 +517,28 @@ class Client extends BaseClient {
|
||||
return new Widget(this, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the Discord CDN links with hashes so they can be usable.
|
||||
* @param {string[]} urls Discord CDN URLs
|
||||
* @returns {Promise<Array<{ original: string, refreshed: string }>>}
|
||||
*/
|
||||
async refreshAttachmentURL(urls) {
|
||||
const data = await this.api.attachments('refresh-urls').post({
|
||||
data: { attachment_urls: urls },
|
||||
});
|
||||
/**
|
||||
{
|
||||
"refreshed_urls": [
|
||||
{
|
||||
"original": "url",
|
||||
"refreshed": "url with hash"
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
return data.refreshed_urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for {@link Client#generateInvite}.
|
||||
* @typedef {Object} InviteGenerationOptions
|
||||
|
||||
Reference in New Issue
Block a user