Optimize kym search

This commit is contained in:
Daniel Odendahl Jr
2018-10-05 15:12:11 +00:00
parent 66b2d2ef67
commit cb68c978a5
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -67,13 +67,13 @@ module.exports = class KnowYourMemeCommand extends Command {
getMemeDescription($) {
const children = $('.bodycopy').first().children();
let foundAbout = false;
for (let i = 0; i < children.length; i++) {
const child = children.eq(i);
if (child.text() === 'About') {
for (let j = i + 1; j < children.length; j++) {
const text = children.eq(j).text();
if (text) return text;
}
const text = children.eq(i).text();
if (foundAbout) {
if (text) return text;
} else if (foundAbout) {
foundAbout = true;
}
}
return null;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "92.2.5",
"version": "92.2.6",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {