diff --git a/types/emoji.js b/types/emoji.js index 4da0a7b3..d444b6fd 100644 --- a/types/emoji.js +++ b/types/emoji.js @@ -8,7 +8,7 @@ class EmojiArgumentType extends ArgumentType { validate(value, msg) { const matches = value.match(/^(?:<:([a-zA-Z0-9_]+):)?([0-9]+)>?$/); - if (msg.client.emojis.has(matches[2])) return true; + if (matches && msg.client.emojis.has(matches[2])) return true; if (!msg.guild) return false; const search = value.toLowerCase(); let emojis = msg.guild.emojis.filterArray(nameFilterInexact(search));