mom: add [SILENT] response marker for periodic events

When mom responds with just [SILENT], the status message is deleted
and nothing is posted to Slack. Useful for periodic events that check
for activity but find nothing to report.
This commit is contained in:
Mario Zechner 2025-12-12 22:50:12 +01:00
parent d6809328da
commit 8ba6aa6627
5 changed files with 36 additions and 1 deletions

View file

@ -62,6 +62,7 @@ export interface SlackContext {
setTyping: (isTyping: boolean) => Promise<void>;
uploadFile: (filePath: string, title?: string) => Promise<void>;
setWorking: (working: boolean) => Promise<void>;
deleteMessage: () => Promise<void>;
}
export interface MomHandler {
@ -192,6 +193,10 @@ export class SlackBot {
await this.webClient.chat.update({ channel, ts, text });
}
async deleteMessage(channel: string, ts: string): Promise<void> {
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 });
}