feat: update this highly outdated app to use latest packages and custom configs (#1)

Reviewed-on: https://codeberg.org/nhcarrigan/tingle-bot/pulls/1
Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com>
Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
2024-09-26 19:46:33 +00:00
committed by Naomi the Technomancer
parent 1339b63378
commit 7c0bd7ad10
74 changed files with 6348 additions and 8905 deletions

View File

@ -1,18 +1,23 @@
import { join } from "path";
import { PrecipitationName } from "../../interfaces/weather/names/PrecipitationName";
import { SpecialName } from "../../interfaces/weather/names/SpecialName";
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { join } from "node:path";
import type { PrecipitationName }
from "../../interfaces/weather/names/precipitationName.js";
import type { SpecialName }
from "../../interfaces/weather/names/specialName.js";
/**
* Checks if the current weather conditions have an overlay.
*
* @param {SpecialName | PrecipitationName} name The name of the weather condition to look for.
* @returns {string | null} The file path to the overlay, or null if there is no overlay.
* @param name - The name of the weather condition to look for.
* @returns The file path to the overlay, or null if there is no overlay.
*/
export const getOverlayImage = (
name: SpecialName | PrecipitationName
name: SpecialName | PrecipitationName | null,
): string | null => {
let fileName = null;
let fileName: string | null = null;
switch (name) {
case "Blight Rain":
fileName = "ROOTS-blightrain.png";
@ -58,8 +63,10 @@ export const getOverlayImage = (
case "Thunderstorm":
fileName = "ROOTS-thunderstorm.png";
break;
default:
fileName = null;
}
if (!fileName) {
if (fileName === null) {
return null;
}