fix(Webhook): resolve non-string avatars too (#5914)

This commit is contained in:
SpaceEEC
2021-06-25 12:11:56 +02:00
committed by GitHub
parent 261612596d
commit 4714a961b8

View File

@@ -232,7 +232,7 @@ class Webhook {
* @returns {Promise<Webhook>}
*/
async edit({ name = this.name, avatar, channel }, reason) {
if (avatar && typeof avatar === 'string' && !avatar.startsWith('data:')) {
if (avatar && !(typeof avatar === 'string' && avatar.startsWith('data:'))) {
avatar = await DataResolver.resolveImage(avatar);
}
if (channel) channel = channel instanceof Channel ? channel.id : channel;