From cb4f6fc5fd098e6c03a851a65133f7171e71a639 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 1 Oct 2026 21:10:57 -0400 Subject: [PATCH] Modify startup sequence to use sendAlert --- main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 249e4cf..7503b56 100644 --- a/main.js +++ b/main.js @@ -5,6 +5,7 @@ const dotenv = require('dotenv'); dotenv.config(); const token = process.env.TOKEN; const statusChannelId = process.env.statusChannelId; +const ownerId = process.env.ownerId; // Dump the env vars to log in dev environment: if (process.env.isDev === "true") console.log(JSON.stringify(process.env)); @@ -33,6 +34,7 @@ const strings = require('./strings.json'); const { GifData, CommandData } = require('./CustomModules/NodBot.js'); const ButtonHandlers = require('./CustomModules/ButtonHandlers.js'); const InteractionStorage = require('./CustomModules/InteractionStorage.js'); +const appVersion = require('./package.json').version; const isDev = process.env.isDev; let statusChannel; @@ -53,8 +55,12 @@ client.once('ready', async () => { await fn.avWx.metar.getAllICAOs(); await fn.avWx.datis.getAllICAOs(); // console.log(JSON.stringify(icaoArray)); - statusChannel = await client.channels.fetch(statusChannelId).catch(e => console.error(e)); - await statusChannel.send(`${new Date().toISOString()} -- <@${process.env.ownerId}>\nStartup Sequence Complete`).catch(e => console.error(e)); + // statusChannel = await client.channels.fetch(statusChannelId).catch(e => console.error(e)); + // await statusChannel.send(`${new Date().toISOString()} -- <@${process.env.ownerId}>\nStartup Sequence Complete`).catch(e => console.error(e)); + const readyTimestamp = new Date().toISOString(); + const readyMessage = readyTimestamp + ' -- <@' + ownerId + '>\nStartup Sequence Complete'; + const readyMsgEmbed = fn.embeds.text({ command: 'Boot', content: readyMessage, author: appVersion }); + await fn.sendAlert(readyMsgEmbed, client); // Check for banned servers fn.checkBannedServers(client, statusChannel); });