Adjust motd to also work on newer builds

This commit is contained in:
PRO100KatYT
2024-05-04 07:09:38 +02:00
parent b80f550239
commit db73002da1
3 changed files with 142 additions and 73 deletions

View File

@@ -8,17 +8,19 @@ express.get("/content/api/pages/*", async (req, res) => {
res.json(contentpages)
})
express.post("/api/v1/fortnite-br/surfaces/motd/target", async (req, res) => {
const motdTarget = JSON.parse(JSON.stringify(require("./../responses/Athena/motdTarget.json")));
express.post("/api/v1/fortnite-br/surfaces/*/target", async (req, res) => {
const motd = JSON.parse(JSON.stringify(require("./../responses/Athena/motd.json")));
const fields = ["title", "body", "TeaserTitle", "FullScreenTitle", "FullScreenBody"];
try {
motdTarget.contentItems.forEach(item => {
item.contentFields.title = item.contentFields.title[req.body.language];
item.contentFields.body = item.contentFields.body[req.body.language];
motd.contentItems.forEach(item => {
fields.forEach(field => {
item.contentFields[field] = item.contentFields[field][req.body.language];
})
})
} catch (err) {}
res.json(motdTarget)
res.json(motd)
})
module.exports = express;