Add message to log channel about failed sends

This commit is contained in:
Christopher Cookman 2025-01-12 03:00:31 -07:00
parent f763a95472
commit cbb1842100

View file

@ -475,6 +475,50 @@ xmpp.on("stanza", (stanza) => {
if (msg.channel.type === Discord.ChannelType.GuildAnnouncement) msg.crosspost();
}).catch((err) => {
console.log(`${colors.yellow("[WARN]")} Failed to send message to ${channel.guild.name}/${channel.name} (${channel.guild.id}/${channel.id})`);
const logChannel = discord.guilds.cache.get(config.discord.mainGuild).channels.cache.get(config.discord.logChannel);
logChannel.send({
embeds: [
{
title: "Failed to send message",
description: `There is likely an issue with permissions. Please notify the server owner if possible.`,
fields: [
{
name: "Guild",
value: `${channel.guild.name} (\`${channel.guild.id}\`)`
},
{
name: "Channel",
value: `<#${channel.id}> (\`${channel.id}\`)`
},
{
name: "Guild Owner",
value: `<@${channel.guild.ownerId}> (\`${channel.guild.ownerId}\`)`
},
{
name: "Subscribed Room",
value: `\`${fromChannel}\``
},
{
name: "Custom Message",
value: row.custommessage || "None"
},
{
name: "Filter",
value: row.filter || "None"
},
{
name: "Event Filter",
value: row.filterEvt || "None"
},
{
name: "Minimum Priority",
value: row.minPriority.toString()
}
],
color: 0x00ff00
}
]
});
});
});
}).catch((err) => {