Guh
Some checks are pending
ptero-push / build (push) Waiting to run

This commit is contained in:
Christopher Cookman 2025-05-25 17:47:44 -06:00
parent 33a5d21627
commit 92861365b2
2 changed files with 13 additions and 3 deletions

View file

@ -1121,7 +1121,8 @@
},
"TAF": {
"priority": 1,
"text": "Terminal Aerodrome Forecast"
"text": "Terminal Aerodrome Forecast",
"disable": true
},
"TAP": {
"priority": 1,
@ -1525,6 +1526,7 @@
},
"PIR": {
"text": "Pilot Reports",
"priority": 1
"priority": 1,
"disable": true
}
}

View file

@ -365,6 +365,7 @@ const handleDiscord = function (data) {
var evt = events[product_id.pil.substring(0, 3)];
evt.code = product_id.pil.substring(0, 3);
console.log(`${colors.cyan("[INFO]")} ${fromChannel} @ ${product_id.timestamp}; ${evt.code} (${evt.priority}) ${body.string}`);
if (evt.disable) return console.log(`${colors.yellow("[WARN]")} Event ${evt.code} is disabled, skipping...`);
let embed = {
description: `<t:${new Date(product_id.timestamp) / 1000}:T> <t:${new Date(product_id.timestamp) / 1000}:R> ${body.string}`,
color: parseInt(config.priorityColors[evt.priority].replace("#", ""), 16) || 0x000000,
@ -537,7 +538,14 @@ var retries = 0;
function connectWebSocket() {
console.log('Attempting to connect to WebSocket...');
const ws = new WebSocket(config.WS_URL || "wss://iem-alerter.ko4wal.radio/iem");
const ws = new WebSocket(
config.WS_URL || "wss://iem-alerter.ko4wal.radio/iem",
{
headers: {
"user-agent": "IEM-Alerter-DiscordBot/1.0 (+https://git.chrischro.me/iem-alerter/discord-bot; contact: me@ko4wal.radio)"
}
}
);
ws.on('open', () => {
console.log('Connected to WebSocket');