How to add json custom api command to Nightbot? Weather

Asked May 22, 2023·3 replies·Last activity 3 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

3 replies

Hello @Polar Cat , thanks for the help <3
it is possible to convert km/h m/s, or multiplication factor 3.6?

Yes you can, let's say the weather is in the w variable, here's how to do it:

const windSpeedInMetersPerSecond = ( parseInt( w.match(/\d+km\/h/)[0] ) * 3.6 ).toFixed(2); w.replace(/\d+km\/h/, windSpeedInMetersPerSecond + 'm/s');