{"action":"created","comment":{"url":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/comments/174041635","pull_request_review_id":103325706,"id":174041635,"diff_hunk":"@@ -0,0 +1,77 @@\n+﻿using System;\n+using System.Threading;\n+using System.Threading.Tasks;\n+using Microsoft.Bot.Connector;\n+using Microsoft.Bot.Connector.Authentication;\n+using Microsoft.Bot.Schema;\n+using Microsoft.Extensions.Logging;\n+using SchedulerBot.Business.Entities;\n+using SchedulerBot.Database.Entities;\n+using SchedulerBot.Infrastructure.Interfaces.BotConnector;\n+\n+namespace SchedulerBot.Infrastructure.BotConnector\n+{\n+\tpublic class MessageProcessor : IMessageProcessor\n+\t{\n+\t\tprivate readonly AppCredentials appCredentials;\n+\t\tprivate readonly ILogger<MessageProcessor> logger;\n+\n+\t\tpublic MessageProcessor(\n+\t\t\tAppCredentials appCredentials,\n+\t\t\tILogger<MessageProcessor> logger)\n+\t\t{\n+\t\t\tthis.appCredentials = appCredentials;\n+\t\t\tthis.logger = logger;\n+\t\t}\n+\n+\t\tpublic async Task SendMessageAsync(ScheduledMessage scheduledMessage, CancellationToken cancellationToken)\n+\t\t{\n+\t\t\tMicrosoftAppCredentials credentials = BuildMicrosoftAppCredentials();\n+\n+\t\t\tUri serviceUri = new Uri(scheduledMessage.Details.ServiceUrl);\n+\t\t\tActivity activity = CreateBotMessageActivity(scheduledMessage);\n+\n+\t\t\tusing (ConnectorClient connector = new ConnectorClient(serviceUri, credentials))\n+\t\t\t{\n+\t\t\t\tlogger.LogInformation($\"Sending message to conversation RecipientId: ${activity.Recipient.Id}.\");\n+\t\t\t\tawait connector.Conversations.SendToConversationAsync(activity, cancellationToken);\n+\t\t\t}\n+\t\t}\n+\n+\t\tpublic Task<ResourceResponse> ReplyAsync(Activity activity, string replyText)","path":"SchedulerBot/SchedulerBot.Infrastructure.BotConnector/MessageProcessor.cs","position":41,"original_position":41,"commit_id":"c96f00850bf541a89903b17c152fbbcbe04f6ba3","original_commit_id":"c96f00850bf541a89903b17c152fbbcbe04f6ba3","user":{"login":"akravch","id":8524964,"avatar_url":"https://avatars0.githubusercontent.com/u/8524964?v=4","gravatar_id":"","url":"https://api.github.com/users/akravch","html_url":"https://github.com/akravch","followers_url":"https://api.github.com/users/akravch/followers","following_url":"https://api.github.com/users/akravch/following{/other_user}","gists_url":"https://api.github.com/users/akravch/gists{/gist_id}","starred_url":"https://api.github.com/users/akravch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akravch/subscriptions","organizations_url":"https://api.github.com/users/akravch/orgs","repos_url":"https://api.github.com/users/akravch/repos","events_url":"https://api.github.com/users/akravch/events{/privacy}","received_events_url":"https://api.github.com/users/akravch/received_events","type":"User","site_admin":false},"body":"It might make sense to take a CancellationToken for consistency with `SendMessageAsync`.","created_at":"2018-03-13T08:07:49Z","updated_at":"2018-03-13T08:20:33Z","html_url":"https://github.com/pryabov/scheduler-bot/pull/15#discussion_r174041635","pull_request_url":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/15","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/comments/174041635"},"html":{"href":"https://github.com/pryabov/scheduler-bot/pull/15#discussion_r174041635"},"pull_request":{"href":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/15","id":174568432,"html_url":"https://github.com/pryabov/scheduler-bot/pull/15","diff_url":"https://github.com/pryabov/scheduler-bot/pull/15.diff","patch_url":"https://github.com/pryabov/scheduler-bot/pull/15.patch","issue_url":"https://api.github.com/repos/pryabov/scheduler-bot/issues/15","number":15,"state":"open","locked":false,"title":"Slightly change application structure","user":{"login":"pryabov","id":3180151,"avatar_url":"https://avatars3.githubusercontent.com/u/3180151?v=4","gravatar_id":"","url":"https://api.github.com/users/pryabov","html_url":"https://github.com/pryabov","followers_url":"https://api.github.com/users/pryabov/followers","following_url":"https://api.github.com/users/pryabov/following{/other_user}","gists_url":"https://api.github.com/users/pryabov/gists{/gist_id}","starred_url":"https://api.github.com/users/pryabov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pryabov/subscriptions","organizations_url":"https://api.github.com/users/pryabov/orgs","repos_url":"https://api.github.com/users/pryabov/repos","events_url":"https://api.github.com/users/pryabov/events{/privacy}","received_events_url":"https://api.github.com/users/pryabov/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-13T06:26:56Z","updated_at":"2018-03-13T08:20:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a2733a94fbfe3d0d8a967e663edf618683f82a1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/15/commits","review_comments_url":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/15/comments","review_comment_url":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pryabov/scheduler-bot/issues/15/comments","statuses_url":"https://api.github.com/repos/pryabov/scheduler-bot/statuses/c96f00850bf541a89903b17c152fbbcbe04f6ba3","head":{"label":"pryabov:new-app-structure","ref":"new-app-structure","sha":"c96f00850bf541a89903b17c152fbbcbe04f6ba3","user":{"login":"pryabov","id":3180151,"avatar_url":"https://avatars3.githubusercontent.com/u/3180151?v=4","gravatar_id":"","url":"https://api.github.com/users/pryabov","html_url":"https://github.com/pryabov","followers_url":"https://api.github.com/users/pryabov/followers","following_url":"https://api.github.com/users/pryabov/following{/other_user}","gists_url":"https://api.github.com/users/pryabov/gists{/gist_id}","starred_url":"https://api.github.com/users/pryabov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pryabov/subscriptions","organizations_url":"https://api.github.com/users/pryabov/orgs","repos_url":"https://api.github.com/users/pryabov/repos","events_url":"https://api.github.com/users/pryabov/events{/privacy}","received_events_url":"https://api.github.com/users/pryabov/received_events","type":"User","site_admin":false},"repo":{"id":121356915,"name":"scheduler-bot","full_name":"pryabov/scheduler-bot","owner":{"login":"pryabov","id":3180151,"avatar_url":"https://avatars3.githubusercontent.com/u/3180151?v=4","gravatar_id":"","url":"https://api.github.com/users/pryabov","html_url":"https://github.com/pryabov","followers_url":"https://api.github.com/users/pryabov/followers","following_url":"https://api.github.com/users/pryabov/following{/other_user}","gists_url":"https://api.github.com/users/pryabov/gists{/gist_id}","starred_url":"https://api.github.com/users/pryabov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pryabov/subscriptions","organizations_url":"https://api.github.com/users/pryabov/orgs","repos_url":"https://api.github.com/users/pryabov/repos","events_url":"https://api.github.com/users/pryabov/events{/privacy}","received_events_url":"https://api.github.com/users/pryabov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pryabov/scheduler-bot","description":null,"fork":false,"url":"https://api.github.com/repos/pryabov/scheduler-bot","forks_url":"https://api.github.com/repos/pryabov/scheduler-bot/forks","keys_url":"https://api.github.com/repos/pryabov/scheduler-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pryabov/scheduler-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pryabov/scheduler-bot/teams","hooks_url":"https://api.github.com/repos/pryabov/scheduler-bot/hooks","issue_events_url":"https://api.github.com/repos/pryabov/scheduler-bot/issues/events{/number}","events_url":"https://api.github.com/repos/pryabov/scheduler-bot/events","assignees_url":"https://api.github.com/repos/pryabov/scheduler-bot/assignees{/user}","branches_url":"https://api.github.com/repos/pryabov/scheduler-bot/branches{/branch}","tags_url":"https://api.github.com/repos/pryabov/scheduler-bot/tags","blobs_url":"https://api.github.com/repos/pryabov/scheduler-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pryabov/scheduler-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pryabov/scheduler-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/pryabov/scheduler-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pryabov/scheduler-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/pryabov/scheduler-bot/languages","stargazers_url":"https://api.github.com/repos/pryabov/scheduler-bot/stargazers","contributors_url":"https://api.github.com/repos/pryabov/scheduler-bot/contributors","subscribers_url":"https://api.github.com/repos/pryabov/scheduler-bot/subscribers","subscription_url":"https://api.github.com/repos/pryabov/scheduler-bot/subscription","commits_url":"https://api.github.com/repos/pryabov/scheduler-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/pryabov/scheduler-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/pryabov/scheduler-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/pryabov/scheduler-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/pryabov/scheduler-bot/contents/{+path}","compare_url":"https://api.github.com/repos/pryabov/scheduler-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pryabov/scheduler-bot/merges","archive_url":"https://api.github.com/repos/pryabov/scheduler-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pryabov/scheduler-bot/downloads","issues_url":"https://api.github.com/repos/pryabov/scheduler-bot/issues{/number}","pulls_url":"https://api.github.com/repos/pryabov/scheduler-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/pryabov/scheduler-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/pryabov/scheduler-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pryabov/scheduler-bot/labels{/name}","releases_url":"https://api.github.com/repos/pryabov/scheduler-bot/releases{/id}","deployments_url":"https://api.github.com/repos/pryabov/scheduler-bot/deployments","created_at":"2018-02-13T08:24:18Z","updated_at":"2018-03-13T08:07:49Z","pushed_at":"2018-03-13T06:26:57Z","git_url":"git://github.com/pryabov/scheduler-bot.git","ssh_url":"git@github.com:pryabov/scheduler-bot.git","clone_url":"https://github.com/pryabov/scheduler-bot.git","svn_url":"https://github.com/pryabov/scheduler-bot","homepage":null,"size":245,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"pryabov:master","ref":"master","sha":"b1df8ef81275a5fddd1b83897aefcb5445af59e6","user":{"login":"pryabov","id":3180151,"avatar_url":"https://avatars3.githubusercontent.com/u/3180151?v=4","gravatar_id":"","url":"https://api.github.com/users/pryabov","html_url":"https://github.com/pryabov","followers_url":"https://api.github.com/users/pryabov/followers","following_url":"https://api.github.com/users/pryabov/following{/other_user}","gists_url":"https://api.github.com/users/pryabov/gists{/gist_id}","starred_url":"https://api.github.com/users/pryabov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pryabov/subscriptions","organizations_url":"https://api.github.com/users/pryabov/orgs","repos_url":"https://api.github.com/users/pryabov/repos","events_url":"https://api.github.com/users/pryabov/events{/privacy}","received_events_url":"https://api.github.com/users/pryabov/received_events","type":"User","site_admin":false},"repo":{"id":121356915,"name":"scheduler-bot","full_name":"pryabov/scheduler-bot","owner":{"login":"pryabov","id":3180151,"avatar_url":"https://avatars3.githubusercontent.com/u/3180151?v=4","gravatar_id":"","url":"https://api.github.com/users/pryabov","html_url":"https://github.com/pryabov","followers_url":"https://api.github.com/users/pryabov/followers","following_url":"https://api.github.com/users/pryabov/following{/other_user}","gists_url":"https://api.github.com/users/pryabov/gists{/gist_id}","starred_url":"https://api.github.com/users/pryabov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pryabov/subscriptions","organizations_url":"https://api.github.com/users/pryabov/orgs","repos_url":"https://api.github.com/users/pryabov/repos","events_url":"https://api.github.com/users/pryabov/events{/privacy}","received_events_url":"https://api.github.com/users/pryabov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pryabov/scheduler-bot","description":null,"fork":false,"url":"https://api.github.com/repos/pryabov/scheduler-bot","forks_url":"https://api.github.com/repos/pryabov/scheduler-bot/forks","keys_url":"https://api.github.com/repos/pryabov/scheduler-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pryabov/scheduler-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pryabov/scheduler-bot/teams","hooks_url":"https://api.github.com/repos/pryabov/scheduler-bot/hooks","issue_events_url":"https://api.github.com/repos/pryabov/scheduler-bot/issues/events{/number}","events_url":"https://api.github.com/repos/pryabov/scheduler-bot/events","assignees_url":"https://api.github.com/repos/pryabov/scheduler-bot/assignees{/user}","branches_url":"https://api.github.com/repos/pryabov/scheduler-bot/branches{/branch}","tags_url":"https://api.github.com/repos/pryabov/scheduler-bot/tags","blobs_url":"https://api.github.com/repos/pryabov/scheduler-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pryabov/scheduler-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pryabov/scheduler-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/pryabov/scheduler-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pryabov/scheduler-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/pryabov/scheduler-bot/languages","stargazers_url":"https://api.github.com/repos/pryabov/scheduler-bot/stargazers","contributors_url":"https://api.github.com/repos/pryabov/scheduler-bot/contributors","subscribers_url":"https://api.github.com/repos/pryabov/scheduler-bot/subscribers","subscription_url":"https://api.github.com/repos/pryabov/scheduler-bot/subscription","commits_url":"https://api.github.com/repos/pryabov/scheduler-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/pryabov/scheduler-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/pryabov/scheduler-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/pryabov/scheduler-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/pryabov/scheduler-bot/contents/{+path}","compare_url":"https://api.github.com/repos/pryabov/scheduler-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pryabov/scheduler-bot/merges","archive_url":"https://api.github.com/repos/pryabov/scheduler-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pryabov/scheduler-bot/downloads","issues_url":"https://api.github.com/repos/pryabov/scheduler-bot/issues{/number}","pulls_url":"https://api.github.com/repos/pryabov/scheduler-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/pryabov/scheduler-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/pryabov/scheduler-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pryabov/scheduler-bot/labels{/name}","releases_url":"https://api.github.com/repos/pryabov/scheduler-bot/releases{/id}","deployments_url":"https://api.github.com/repos/pryabov/scheduler-bot/deployments","created_at":"2018-02-13T08:24:18Z","updated_at":"2018-03-13T08:07:49Z","pushed_at":"2018-03-13T06:26:57Z","git_url":"git://github.com/pryabov/scheduler-bot.git","ssh_url":"git@github.com:pryabov/scheduler-bot.git","clone_url":"https://github.com/pryabov/scheduler-bot.git","svn_url":"https://github.com/pryabov/scheduler-bot","homepage":null,"size":245,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/15"},"html":{"href":"https://github.com/pryabov/scheduler-bot/pull/15"},"issue":{"href":"https://api.github.com/repos/pryabov/scheduler-bot/issues/15"},"comments":{"href":"https://api.github.com/repos/pryabov/scheduler-bot/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pryabov/scheduler-bot/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/pryabov/scheduler-bot/statuses/c96f00850bf541a89903b17c152fbbcbe04f6ba3"}},"author_association":"OWNER"}}
{"actor":{"display_login":"akravch"}}