refactor(channels): share reset-command normalization utility

This commit is contained in:
William Valentin
2026-02-15 22:22:40 -08:00
parent 05d8abc79d
commit 8b529a18f2
7 changed files with 59 additions and 11 deletions
+4 -2
View File
@@ -17,7 +17,7 @@ import type {
ChannelAdapter,
ChannelStatus,
} from '../types.js';
import { splitMessage } from '../utils.js';
import { normalizeResetCommandText, splitMessage } from '../utils.js';
import type { PairingManager } from '../pairing.js';
/** Configuration for the WhatsApp channel adapter. */
@@ -309,8 +309,10 @@ export class WhatsAppAdapter implements ChannelAdapter {
}
}
text = normalizeResetCommandText(text);
// Detect reset command
if (text === '!reset' || text === 'reset') {
if (text === '!reset') {
this.messageHandler({
id: message.id.id,
channel: 'whatsapp',