mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 04:52: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);
|
||||
*/
|
||||
setAvatar(avatar) {
|
||||
if (avatar.startsWith('data:')) {
|
||||
if (typeof avatar === 'string' && avatar.startsWith('data:')) {
|
||||
return this.client.rest.methods.updateCurrentUser({ avatar });
|
||||
} else {
|
||||
return this.client.resolver.resolveBuffer(avatar).then(data =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue