forked from ChrisChrome/weather-bot
Add discord message when unknown event type trips
This commit is contained in:
parent
9b80f79436
commit
bd275403e9
10
index.js
10
index.js
|
@ -360,6 +360,16 @@ xmpp.on("stanza", (stanza) => {
|
|||
evt = { name: "Unknown", priority: 3 }
|
||||
console.log(`${colors.red("[ERROR]")} Unknown event type: ${product_id.pil.substring(0, 3)}. Fix me`);
|
||||
console.log(`${colors.magenta("[DEBUG]")} ${bodyData.string}`)
|
||||
const logChannel = discord.guilds.cache.get(config.discord.mainGuild).channels.cache.get(config.discord.logChannel);
|
||||
logChannel.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "Unknown Event Type",
|
||||
description: `Unknown event type: ${product_id.pil.substring(0, 3)}. Please check the logs for more details.`,
|
||||
color: 0xff0000
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
evt.code = product_id.pil.substring(0, 3);
|
||||
|
|
Loading…
Reference in a new issue