messageLogger: fix ingore guild (#1632)

This commit is contained in:
AutumnVN 2023-08-11 11:10:49 +07:00 committed by GitHub
parent abdf4ebb05
commit 6e7996659f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,7 +26,7 @@ import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger"; import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack"; import { findByPropsLazy } from "@webpack";
import { FluxDispatcher, i18n, Menu, moment, Parser, Timestamp, UserStore } from "@webpack/common"; import { ChannelStore, FluxDispatcher, i18n, Menu, moment, Parser, Timestamp, UserStore } from "@webpack/common";
import overlayStyle from "./deleteStyleOverlay.css?managed"; import overlayStyle from "./deleteStyleOverlay.css?managed";
import textStyle from "./deleteStyleText.css?managed"; import textStyle from "./deleteStyleText.css?managed";
@ -92,7 +92,7 @@ const patchMessageContextMenu: NavContextMenuPatchCallback = (children, props) =
export default definePlugin({ export default definePlugin({
name: "MessageLogger", name: "MessageLogger",
description: "Temporarily logs deleted and edited messages.", description: "Temporarily logs deleted and edited messages.",
authors: [Devs.rushii, Devs.Ven], authors: [Devs.rushii, Devs.Ven, Devs.AutumnVN],
start() { start() {
addDeleteStyle(); addDeleteStyle();
@ -183,7 +183,7 @@ export default definePlugin({
ignoreSelf && msg.author?.id === myId || ignoreSelf && msg.author?.id === myId ||
ignoreUsers.includes(msg.author?.id) || ignoreUsers.includes(msg.author?.id) ||
ignoreChannels.includes(msg.channel_id) || ignoreChannels.includes(msg.channel_id) ||
ignoreGuilds.includes(msg.guild_id); ignoreGuilds.includes(ChannelStore.getChannel(msg.channel_id)?.guild_id);
if (shouldIgnore) { if (shouldIgnore) {
cache = cache.remove(id); cache = cache.remove(id);