This commit is contained in:
Daniel Odendahl Jr
2017-11-19 20:35:05 +00:00
parent 36c17d8988
commit af0ad02068
2 changed files with 5 additions and 1 deletions
-1
View File
@@ -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;
+5
View File
@@ -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;