private async Task SendSlurToChannel(Command command, Slur slur) { var users = _userRepository.GetUsers(); var rnd = new Random(); var randomUser = users.ElementAt(rnd.Next(users.Count)).Id; var message = BuildSlurMessage(slur.Text, randomUser, command.GetTargetUserId()); message = _itemEventDispatcher.OnFlaming(command, message); var timestamp = await _slack.BroadcastMessage(message, command.ChannelId); _slurRepository.LogRecentSlur(slur.Id, timestamp); await _slack.AddReaction(DougMessages.UpVote, timestamp, command.ChannelId); await _slack.AddReaction(DougMessages.Downvote, timestamp, command.ChannelId); }
public async Task <DougResponse> StartRevolutionVote(User leader, string channel) { var government = _governmentRepository.GetGovernment(); if (government.IsInRevolutionCooldown()) { return(new DougResponse(string.Format(DougMessages.RevolutionCooldown, government.CalculateRevolutionCooldown()))); } var timestamp = await _slack.BroadcastMessage(string.Format(DougMessages.RevolutionVote, _userService.Mention(leader)), channel); await _slack.AddReaction(DougMessages.UpVote, timestamp, channel); await _slack.AddReaction(DougMessages.Downvote, timestamp, channel); _governmentRepository.StartRevolutionVote(leader.Id, timestamp); return(new DougResponse()); }