Пример #1
0
        public override async Task SetupAsync()
        {
            _rtm = await StartRtmAsync();

            // Create channels
            foreach (var channel in _rtm.Channels)
            {
                _channels.Add(new Channel(channel.Id, channel.Name, new MessagePoster(_accessToken)));
            }

            foreach (var group in _rtm.Groups)
            {
                _channels.Add(new Channel(group.Id, group.Name, new MessagePoster(_accessToken)));
            }

            foreach (var im in _rtm.Ims)
            {
                _channels.Add(new Channel(im.Id, $"IM with {im.UserId}", new MessagePoster(_accessToken)));
            }

            // Add users to our local cache of team members
            foreach (var user in _rtm.Users)
            {
                _users.Add(new User(user.Id, user.Name));
            }
        }
Пример #2
0
 public override async Task SetupAsync()
 {
     _rtm = await StartRtmAsync();
 }