mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
littlelimedragon, union types
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
const { ArgumentType } = require('discord.js-commando');
|
||||
|
||||
class AvatarArgumentType extends ArgumentType {
|
||||
constructor(client) {
|
||||
super(client, 'avatar');
|
||||
}
|
||||
|
||||
validate(value, msg, arg) {
|
||||
return this.client.types.get('user').validate(value, msg, arg);
|
||||
}
|
||||
|
||||
async parse(value, msg, arg) {
|
||||
const user = await this.client.types.get('user').parse(value, msg, arg);
|
||||
return user.displayAvatarURL({ format: 'png', size: 512 });
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AvatarArgumentType;
|
||||
Reference in New Issue
Block a user