Feature/49 ignore channel lists when logging #168

Merged
Vylpes merged 3 commits from feature/49-ignore-channel-lists-when-logging into develop 2022-07-16 16:12:56 +01:00
Showing only changes of commit c3e118fd3d - Show all commits

View file

@ -3,6 +3,7 @@ import { Message } from "discord.js";
import EventEmbed from "../helpers/embeds/EventEmbed";
import SettingsHelper from "../helpers/SettingsHelper";
import OnMessage from "./MessageEvents/OnMessage";
import IgnoredChannel from "../entity/IgnoredChannel";
export default class MessageEvents extends Event {
constructor() {
@ -16,6 +17,9 @@ export default class MessageEvents extends Event {
const enabled = await SettingsHelper.GetSetting("event.message.delete.enabled", message.guild.id);
if (!enabled || enabled.toLowerCase() != "true") return;
const ignored = await IgnoredChannel.IsChannelIgnored(message.channel.id);
if (ignored) return;
const embed = new EventEmbed(message.client, message.guild, "Message Deleted");
embed.AddUser("User", message.author, true);
embed.addField("Channel", message.channel.toString(), true);
@ -39,6 +43,9 @@ export default class MessageEvents extends Event {
const enabled = await SettingsHelper.GetSetting("event.message.update.enabled", newMessage.guild.id);
if (!enabled || enabled.toLowerCase() != "true") return;
const ignored = await IgnoredChannel.IsChannelIgnored(newMessage.channel.id);
if (ignored) return;
const embed = new EventEmbed(newMessage.client, newMessage.guild, "Message Edited");
embed.AddUser("User", newMessage.author, true);
embed.addField("Channel", newMessage.channel.toString(), true);