mirror of
https://github.com/danbulant/discord.js
synced 2026-07-05 11:10:38 +00:00
Create Emoji requires a base64 data uri (#1154)
This commit is contained in:
parent
4dc70d8cef
commit
ab5e57d94b
1 changed files with 4 additions and 3 deletions
|
|
@ -687,9 +687,10 @@ class Guild {
|
||||||
if (typeof attachment === 'string' && attachment.startsWith('data:')) {
|
if (typeof attachment === 'string' && attachment.startsWith('data:')) {
|
||||||
resolve(this.client.rest.methods.createEmoji(this, attachment, name, roles));
|
resolve(this.client.rest.methods.createEmoji(this, attachment, name, roles));
|
||||||
} else {
|
} else {
|
||||||
this.client.resolver.resolveBuffer(attachment).then(data =>
|
this.client.resolver.resolveBuffer(attachment).then(data => {
|
||||||
resolve(this.client.rest.methods.createEmoji(this, data, name, roles))
|
const dataURI = this.client.resolver.resolveBase64(data);
|
||||||
);
|
resolve(this.client.rest.methods.createEmoji(this, dataURI, name, roles));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue