diff --git a/src/shared/services/slack/slack.service.ts b/src/shared/services/slack/slack.service.ts index 104c594a..bc466ca9 100644 --- a/src/shared/services/slack/slack.service.ts +++ b/src/shared/services/slack/slack.service.ts @@ -154,6 +154,9 @@ export class SlackService { this.getAllUsers().catch((e) => this.logger.error('Error handling team join event:', e)); } else if (request.event.type === 'channel_created') { this.getAndSaveAllChannels(); + } else if (request.event.type === 'member_joined_channel') { + // Refresh channels when bot joins a new channel (including private) + this.getAndSaveAllChannels(); } } } diff --git a/src/shared/services/web/web.service.ts b/src/shared/services/web/web.service.ts index 41821b13..c2b4e246 100644 --- a/src/shared/services/web/web.service.ts +++ b/src/shared/services/web/web.service.ts @@ -115,7 +115,10 @@ export class WebService { } public getAllChannels(): Promise { - return this.web.conversations.list(); + return this.web.conversations.list({ + types: 'public_channel,private_channel', + exclude_archived: true, + }); } public uploadFile(channel: string, content: string, title: string, userId: string): void {