File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -444,13 +444,17 @@ export class TeamSyncer {
444444 existingMatrixUsersSet . add ( u ) ;
445445 }
446446
447- const slackUsers = await client . conversations . members ( { channel : channelId } ) as ConversationsMembersResponse ;
448- await Promise . all (
449- slackUsers . members . map ( async ( slackUserId ) => {
450- const ghost = await this . main . ghostStore . get ( slackUserId , teamInfo . domain , teamId ) ;
451- slackUsersSet . add ( ghost . matrixUserId ) ;
452- } )
453- ) ;
447+ let cursor = '' ;
448+ do {
449+ const slackUsers = await client . conversations . members ( { channel : channelId , limit : 1000 , cursor} ) as ConversationsMembersResponse ;
450+ await Promise . all (
451+ slackUsers . members . map ( async ( slackUserId ) => {
452+ const ghost = await this . main . ghostStore . get ( slackUserId , teamInfo . domain , teamId ) ;
453+ slackUsersSet . add ( ghost . matrixUserId ) ;
454+ } )
455+ ) ;
456+ cursor = slackUsers . response_metadata . next_cursor ;
457+ } while ( cursor !== "" ) ;
454458
455459 const joinedUsers : string [ ] = [ ] ;
456460 slackUsersSet . forEach ( ( u ) => {
You can’t perform that action at this time.
0 commit comments