misc.mcserver: reorder so data is actually gotten
This commit is contained in:
parent
7c2f0dcdbc
commit
d4f504bb3a
1 changed files with 10 additions and 10 deletions
|
@ -218,11 +218,7 @@ mcserver.callback = async function (msg, line) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data == "timeout") {
|
if (data?.error && !tried) {
|
||||||
await msg.removeReaction("\uD83C\uDFD3");
|
|
||||||
return "Timed out trying to query.";
|
|
||||||
} else if (data?.error) {
|
|
||||||
if (!tried) {
|
|
||||||
try {
|
try {
|
||||||
tried = true;
|
tried = true;
|
||||||
data = await queryServerNoIdent(ip, port);
|
data = await queryServerNoIdent(ip, port);
|
||||||
|
@ -232,6 +228,10 @@ mcserver.callback = async function (msg, line) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data == "timeout") {
|
||||||
|
await msg.removeReaction("\uD83C\uDFD3");
|
||||||
|
return "Timed out trying to query.";
|
||||||
|
} else if (data?.error) {
|
||||||
await msg.removeReaction("\uD83C\uDFD3");
|
await msg.removeReaction("\uD83C\uDFD3");
|
||||||
return `Failed to query:\n\`\`\`\n${data.error.message}\n\`\`\``;
|
return `Failed to query:\n\`\`\`\n${data.error.message}\n\`\`\``;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue