refactor(channels): share reset-command normalization utility
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user