refactor(channels): share reset message construction across adapters
This commit is contained in:
@@ -17,7 +17,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 Discord channel adapter. */
|
||||
@@ -242,15 +242,12 @@ export class DiscordAdapter implements ChannelAdapter {
|
||||
|
||||
// ── Reset command ──
|
||||
if (text === '!reset') {
|
||||
this.messageHandler({
|
||||
this.messageHandler(buildResetInboundMessage({
|
||||
id: message.id,
|
||||
channel: 'discord',
|
||||
senderId: message.channelId,
|
||||
senderName: message.author.username,
|
||||
text: '!reset',
|
||||
timestamp: Date.now(),
|
||||
metadata: { isCommand: true, command: 'reset' },
|
||||
});
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user