diff options
author | Luca Zeuch <l-zeuch@email.de> | 2023-07-14 18:21:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-14 18:21:29 +0200 |
commit | 1340f023a3c7f5e16e9fc476c7198a6afaa2f475 (patch) | |
tree | e60c8d4fbdfa05f758a5630a17ff707d7089336a /src/plugins/messageLogger/index.tsx | |
parent | 2bf0c324d71c0da628209dacf7afce1b7bb378f8 (diff) | |
download | Vencord-1340f023a3c7f5e16e9fc476c7198a6afaa2f475.tar.gz Vencord-1340f023a3c7f5e16e9fc476c7198a6afaa2f475.tar.bz2 Vencord-1340f023a3c7f5e16e9fc476c7198a6afaa2f475.zip |
feat(MessageLogger): add option to ignore channels and guilds (#1420)
Diffstat (limited to 'src/plugins/messageLogger/index.tsx')
-rw-r--r-- | src/plugins/messageLogger/index.tsx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index 2041f70..162db54 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -152,14 +152,24 @@ export default definePlugin({ type: OptionType.STRING, description: "Comma-separated list of user IDs to ignore", default: "" - } + }, + ignoreChannels: { + type: OptionType.STRING, + description: "Comma-separated list of channel IDs to ignore", + default: "" + }, + ignoreGuilds: { + type: OptionType.STRING, + description: "Comma-separated list of guild IDs to ignore", + default: "" + }, }, handleDelete(cache: any, data: { ids: string[], id: string; mlDeleted?: boolean; }, isBulk: boolean) { try { if (cache == null || (!isBulk && !cache.has(data.id))) return cache; - const { ignoreBots, ignoreSelf, ignoreUsers } = Settings.plugins.MessageLogger; + const { ignoreBots, ignoreSelf, ignoreUsers, ignoreChannels, ignoreGuilds } = Settings.plugins.MessageLogger; const myId = UserStore.getCurrentUser().id; function mutate(id: string) { @@ -171,7 +181,9 @@ export default definePlugin({ (msg.flags & EPHEMERAL) === EPHEMERAL || ignoreBots && msg.author?.bot || ignoreSelf && msg.author?.id === myId || - ignoreUsers.includes(msg.author?.id); + ignoreUsers.includes(msg.author?.id) || + ignoreChannels.includes(msg.channel_id) || + ignoreGuilds.includes(msg.guild_id); if (shouldIgnore) { cache = cache.remove(id); |