public override async Task Initialize() { var oAuthToken = AuthorizationToken.Token; ActivityUI.ChannelList.ListItems = (await _slackIntegration.GetChannelList(oAuthToken, false)) .OrderBy(x => x.Key) .Select(x => new ListItem { Key = $"#{x.Key}", Value = x.Value }) .ToList(); EventSubscriptions.Manufacturer = "Slack"; EventSubscriptions.Add("Slack Outgoing Message"); CrateSignaller.MarkAvailableAtRuntime <StandardPayloadDataCM>(ResultPayloadCrateLabel) .AddField("token") .AddField("team_id") .AddField("team_domain") .AddField("service_id") .AddField("timestamp") .AddField("channel_id") .AddField("channel_name") .AddField("user_id") .AddField("user_name") .AddField("text"); }
public override async Task Initialize() { var usersTask = _slackIntegration.GetUserList(AuthorizationToken.Token); var channelsTask = _slackIntegration.GetChannelList(AuthorizationToken.Token); await Task.WhenAll(usersTask, channelsTask).ConfigureAwait(false); var channelsAndUsersList = new List <ListItem>(usersTask.Result.Count + channelsTask.Result.Count); channelsAndUsersList.AddRange(channelsTask.Result .OrderBy(x => x.Key) .Select(x => new ListItem { Key = $"#{x.Key}", Value = x.Value })); channelsAndUsersList.AddRange(usersTask.Result .OrderBy(x => x.Key) .Select(x => new ListItem { Key = $"@{x.Key}", Value = x.Value })); ActivityUI.ChannelSelector.ListItems = channelsAndUsersList; }