From 20ee95503068d647d366d7fbd46403dcb6493c2b Mon Sep 17 00:00:00 2001 From: "GeonWoo Jeon (Jay)" Date: Tue, 7 Apr 2026 22:49:37 +0900 Subject: [PATCH] fix(openclaw): stop stale listeners during initialization --- src/openclaw/index.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/openclaw/index.ts b/src/openclaw/index.ts index 5cbbe3362..cf352ab21 100644 --- a/src/openclaw/index.ts +++ b/src/openclaw/index.ts @@ -132,10 +132,16 @@ export async function wakeOpenClaw( } export async function initializeOpenClaw(config: OpenClawConfig): Promise { - const replyListener = config.replyListener - if (config.enabled && (replyListener?.discordBotToken || replyListener?.telegramBotToken)) { + const hasReplyListenerCredentials = Boolean( + config.replyListener?.discordBotToken || config.replyListener?.telegramBotToken, + ) + + if (config.enabled && hasReplyListenerCredentials) { await startReplyListener(config) + return } + + await stopReplyListener() } export { startReplyListener, stopReplyListener }