mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Optimize kym search
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "92.2.5",
|
||||
"version": "92.2.6",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user