Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.
Late update, but I fixed it!
First, you have to send the following message to the websocket: `${this.battle}|/uploadreplay`, replacing `this.battle` with the battle id.
Next, you have to look for the message that starts with `|queryresponse|savereplay` then parse the JSON, and run the following...
Oh forgot to add before lol: idk if you didn't see, but the POSTing doesn't actually work, for some reason. I just need to know what to POST exactly so I can do it right. I tried looking on Github for answers to no avail
The bot sends `/savereplay` to the server in line 329 of `showdown.js` in that repo I linked above. Then, it looks for the response on line 206 of the same file and calls the `requestreplay` method (this method is not in the master branch of the git repo yet, that's why you don't see it). This...
Oh oof, it went offline. Lemme post my code directly then (and yes, I'm parsing the response to /savereplay in another part of the code).
async requestReplay(data) {
let replayPostURL = "https://play.pokemonshowdown.com/~~showdown/action.php?act=uploadreplay";
let replay =...
Hi friends. I'm making a bot that can track K/D in a live battle, but that's not what this is about.
I'm trying to get the bot to automatically save the replay of the battle after the match is done. However, I can't seem to get the uploading to work properly. This is the code...