mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
update clientUser#setAvatar (#819)
* WHO DID THIS * e * some people have base64 fetishes i guess Signed-off-by: Gus Caplan <fluffyrobotcheese@gmail.com>
This commit is contained in:
committed by
Schuyler Cebulskie
parent
478377ac52
commit
44bae385c2
@@ -176,12 +176,11 @@ class Webhook {
|
||||
* @param {FileResolvable} avatar The new avatar for the Webhook.
|
||||
* @returns {Promise<Webhook>}
|
||||
*/
|
||||
edit(name, avatar) {
|
||||
edit(name = this.name, avatar) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (avatar) {
|
||||
this.client.resolver.resolveFile(avatar).then(file => {
|
||||
let base64 = new Buffer(file, 'binary').toString('base64');
|
||||
let dataURI = `data:;base64,${base64}`;
|
||||
const dataURI = this.client.resolver.resolveBase64(file);
|
||||
this.client.rest.methods.editWebhook(this, name, dataURI)
|
||||
.then(resolve).catch(reject);
|
||||
}).catch(reject);
|
||||
|
||||
Reference in New Issue
Block a user