Clean duplicate dashboard status messages

Clean duplicate Status dashboard messages by marker, preserve the tracked message, and avoid full-channel purge on startup.
This commit is contained in:
Eyejoker
2026-05-03 23:56:07 +09:00
committed by GitHub
parent a4b7aef3bd
commit 2be267c51e
8 changed files with 367 additions and 23 deletions

View File

@@ -17,7 +17,12 @@ import { logger } from '../logger.js';
import { validateOutboundAttachments } from '../outbound-attachments.js';
import { formatOutbound } from '../router.js';
import { hasReviewerLease } from '../service-routing.js';
import type { SendMessageOptions, SendMessageResult } from '../types.js';
import type {
DeleteRecentMessagesByContentOptions,
SendMessageOptions,
SendMessageResult,
} from '../types.js';
import { deleteRecentDiscordMessagesByContent } from './discord-message-cleanup.js';
import { prepareDiscordOutbound } from './discord-outbound.js';
const ATTACHMENTS_DIR = path.join(DATA_DIR, 'attachments');
@@ -760,6 +765,18 @@ export class DiscordChannel implements Channel {
return deleted;
}
async deleteRecentMessagesByContent(
jid: string,
options: DeleteRecentMessagesByContentOptions,
): Promise<number> {
return deleteRecentDiscordMessagesByContent({
client: this.client,
channelName: this.name,
jid,
options,
});
}
async editMessage(
jid: string,
messageId: string,