redundant await and callback

This commit is contained in:
Histmy 2021-09-24 19:07:58 +02:00
parent 9551acf792
commit 404574bd74

View File

@ -11,9 +11,8 @@ const budouciSpinky: Record<string, NodeJS.Timeout> = {};
const contactSpinkServer = async (akce: string, id: string, nick: string = "", avatar: string | null = "") => { const contactSpinkServer = async (akce: string, id: string, nick: string = "", avatar: string | null = "") => {
const options = `heslo=${process.env.spinkPass}&akce=${akce}&id=${id}&nick=${encodeURIComponent(nick)}&avatar=${encodeURIComponent(avatar ?? "")}`; const options = `heslo=${process.env.spinkPass}&akce=${akce}&id=${id}&nick=${encodeURIComponent(nick)}&avatar=${encodeURIComponent(avatar ?? "")}`;
return await fetch(`https://spinkacek.ga/extapi.php?${options}`) return fetch(`https://spinkacek.ga/extapi.php?${options}`)
.then(r => r.text()) .then(r => r.text());
.then(text => text);
}; };
const syncSpink = async () => { const syncSpink = async () => {