Проверка не работает

This commit is contained in:
JonnyBro 2022-08-10 00:40:07 +05:00
parent fe38bc8038
commit 12855f99e9

View file

@ -5,7 +5,7 @@ const fetch = require("node-fetch");
const fetchMee6 = async args => { const fetchMee6 = async args => {
const response = await fetch(`https://mee6.xyz/api/plugins/levels/leaderboard/${args}`).then(res => res.json()); const response = await fetch(`https://mee6.xyz/api/plugins/levels/leaderboard/${args}`).then(res => res.json());
if (response.statusCode !== 200) { if (response.statusCode) {
if (response.error && response.error.message) throw new Error(`${response.statusCode}: ${response.error.message}`); if (response.error && response.error.message) throw new Error(`${response.statusCode}: ${response.error.message}`);
else throw new Error(`${response.statusCode}: ${response.statusMessage}`); else throw new Error(`${response.statusCode}: ${response.statusMessage}`);
} }