From 0bb20fd6c15c7ba5559928f1df3dd121e9d3bdbc Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sun, 14 May 2023 12:02:01 -0500 Subject: [PATCH] Update discord embed to include progress information --- server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 4198b6e..875c68c 100755 --- a/server.js +++ b/server.js @@ -99,9 +99,13 @@ app.post("/updateItem",(req,res)=>{ name:req.body.item_name, icon_url:itemIcon }, + color:req.body.obtained==req.body.required?32768:Number(req.body.obtained)>0?20680:2172201, description:"**"+req.body.username+"** "+(req.body.operation==="FINISH"?" has finished collecting "+req.body.required+" / "+req.body.required+" __"+req.body.item_name+"__!": req.body.operation==="INCREASE"?" has collected "+req.body.obtained+" / "+req.body.required+" __"+req.body.item_name+"__ (+"+(req.body.obtained-req.body.previous_amt)+")" - :" has set __"+req.body.item_name+"__ to "+req.body.obtained+" / "+req.body.required)+"\n\n[Sig Planner - Sig crafts all the things](http://projectdivar.com:3001)" + :" has set __"+req.body.item_name+"__ to "+req.body.obtained+" / "+req.body.required)+"\n\n[Sig Planner - Sig crafts all the things](http://projectdivar.com:3001)", + footer:{ + "text":"Progress: "+((req.body.itemCount+req.body.obtained-req.body.previous_amt)/req.body.totalItemCount*100).toFixed(2)+"% ("+(req.body.itemCount+req.body.obtained-req.body.previous_amt)+"/"+req.body.totalItemCount+")" + } }] })}) .then((data)=>{