mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
Optimize kym search
This commit is contained in:
@@ -67,13 +67,13 @@ module.exports = class KnowYourMemeCommand extends Command {
|
|||||||
|
|
||||||
getMemeDescription($) {
|
getMemeDescription($) {
|
||||||
const children = $('.bodycopy').first().children();
|
const children = $('.bodycopy').first().children();
|
||||||
|
let foundAbout = false;
|
||||||
for (let i = 0; i < children.length; i++) {
|
for (let i = 0; i < children.length; i++) {
|
||||||
const child = children.eq(i);
|
const text = children.eq(i).text();
|
||||||
if (child.text() === 'About') {
|
if (foundAbout) {
|
||||||
for (let j = i + 1; j < children.length; j++) {
|
if (text) return text;
|
||||||
const text = children.eq(j).text();
|
} else if (foundAbout) {
|
||||||
if (text) return text;
|
foundAbout = true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "92.2.5",
|
"version": "92.2.6",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user