public static async Task <bool> RelayMessageToAgentIfThereIsAnOpenResearchProject(IDialogContext context) { int?vsoId = await GetResearchVsoIdFromVso(context.Activity.ChannelId, context.Activity.From.Name); if (vsoId == null) { return(false); } var userProfile = await UserProfileHelper.GetUserProfile(context); context.UserData.SetValue(UserProfileHelper.UserProfileKey, userProfile); string agentConversationId = await VsoHelper.GetAgentConversationIdForVso((int)vsoId); if (string.IsNullOrEmpty(agentConversationId)) { return(false); } await context.PostWithRetryAsync("OK, I'll add that to the project."); //await SendAutoReplyIfNeeded(context, vsoId); IMessageActivity messageActivity = (IMessageActivity)context.Activity; if (ActivityHelper.HasAttachment(messageActivity)) { await context.PostWithRetryAsync( $"Sending file attachments is not supported. " + $"Please send it via an accessible link within Microsoft"); } else { await ActivityHelper.SendMessageToAgentAsReplyToConversationInAgentsChannel( messageActivity, messageActivity.Text, agentConversationId, (int)vsoId); } await OnlineStatus.SetMemberActive(context.Activity.From.Name, context.Activity.From.Id, OnlineStatus.EndUserMemberType); return(true); }