refactor(channels): share reset message construction across adapters
This commit is contained in:
@@ -15,7 +15,7 @@ import type {
|
||||
ChannelAdapter,
|
||||
ChannelStatus,
|
||||
} from '../types.js';
|
||||
import { normalizeResetCommandText, splitMessage } from '../utils.js';
|
||||
import { buildResetInboundMessage, normalizeResetCommandText, splitMessage } from '../utils.js';
|
||||
import type { PairingManager } from '../pairing.js';
|
||||
|
||||
/** Configuration for the Slack channel adapter. */
|
||||
@@ -357,16 +357,13 @@ export class SlackAdapter implements ChannelAdapter {
|
||||
|
||||
// Detect reset command
|
||||
if (text === '!reset') {
|
||||
this.messageHandler({
|
||||
this.messageHandler(buildResetInboundMessage({
|
||||
id: message.ts ?? '',
|
||||
channel: 'slack',
|
||||
senderId: peerId,
|
||||
senderName,
|
||||
text: '!reset',
|
||||
timestamp: Date.now(),
|
||||
metadata: { isCommand: true, command: 'reset' },
|
||||
...(attachments.length > 0 && { attachments }),
|
||||
});
|
||||
attachments,
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user