From 9b1b8852d0427d0658c13a0da4028e4572ea5eac Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Sat, 13 Dec 2025 09:42:47 +0000 Subject: [PATCH] Fix stream checker error by correctly passing Supabase client Modify listener registration in bot.js to ensure the Supabase client is correctly passed to the stream checker, resolving the "supabase.from is not a function" error by addressing argument handling for the 'ready' event. Replit-Commit-Author: Agent Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 15e978ac-af85-4dc5-a34f-c363c14b4cba Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/3tJ1Z1J Replit-Helium-Checkpoint-Created: true --- aethex-bot/bot.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/aethex-bot/bot.js b/aethex-bot/bot.js index 998686b..794459c 100644 --- a/aethex-bot/bot.js +++ b/aethex-bot/bot.js @@ -844,7 +844,17 @@ for (const file of generalListenerFiles) { if (fs.existsSync(filePath)) { const listener = require(filePath); if ("name" in listener && "execute" in listener) { - client.on(listener.name, (...args) => listener.execute(...args, client, supabase)); + // For 'ready' event: no args are passed, so call execute(client, supabase) directly + // For other events (messageCreate, etc.): args are passed, then client/supabase + if (listener.name === 'ready') { + if (listener.once) { + client.once(listener.name, () => listener.execute(client, supabase)); + } else { + client.on(listener.name, () => listener.execute(client, supabase)); + } + } else { + client.on(listener.name, (...args) => listener.execute(...args, client, supabase)); + } console.log(`Loaded listener: ${file}`); } }