mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
isEmpty
This commit is contained in:
@@ -7,7 +7,6 @@ class EmojiArgumentType extends ArgumentType {
|
||||
}
|
||||
|
||||
validate(value, msg) {
|
||||
if (!value) return false;
|
||||
const matches = value.match(/^(?:<:([a-zA-Z0-9_]+):)?([0-9]+)>?$/);
|
||||
if (matches && msg.client.emojis.has(matches[2])) return true;
|
||||
if (!msg.guild) return false;
|
||||
|
||||
@@ -25,6 +25,11 @@ class ImageArgumentType extends ArgumentType {
|
||||
}
|
||||
return msg.attachments.first().url;
|
||||
}
|
||||
|
||||
isEmpty(value, msg) {
|
||||
if (!msg.attachments.size) return !value;
|
||||
return Boolean(msg.attachments.size);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ImageArgumentType;
|
||||
|
||||
Reference in New Issue
Block a user