aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorActuallyTheSun <78964224+ActuallyTheSun@users.noreply.github.com>2023-06-25 19:31:39 +0300
committerGitHub <noreply@github.com>2023-06-25 18:31:39 +0200
commit8472c3823eb6bf4338f4631e8485c30a64568948 (patch)
tree55c8d41f84d6a75cfbbe909fad3b1a6df6718a3b /src
parent2103e5211558447614c7242f7c2d14f80eadee5f (diff)
downloadVencord-8472c3823eb6bf4338f4631e8485c30a64568948.tar.gz
Vencord-8472c3823eb6bf4338f4631e8485c30a64568948.tar.bz2
Vencord-8472c3823eb6bf4338f4631e8485c30a64568948.zip
feat(🗿): ignore blocked users (#1327)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/moyai.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/moyai.ts b/src/plugins/moyai.ts
index 1a48bd6..b8d76da 100644
--- a/src/plugins/moyai.ts
+++ b/src/plugins/moyai.ts
@@ -21,7 +21,7 @@ import { makeRange } from "@components/PluginSettings/components/SettingSliderCo
import { Devs } from "@utils/constants";
import { sleep } from "@utils/misc";
import definePlugin, { OptionType } from "@utils/types";
-import { SelectedChannelStore, UserStore } from "@webpack/common";
+import { RelationshipStore, SelectedChannelStore, UserStore } from "@webpack/common";
import { Message, ReactionEmoji } from "discord-types/general";
interface IMessageCreate {
@@ -37,6 +37,7 @@ interface IReactionAdd {
optimistic: boolean;
channelId: string;
messageId: string;
+ messageAuthorId: string;
userId: "195136840355807232";
emoji: ReactionEmoji;
}
@@ -71,6 +72,11 @@ const settings = definePluginSettings({
description: "Ignore bots",
type: OptionType.BOOLEAN,
default: true
+ },
+ ignoreBlocked: {
+ description: "Ignore blocked users",
+ type: OptionType.BOOLEAN,
+ default: true
}
});
@@ -85,6 +91,7 @@ export default definePlugin({
if (optimistic || type !== "MESSAGE_CREATE") return;
if (message.state === "SENDING") return;
if (settings.store.ignoreBots && message.author?.bot) return;
+ if (settings.store.ignoreBlocked && RelationshipStore.isBlocked(message.author?.id)) return;
if (!message.content) return;
if (channelId !== SelectedChannelStore.getChannelId()) return;
@@ -96,9 +103,10 @@ export default definePlugin({
}
},
- MESSAGE_REACTION_ADD({ optimistic, type, channelId, userId, emoji }: IReactionAdd) {
+ MESSAGE_REACTION_ADD({ optimistic, type, channelId, userId, messageAuthorId, emoji }: IReactionAdd) {
if (optimistic || type !== "MESSAGE_REACTION_ADD") return;
if (settings.store.ignoreBots && UserStore.getUser(userId)?.bot) return;
+ if (settings.store.ignoreBlocked && RelationshipStore.isBlocked(messageAuthorId)) return;
if (channelId !== SelectedChannelStore.getChannelId()) return;
const name = emoji.name.toLowerCase();