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,16 +1,21 @@
import { join } from "path";
import { AttachmentData } from "../../interfaces/commands/AttachmentData";
import { RegionName } from "../../interfaces/weather/names/RegionName";
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { join } from "node:path";
import type { AttachmentData }
from "../../interfaces/commands/attachmentData.js";
import type { RegionName } from "../../interfaces/weather/names/regionName.js";
/**
* Selects one of the random banner images from the banner folder.
*
* @param {RegionName} region The name of the region.
* @returns {AttachmentData} The banner image attachment data.
* @param region - The name of the region.
* @returns The banner image attachment data.
*/
export const getBannerImage = (region: RegionName): AttachmentData => {
const fileName = `${region}${Math.ceil(Math.random() * 3)}.png`;
const fileName
= `${region}${String(Math.ceil(Math.random() * 3))}.png`;
const filePath = join(process.cwd(), "src", "assets", "banners", fileName);
return {
attachmentString: `attachment://${fileName}`,