Exemple #1
0
        //TODO: Cache newly created channel, and return if already exists
        public async Task <SlackChatHub> JoinDirectMessageChannel(string user)
        {
            if (string.IsNullOrEmpty(user))
            {
                throw new ArgumentNullException(nameof(user));
            }

            IChannelMessenger client  = _connectionFactory.CreateChannelMessenger();
            Channel           channel = await client.JoinDirectMessageChannel(SlackKey, user);

            return(new SlackChatHub
            {
                Id = channel.Id,
                Name = channel.Name,
                Type = SlackChatHubType.DM
            });
        }