From f99efdf8135fec9ce86433074887216feb96bbf6 Mon Sep 17 00:00:00 2001 From: bignutty <3515180-bignutty@users.noreply.gitlab.com> Date: Mon, 5 Aug 2024 19:24:09 +0200 Subject: [PATCH] also add freedom units to the other one --- commands/message/utils/weather.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/message/utils/weather.js b/commands/message/utils/weather.js index 6be92fc..0d7390d 100644 --- a/commands/message/utils/weather.js +++ b/commands/message/utils/weather.js @@ -24,7 +24,10 @@ function temperature(value, units){ } function renderWeatherCard(context, data, units){ - let description = `### ${weatherIcon(data.result.current.icon.id)} ​ ​ ​ ​ ${temperature(data.result.current.temperature.current, units)} • ${data.result.current.condition.label}\n\n${pill("Feels like")} ${smallPill(temperature(data.result.current.temperature.feels_like, units))} ​ ​ ​ ​ ${pill("Wind")} ${smallPill(data.result.current.wind.speed + " km/h")}` + let description = `### ${weatherIcon(data.result.current.icon.id)} ​ ​ ​ ​ ${temperature(data.result.current.temperature.current, units)} • ${data.result.current.condition.label}\n\n${pill("Feels like")} ${smallPill(temperature(data.result.current.temperature.feels_like, units))} ​ ​ ​ ​ ${pill("Wind")} ` + + if(units == "°F") description += smallPill((data.result.current.wind.speed / 1.609).toFixed(2) + " mph") + else description += smallPill((data.result.current.wind.speed).toFixed(2) + " km/h") let secondaryPills = []; if(data.result.current.humidity > 0) secondaryPills.push(`${pill("Humidity")} ${smallPill(Math.floor(data.result.current.humidity * 100) + "%")}`)