Fix Script

This commit is contained in:
SukkaW
2021-06-26 15:31:14 +08:00
parent 7d10b10719
commit 7af5453b45
2 changed files with 8 additions and 2 deletions

View File

@@ -1,8 +1,14 @@
let body = $response.body;
body = JSON.parse(body);
if (body?.response?.user?.is_premium) {
if (body?.response) {
body.response = body.response || {};
body.response.user = body.response.user || {};
body.response.user.is_premium = true;
}
if (body?.user) {
body.user = body.user || {};
body.user.is_premium = true;
}
body = JSON.stringify(body);
$done({ body })