Skip to content

Commit

Permalink
Checking if the channel exists earlier on
Browse files Browse the repository at this point in the history
  • Loading branch information
pdellaert committed Jan 28, 2024
1 parent 2a7c9e3 commit d5b802c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/events/logging/scamLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@ const deleteFailed = makeEmbed({
});

export default event(Events.MessageCreate, async ({ log }, msg) => {
const conn = getConn();

if (msg.guild === null) {
// DM's
return;
}

const scamReportLogs = msg.guild.channels.resolve(constantsConfig.channels.SCAM_REPORT_LOGS) as TextChannel | null;
if (scamReportLogs && msg.content.toLowerCase().includes('@everyone') && !msg.author.bot) {
const scamReportLogs = msg.guild.channels.resolve(constantsConfig.channels.SCAM_REPORT_LOGS) as TextChannel | null;

const conn = getConn();
if (!conn && scamReportLogs) {
await scamReportLogs.send({ embeds: [noConnEmbed] });
return;
Expand Down

0 comments on commit d5b802c

Please sign in to comment.