fix: add-voice-transcription skill drops WhatsApp registerChannel call (#766)
The modify/src/channels/whatsapp.ts patch in the add-voice-transcription skill was missing the registerChannel() call and its registry import. When the three-way merge ran, this caused the WhatsApp channel to silently skip registration on every service restart — messages were never received. Added the missing import and registerChannel factory with a creds.json guard, matching the pattern used by the add-whatsapp skill template. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
import { logger } from '../logger.js';
|
||||
import { isVoiceMessage, transcribeAudioMessage } from '../transcription.js';
|
||||
import { Channel, OnInboundMessage, OnChatMetadata, RegisteredGroup } from '../types.js';
|
||||
import { registerChannel, ChannelOpts } from './registry.js';
|
||||
|
||||
const GROUP_SYNC_INTERVAL_MS = 24 * 60 * 60 * 1000; // 24 hours
|
||||
|
||||
@@ -354,3 +355,12 @@ export class WhatsAppChannel implements Channel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
registerChannel('whatsapp', (opts: ChannelOpts) => {
|
||||
const authDir = path.join(STORE_DIR, 'auth');
|
||||
if (!fs.existsSync(path.join(authDir, 'creds.json'))) {
|
||||
logger.warn('WhatsApp: credentials not found. Run /add-whatsapp to authenticate.');
|
||||
return null;
|
||||
}
|
||||
return new WhatsAppChannel(opts);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user