Merge pull request #15 from r-Overwatch2/main #18

Merged
AstroGD merged 14 commits from release/1.1.0 into main 2022-11-29 21:37:08 +01:00
2 changed files with 16 additions and 2 deletions
Showing only changes of commit dbb64baae3 - Show all commits

View File

@ -3,7 +3,7 @@ import { AuditLogEvent, Events, GuildAuditLogsEntry, PermissionFlagsBits, User }
import { getGuildSetting } from "../tools/data";
import { Badword, database } from "../data";
import { IsNull } from "typeorm";
import getDefaultEmbed, { getFailedEmbed } from "../tools/defaultEmbeds";
import getDefaultEmbed, { getFailedEmbed, getUserReportEmbed } from "../tools/defaultEmbeds";
import { getGuildChannel } from "../tools/discord";
import { Color, Emoji } from "../tools/design";
@ -89,6 +89,13 @@ client.on(Events.ChannelCreate, async (newChannel) => {
return;
}
if (responsibleUser) {
const embed = getUserReportEmbed(guild.name, newChannel.name);
responsibleUser.send({
embeds: [embed]
}).catch(() => {});
}
if (!logChannel || !logChannel.isTextBased()) return;
const embed = getDefaultEmbed();
embed.setTitle(`${Emoji.SECURITY_CHALLENGE_FAILED} Blocked word detected`);

View File

@ -3,7 +3,7 @@ import { AuditLogEvent, Events, GuildAuditLogsEntry, PermissionFlagsBits, User }
import { getGuildSetting } from "../tools/data";
import { Badword, database } from "../data";
import { IsNull } from "typeorm";
import getDefaultEmbed, { getFailedEmbed } from "../tools/defaultEmbeds";
import getDefaultEmbed, { getFailedEmbed, getUserReportEmbed } from "../tools/defaultEmbeds";
import { getGuildChannel } from "../tools/discord";
import { Color, Emoji } from "../tools/design";
@ -89,6 +89,13 @@ client.on(Events.ChannelUpdate, async (oldChannel, newChannel) => {
return;
}
if (responsibleUser) {
const embed = getUserReportEmbed(guild.name, newChannel.name);
responsibleUser.send({
embeds: [embed]
}).catch(() => {});
}
if (!logChannel || !logChannel.isTextBased()) return;
const embed = getDefaultEmbed();
embed.setTitle(`${Emoji.SECURITY_CHALLENGE_FAILED} Blocked word detected`);