From b977823e3e8228b330124fe8d898e0ef17eed3c2 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 30 Jan 2021 12:12:41 -0500 Subject: [PATCH] Fix image-or-avatar --- types/image-or-avatar.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/types/image-or-avatar.js b/types/image-or-avatar.js index a6140437..20d4fcb5 100644 --- a/types/image-or-avatar.js +++ b/types/image-or-avatar.js @@ -5,9 +5,10 @@ module.exports = class ImageOrAvatarArgumentType extends ArgumentType { super(client, 'image-or-avatar'); } - validate(value, msg, arg) { - return this.client.registry.types.get('image').validate(value, msg, arg) - || this.client.registry.types.get('user').validate(value, msg, arg); + async validate(value, msg, arg) { + const image = await this.client.registry.types.get('image').validate(value, msg, arg); + if (image) return image; + return this.client.registry.types.get('user').validate(value, msg, arg); } async parse(value, msg, arg) {