private void JoinUser(string userId, string channelId) { _coffeeRepository.AddToRoster(userId); _userRepository.AddUser(userId); string text = string.Format(DougMessages.JoinedCoffee, Utils.UserMention(userId)); _slack.SendMessage(text, channelId); }
public void CoffeeRemind(string ChannelId) { var readyParticipants = _coffeeRepository.GetReadyParticipants(); var missingParticipants = _coffeeRepository.GetMissingParticipants(); var total = missingParticipants.Count + readyParticipants.Count; var userMentionList = missingParticipants .Select(userId => Utils.UserMention(userId)) .Aggregate(string.Empty, (userId, acc) => acc + " " + userId); _slack.SendMessage(string.Format(DougMessages.Remind, readyParticipants.Count, total, userMentionList), ChannelId); }