forked from ChrisChrome/weather-bot
Add message to log channel about failed sends
This commit is contained in:
parent
f763a95472
commit
cbb1842100
44
index.js
44
index.js
|
@ -475,6 +475,50 @@ xmpp.on("stanza", (stanza) => {
|
||||||
if (msg.channel.type === Discord.ChannelType.GuildAnnouncement) msg.crosspost();
|
if (msg.channel.type === Discord.ChannelType.GuildAnnouncement) msg.crosspost();
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log(`${colors.yellow("[WARN]")} Failed to send message to ${channel.guild.name}/${channel.name} (${channel.guild.id}/${channel.id})`);
|
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) => {
|
}).catch((err) => {
|
||||||
|
|
Loading…
Reference in a new issue