mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Added resolveImage to reduce code duplication (#1820)
* add client#resolveImage * oops * resolveFile fix * async is the future * async * update doc example * build fix * doc fix * fix docs * thx hydar
This commit is contained in:
@@ -254,7 +254,7 @@ class Webhook {
|
||||
*/
|
||||
edit({ name = this.name, avatar }, reason) {
|
||||
if (avatar && (typeof avatar === 'string' && !avatar.startsWith('data:'))) {
|
||||
return this.client.resolver.resolveBuffer(avatar).then(file => {
|
||||
return this.client.resolver.resolveFile(avatar).then(file => {
|
||||
const dataURI = this.client.resolver.resolveBase64(file);
|
||||
return this.edit({ name, avatar: dataURI }, reason);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user