diff options
-rw-r--r-- | src/plugins/moyai.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/moyai.ts b/src/plugins/moyai.ts index 0a8a51f..5427fed 100644 --- a/src/plugins/moyai.ts +++ b/src/plugins/moyai.ts @@ -42,6 +42,15 @@ interface IReactionAdd { emoji: ReactionEmoji; } +interface IVoiceChannelEffectSendEvent { + type: string; + emoji?: ReactionEmoji; // Just in case... + channelId: string; + userId: string; + animationType: number; + animationId: number; +} + const MOYAI = "🗿"; const MOYAI_URL = "https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai.mp3"; @@ -77,14 +86,24 @@ export default definePlugin({ boom(); }, + onVoiceChannelEffect(e: IVoiceChannelEffectSendEvent) { + if (!e.emoji?.name) return; + const name = e.emoji.name.toLowerCase(); + if (name !== MOYAI && !name.includes("moyai") && !name.includes("moai")) return; + + boom(); + }, + start() { FluxDispatcher.subscribe("MESSAGE_CREATE", this.onMessage); FluxDispatcher.subscribe("MESSAGE_REACTION_ADD", this.onReaction); + FluxDispatcher.subscribe("VOICE_CHANNEL_EFFECT_SEND", this.onVoiceChannelEffect); }, stop() { FluxDispatcher.unsubscribe("MESSAGE_CREATE", this.onMessage); FluxDispatcher.unsubscribe("MESSAGE_REACTION_ADD", this.onReaction); + FluxDispatcher.unsubscribe("VOICE_CHANNEL_EFFECT_SEND", this.onVoiceChannelEffect); }, options: { |