public async Task <TaskModuleResponse> Handle(Activity activity, IUrlHelper urlHelper) { var invokeActionData = activity.GetInvokeActionData(); var competition = await _competitionService.GetCompetition(invokeActionData.CompetitionId); var errorMessage = CanActivateCompetition(competition); if (!string.IsNullOrEmpty(errorMessage)) { return(_activityBuilder.CreateDraftCompetitionEditTaskInfoResponse(competition, errorMessage, activity.Locale)); } competition = await _competitionService.ActivateCompetition(competition.Id); var mainActivity = _activityBuilder.CreateMainActivity(competition); using (var botClient = _botClientFactory.CreateBotClient(activity.ServiceUrl)) { await botClient.UpdateActivityAsync(competition.ChannelId, competition.MainActivityId, mainActivity); } await _timerService.AddScheduledHttpRequest( competition.PlannedDrawTime, "POST", urlHelper.Action(nameof(CompetitionsController.DrawForCompetition), "Competitions", new { competitionId = competition.Id })); return(null); }