Fix image-or-avatar

This commit is contained in:
Dragon Fire
2021-01-30 12:12:41 -05:00
parent e08580649d
commit b977823e3e
+4 -3
View File
@@ -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) {