mom: fix [SILENT] to delete thread messages too

Track all thread message timestamps during a run. When response is
[SILENT], delete all thread messages before deleting the main message.
This prevents the 'This message was deleted' tombstone in Slack.
This commit is contained in:
Mario Zechner 2025-12-12 22:56:56 +01:00
parent 8ba6aa6627
commit f1451fd8f0
3 changed files with 18 additions and 5 deletions

View file

@ -197,8 +197,9 @@ export class SlackBot {
await this.webClient.chat.delete({ channel, ts });
}
async postInThread(channel: string, threadTs: string, text: string): Promise<void> {
await this.webClient.chat.postMessage({ channel, thread_ts: threadTs, text });
async postInThread(channel: string, threadTs: string, text: string): Promise<string> {
const result = await this.webClient.chat.postMessage({ channel, thread_ts: threadTs, text });
return result.ts as string;
}
async uploadFile(channel: string, filePath: string, title?: string): Promise<void> {