mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 09:13:22 +00:00
fix setting avatar to buffer (#1048)
This commit is contained in:
parent
beffb390e6
commit
258e4b9085
1 changed files with 1 additions and 1 deletions
|
|
@ -116,7 +116,7 @@ class ClientUser extends User {
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
setAvatar(avatar) {
|
setAvatar(avatar) {
|
||||||
if (avatar.startsWith('data:')) {
|
if (typeof avatar === 'string' && avatar.startsWith('data:')) {
|
||||||
return this.client.rest.methods.updateCurrentUser({ avatar });
|
return this.client.rest.methods.updateCurrentUser({ avatar });
|
||||||
} else {
|
} else {
|
||||||
return this.client.resolver.resolveBuffer(avatar).then(data =>
|
return this.client.resolver.resolveBuffer(avatar).then(data =>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue