perryhuynh / kcauto

kcauto, the successor to kancolle-auto, a Kantai Collection (Kancolle) bot/automation tool
GNU General Public License v3.0
68 stars 22 forks source link

yuu bot integration #394

Open mrmin123 opened 4 years ago

mrmin123 commented 4 years ago

Courtesy of @waicool20

POST https://yuu.waicool20.com/api/user/{apikey}/stats:

{ 
  "profileName":"ExpOnly",
  "isRunning":true,
  "startingTime":{ 
    "epochSecond":1575098643,
    "nano":185000000
  },
  "crashes":0,
  "sortiesDone":0,
  "sortiesAttempted":0,
  "expeditionsSent":0,
  "expeditionsReceived":0,
  "pvpsDone":0,
  "questsDone":0,
  "questsStarted":0,
  "resupplies":0,
  "repairs":0,
  "bucketsUsed":0,
  "shipsSwitched":0,
  "recoveries":0,
  "resources":{ 
    "fuel":227454,
    "ammo":259103,
    "steel":227989,
    "bauxite":131802,
    "buckets":1087,
    "devmats":2843
  }
}

POST https://yuu.waicool20.com/api/user/{apikey}/crashed:

{
    "log": "error logs here"
}
mrmin123 commented 4 years ago

@waicool20 how does the user authenticate or handshake with Yuu?

waicool20 commented 4 years ago

The user gets an api key by issuing a command in discord which they should save into the script. After that its just fill in the blanks according to the examples above.

mrmin123 commented 4 years ago

Oh I just saw the apikey portion in the URL. That explains it, thanks.

waicool20 commented 4 years ago

Forgot to add this but you can check if an api key is valid using the following call GET https://yuu.waicool20.com/api/user/{apikey} It'll either return 200 OK or 404 Not Found