mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 06:31:20 +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:')) {
|
||||
resolve(this.client.rest.methods.createEmoji(this, attachment, name, roles));
|
||||
} else {
|
||||
this.client.resolver.resolveBuffer(attachment).then(data =>
|
||||
resolve(this.client.rest.methods.createEmoji(this, data, name, roles))
|
||||
);
|
||||
this.client.resolver.resolveBuffer(attachment).then(data => {
|
||||
const dataURI = this.client.resolver.resolveBase64(data);
|
||||
resolve(this.client.rest.methods.createEmoji(this, dataURI, name, roles));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue