mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Who's That Pokemon Command, Bug Fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user