diff --git a/src/core/plugins/Max Verstappen/Max Verstappen.mp3 b/src/core/plugins/Max Verstappen/Max Verstappen.mp3 deleted file mode 100644 index 15053a3..0000000 Binary files a/src/core/plugins/Max Verstappen/Max Verstappen.mp3 and /dev/null differ diff --git a/src/core/plugins/Max Verstappen/index.ts b/src/core/plugins/Max Verstappen/index.ts deleted file mode 100644 index 9e0df3e..0000000 --- a/src/core/plugins/Max Verstappen/index.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { defineCorePlugin } from ".."; -import { findByProps } from "@metro"; -import { after } from "@lib/api/patcher"; -import { logger } from "@lib/utils/logger"; - -const AUDIO_URL = "https://github.com/OTKUSteyler/GoonCord/raw/refs/heads/main/src/core/plugins/Max%20Verstappen/Max%20Verstappen.mp3"; -const TRIGGER_CHANCE = 0.33; -const MAX_PATTERN = /\bmax\s*verstappen\b/i; - -let audioInstance: any = null; - -function playAudio() { - try { - const Sound = findByProps("play", "stop", "release"); - if (!Sound) { - logger.error("[MaxVerstappen] Could not find audio module"); - return; - } - if (audioInstance) { - audioInstance.stop(); - audioInstance.release(); - audioInstance = null; - } - audioInstance = new Sound(AUDIO_URL, null, (error: any) => { - if (error) { - logger.error("[MaxVerstappen] Failed to load audio", error); - return; - } - audioInstance.play((success: boolean) => { - if (!success) logger.error("[MaxVerstappen] Playback failed"); - audioInstance?.release(); - audioInstance = null; - }); - }); - } catch (e) { - logger.error("[MaxVerstappen] Audio error", e); - } -} - -function shouldTrigger(): boolean { - return Math.random() < TRIGGER_CHANCE; -} - -function checkText(text: string): boolean { - return MAX_PATTERN.test(text) && shouldTrigger(); -} - -export default defineCorePlugin({ - manifest: { - id: "bunny.maxverstappen", - version: "1.0.0", - type: "plugin", - spec: 3, - main: "", - display: { - name: "Max Verstappen", - description: "Plays audio when Max Verstappen is mentioned (33% chance)", - authors: [{ name: "GoonCord Team" }], - }, - }, - - start() { - const FluxDispatcher = findByProps("dispatch", "subscribe"); - if (FluxDispatcher) { - FluxDispatcher.subscribe("MESSAGE_CREATE", ({ message }: any) => { - if (!message?.content) return; - if (checkText(message.content)) { - logger.log("[MaxVerstappen] Triggered on received message!"); - playAudio(); - } - }); - - FluxDispatcher.subscribe("MESSAGE_SEND", ({ message }: any) => { - if (!message?.content) return; - if (checkText(message.content)) { - logger.log("[MaxVerstappen] Triggered on sent message!"); - playAudio(); - } - }); - } - - logger.log("[MaxVerstappen] Enabled"); - }, - - stop() { - if (audioInstance) { - audioInstance.stop(); - audioInstance.release(); - audioInstance = null; - } - - const FluxDispatcher = findByProps("dispatch", "subscribe"); - if (FluxDispatcher) { - FluxDispatcher.unsubscribe("MESSAGE_CREATE"); - FluxDispatcher.unsubscribe("MESSAGE_SEND"); - } - - logger.log("[MaxVerstappen] Disabled"); - }, -});