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 }