Skip to content

Commit

Permalink
Merge pull request #1084 from magarma/patch-12
Browse files Browse the repository at this point in the history
General channel is not created by default anymore, check first channel when creating and initialize Teams
  • Loading branch information
gautamdsheth authored Nov 9, 2024
2 parents c9445b1 + d6e0ebf commit 57b7bc2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2010,12 +2010,12 @@ public static void InitTeamDrive(string teamId, string accessToken, Uri graphBas
}

var existingChannels = JToken.Parse(channels)["value"];

var existingChannel = existingChannels?.FirstOrDefault(x => x["displayName"].ToString() == "General");
var existingChannel = existingChannels?.FirstOrDefault();

if (existingChannel == null)
{
throw new Exception($"Could not get General channel of team with id {teamId}.");
throw new Exception($"Could not get any channel for team with id {teamId}.");
}

wait = true;
Expand All @@ -2039,7 +2039,7 @@ public static void InitTeamDrive(string teamId, string accessToken, Uri graphBas

if (iterations > 60)
{
throw new Exception($"Could not get drive item of General channel in team with id {teamId} within timeout.");
throw new Exception($"Could not get drive item of first channel in team with id {teamId} within timeout.");
}
}
}
Expand Down

0 comments on commit 57b7bc2

Please sign in to comment.