mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Fix image-or-avatar
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user