fix(mom): private channel messages not being logged

- Add message.groups to required bot events in README
- Add groups:history and groups:read to required scopes in README
- app_mention handler now logs messages directly instead of relying on message event
- Add deduplication in ChannelStore.logMessage() to prevent double-logging
- Remove redundant current message append in agent.ts (already in log)
This commit is contained in:
Mario Zechner 2025-12-04 12:24:29 +01:00
parent db6d655ee9
commit 706554a5d3
6 changed files with 67 additions and 11 deletions

View file

@ -208,7 +208,6 @@ export class MomBot {
private setupEventHandlers(): void {
// Handle @mentions in channels
// Note: We don't log here - the message event handler logs all messages
this.socketClient.on("app_mention", async ({ event, ack }) => {
await ack();
@ -220,6 +219,15 @@ export class MomBot {
files?: Array<{ name: string; url_private_download?: string; url_private?: string }>;
};
// Log the mention message (message event may not fire for all channel types)
await this.logMessage({
text: slackEvent.text,
channel: slackEvent.channel,
user: slackEvent.user,
ts: slackEvent.ts,
files: slackEvent.files,
});
const ctx = await this.createContext(slackEvent);
await this.handler.onChannelMention(ctx);
});