diff options
author | Nuckyz <61953774+Nuckyz@users.noreply.github.com> | 2022-10-20 19:05:08 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 00:05:08 +0200 |
commit | d8afde2b4d03c1d46795f18db8256cd095ae1e85 (patch) | |
tree | d1946ecaf0abad82343a551034c0c64ba1643c24 /src | |
parent | a15d5de4934624911da9462c50b21dc4a9a7c53d (diff) | |
download | Vencord-d8afde2b4d03c1d46795f18db8256cd095ae1e85.tar.gz Vencord-d8afde2b4d03c1d46795f18db8256cd095ae1e85.tar.bz2 Vencord-d8afde2b4d03c1d46795f18db8256cd095ae1e85.zip |
feat(plugins): Moyai ignore bots setting (#130)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/moyai.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/moyai.ts b/src/plugins/moyai.ts index 3bb7f2e..7dc4574 100644 --- a/src/plugins/moyai.ts +++ b/src/plugins/moyai.ts @@ -5,7 +5,7 @@ import { Devs } from "../utils/constants"; import { sleep } from "../utils/misc"; import definePlugin, { OptionType } from "../utils/types"; import { Settings } from "../Vencord"; -import { FluxDispatcher, SelectedChannelStore } from "../webpack/common"; +import { FluxDispatcher, SelectedChannelStore, UserStore } from "../webpack/common"; interface IMessageCreate { type: "MESSAGE_CREATE"; @@ -28,9 +28,6 @@ const MOYAI = "🗿"; const MOYAI_URL = "https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai.mp3"; -// Implement once Settings are a thing -const ignoreBots = true; - export default definePlugin({ name: "Moyai", authors: [Devs.Megu, Devs.Nuckyz], @@ -39,7 +36,7 @@ export default definePlugin({ async onMessage(e: IMessageCreate) { if (e.optimistic || e.type !== "MESSAGE_CREATE") return; if (e.message.state === "SENDING") return; - if (ignoreBots && e.message.author?.bot) return; + if (Settings.plugins.Moyai.ignoreBots && e.message.author?.bot) return; if (!e.message.content) return; if (e.channelId !== SelectedChannelStore.getChannelId()) return; @@ -53,6 +50,7 @@ export default definePlugin({ onReaction(e: IReactionAdd) { if (e.optimistic || e.type !== "MESSAGE_REACTION_ADD") return; + if (Settings.plugins.Moyai.ignoreBots && UserStore.getUser(e.userId)?.bot) return; if (e.channelId !== SelectedChannelStore.getChannelId()) return; const name = e.emoji.name.toLowerCase(); @@ -84,6 +82,12 @@ export default definePlugin({ type: OptionType.BOOLEAN, default: true, restartNeeded: false, + }, + ignoreBots: { + description: "Ignore bots", + type: OptionType.BOOLEAN, + default: true, + restartNeeded: false, } } }); |