Who's That Pokemon Command, Bug Fixes

This commit is contained in:
Daniel Odendahl Jr
2017-08-23 10:58:56 +00:00
parent e7fde64769
commit 042d7ca615
6 changed files with 49 additions and 10 deletions
+5
View File
@@ -79,6 +79,11 @@ class Util {
static shorten(text, maxLen = 2000) {
return text.length > maxLen ? `${text.substr(0, maxLen - 3)}...` : text;
}
static filterPkmn(arr) {
const filtered = arr.filter(entry => entry.language.name === 'en');
return filtered[Math.floor(Math.random() * filtered.length)];
}
}
module.exports = Util;