I’ve seen some streamers use various !schedule commands for Splatoon schedules and I was wondering if there’s a way to set it up. I’ve been trying to figure it out but I don’t really know how to do it with Nightbot.
Ideally want to fetch the current info from splatoon3.ink with 5-6 commands for the various modes (a 5th pvp mode will be released down the line) and an addition “next” option to fetch the next rotation. (Rotation changes every 2 hours for PVP and for the PVE mode it’s every 40 hours)
!turf to fetch the current regular, !turf next to fetch the next regular, etc. (“Turf war” is the name for the “Regular” battle mode displayed on the website)
I know nintendo is a bit… yeah… with API but i checked this website and they listed endpoints here but idk how to incorporate those into a command? I know i’ll be needing to fetch the current/next map data, time left/until rotation change and for pve the current & next map and weapons.
Example responses: “Current Turf War: [Map 1] and [Map 2]. [Time left].” and “Current Salmon Run: [Map]. [Weapons]. [Time left].”
Kinda just need like an example of how to do it and then i might be able to work the rest out myself (hopefully)… anyone got any ideas?
Sorry about the delay, I had to take a much needed break.
The data comes in JSON, so it’s pretty easy to extract the data you want, the hardest part is to figure out which names are used to get the data, for example maps appear to be called stages, Turf war appears to be called regular, and Salmon run appears to be called coopGrouping, then you can see that rotations are stored in an array (table) called nodes, from there it’s relatively easy to do what you want.
However, since there’s a lot of data to treat, we’ll need to use a Pastebin to store the code that doesn’t rely on Nightbot’s variables… Create an account if you don’t have one already, then create a paste, copy/paste the code I wrote for it below, save the paste (be careful not to save it as private), and finally replace the paste ID (XXXXXXXX) in the command’s code.