{"action":"created","comment":{"url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/comments/75823230","id":75823230,"diff_hunk":"@@ -0,0 +1,107 @@\n+package com.github.bumblebee.command.youtube;\n+\n+import com.github.bumblebee.command.SingleArgumentCommand;\n+import com.github.bumblebee.command.youtube.api.YoutubeSubscriptionProvider;\n+import com.github.bumblebee.command.youtube.entity.Chat;\n+import com.github.bumblebee.command.youtube.entity.Subscription;\n+import com.github.bumblebee.command.youtube.service.YoutubeSubscriptionService;\n+import com.github.bumblebee.service.RandomPhraseService;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.stereotype.Component;\n+import telegram.api.BotApi;\n+import telegram.domain.Update;\n+\n+import java.util.*;\n+\n+\n+@Component\n+public class YoutubeSubscribeCommand extends SingleArgumentCommand {\n+\n+    private final BotApi botApi;\n+    private final YoutubeSubscriptionService service;\n+    private final RandomPhraseService randomPhraseService;\n+    private final YoutubeSubscriptionProvider provider;\n+    private final List<Subscription> subscriptionList;\n+\n+    @Autowired\n+    public YoutubeSubscribeCommand(BotApi botApi,\n+                                   YoutubeSubscriptionService service,\n+                                   RandomPhraseService randomPhraseService,\n+                                   YoutubeSubscriptionProvider provider) {\n+        this.botApi = botApi;\n+        this.service = service;\n+        this.randomPhraseService = randomPhraseService;\n+        this.provider = provider;\n+        this.subscriptionList = service.retrieveSubscriptions();\n+    }\n+\n+    public Set<Long> getChatIds(String channelId) {\n+        Set<Long> idSet = new HashSet<>();\n+        for (Subscription sub : subscriptionList) {\n+            if (sub.getChannelId().equals(channelId)) {\n+                for (Chat chat : sub.getChats()) {\n+                    idSet.add(chat.getChatId());\n+                }\n+            }\n+        }\n+        return idSet;\n+    }\n+\n+    public List<Subscription> getSubscriptionList() {\n+        return subscriptionList;\n+    }\n+\n+    @Override\n+    public void handleCommand(Update update, Long chatId, String argument) {","path":"telegram-bot-bumblebee-core/src/main/java/com/github/bumblebee/command/youtube/YoutubeSubscribeCommand.java","position":55,"original_position":55,"commit_id":"0d1d7a20acdd146517f9affaaaccf99714ba6204","original_commit_id":"0d1d7a20acdd146517f9affaaaccf99714ba6204","user":{"login":"denzelby","id":4436204,"avatar_url":"https://avatars.githubusercontent.com/u/4436204?v=3","gravatar_id":"","url":"https://api.github.com/users/denzelby","html_url":"https://github.com/denzelby","followers_url":"https://api.github.com/users/denzelby/followers","following_url":"https://api.github.com/users/denzelby/following{/other_user}","gists_url":"https://api.github.com/users/denzelby/gists{/gist_id}","starred_url":"https://api.github.com/users/denzelby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denzelby/subscriptions","organizations_url":"https://api.github.com/users/denzelby/orgs","repos_url":"https://api.github.com/users/denzelby/repos","events_url":"https://api.github.com/users/denzelby/events{/privacy}","received_events_url":"https://api.github.com/users/denzelby/received_events","type":"User","site_admin":false},"body":"Feel free to rename \"argument\" parameter to more context related one. For example: \"channelId\".","created_at":"2016-08-23T08:37:49Z","updated_at":"2016-08-23T08:37:49Z","html_url":"https://github.com/denzelby/telegram-bot-bumblebee/pull/31#discussion_r75823230","pull_request_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/comments/75823230"},"html":{"href":"https://github.com/denzelby/telegram-bot-bumblebee/pull/31#discussion_r75823230"},"pull_request":{"href":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/31","id":75951706,"html_url":"https://github.com/denzelby/telegram-bot-bumblebee/pull/31","diff_url":"https://github.com/denzelby/telegram-bot-bumblebee/pull/31.diff","patch_url":"https://github.com/denzelby/telegram-bot-bumblebee/pull/31.patch","issue_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/issues/31","number":31,"state":"open","locked":false,"title":"Added youtube push notifications parser.","user":{"login":"fare1990","id":18418615,"avatar_url":"https://avatars.githubusercontent.com/u/18418615?v=3","gravatar_id":"","url":"https://api.github.com/users/fare1990","html_url":"https://github.com/fare1990","followers_url":"https://api.github.com/users/fare1990/followers","following_url":"https://api.github.com/users/fare1990/following{/other_user}","gists_url":"https://api.github.com/users/fare1990/gists{/gist_id}","starred_url":"https://api.github.com/users/fare1990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fare1990/subscriptions","organizations_url":"https://api.github.com/users/fare1990/orgs","repos_url":"https://api.github.com/users/fare1990/repos","events_url":"https://api.github.com/users/fare1990/events{/privacy}","received_events_url":"https://api.github.com/users/fare1990/received_events","type":"User","site_admin":false},"body":"Added push parser and new command to add chats in push notifications view group.","created_at":"2016-07-01T09:28:53Z","updated_at":"2016-08-23T08:37:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5227f14728d1302bb4da4e2d29607835365ff8e1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/31/commits","review_comments_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/31/comments","review_comment_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/comments{/number}","comments_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/issues/31/comments","statuses_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/statuses/0d1d7a20acdd146517f9affaaaccf99714ba6204","head":{"label":"fare1990:YoutubePushParser","ref":"YoutubePushParser","sha":"0d1d7a20acdd146517f9affaaaccf99714ba6204","user":{"login":"fare1990","id":18418615,"avatar_url":"https://avatars.githubusercontent.com/u/18418615?v=3","gravatar_id":"","url":"https://api.github.com/users/fare1990","html_url":"https://github.com/fare1990","followers_url":"https://api.github.com/users/fare1990/followers","following_url":"https://api.github.com/users/fare1990/following{/other_user}","gists_url":"https://api.github.com/users/fare1990/gists{/gist_id}","starred_url":"https://api.github.com/users/fare1990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fare1990/subscriptions","organizations_url":"https://api.github.com/users/fare1990/orgs","repos_url":"https://api.github.com/users/fare1990/repos","events_url":"https://api.github.com/users/fare1990/events{/privacy}","received_events_url":"https://api.github.com/users/fare1990/received_events","type":"User","site_admin":false},"repo":{"id":62033500,"name":"telegram-bot-bumblebee","full_name":"fare1990/telegram-bot-bumblebee","owner":{"login":"fare1990","id":18418615,"avatar_url":"https://avatars.githubusercontent.com/u/18418615?v=3","gravatar_id":"","url":"https://api.github.com/users/fare1990","html_url":"https://github.com/fare1990","followers_url":"https://api.github.com/users/fare1990/followers","following_url":"https://api.github.com/users/fare1990/following{/other_user}","gists_url":"https://api.github.com/users/fare1990/gists{/gist_id}","starred_url":"https://api.github.com/users/fare1990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fare1990/subscriptions","organizations_url":"https://api.github.com/users/fare1990/orgs","repos_url":"https://api.github.com/users/fare1990/repos","events_url":"https://api.github.com/users/fare1990/events{/privacy}","received_events_url":"https://api.github.com/users/fare1990/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fare1990/telegram-bot-bumblebee","description":"Bumblebee telegram bot implementation","fork":true,"url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee","forks_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/forks","keys_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/teams","hooks_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/hooks","issue_events_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/issues/events{/number}","events_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/events","assignees_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/assignees{/user}","branches_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/branches{/branch}","tags_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/tags","blobs_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/git/refs{/sha}","trees_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/statuses/{sha}","languages_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/languages","stargazers_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/stargazers","contributors_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/contributors","subscribers_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/subscribers","subscription_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/subscription","commits_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/commits{/sha}","git_commits_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/git/commits{/sha}","comments_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/comments{/number}","issue_comment_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/issues/comments{/number}","contents_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/contents/{+path}","compare_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/merges","archive_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/downloads","issues_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/issues{/number}","pulls_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/pulls{/number}","milestones_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/milestones{/number}","notifications_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/labels{/name}","releases_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/releases{/id}","deployments_url":"https://api.github.com/repos/fare1990/telegram-bot-bumblebee/deployments","created_at":"2016-06-27T07:13:59Z","updated_at":"2016-06-27T07:14:00Z","pushed_at":"2016-08-22T13:25:24Z","git_url":"git://github.com/fare1990/telegram-bot-bumblebee.git","ssh_url":"git@github.com:fare1990/telegram-bot-bumblebee.git","clone_url":"https://github.com/fare1990/telegram-bot-bumblebee.git","svn_url":"https://github.com/fare1990/telegram-bot-bumblebee","homepage":"","size":237,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"denzelby:master","ref":"master","sha":"7dd1594020a0394a2541faed6d8f0b7de9455de0","user":{"login":"denzelby","id":4436204,"avatar_url":"https://avatars.githubusercontent.com/u/4436204?v=3","gravatar_id":"","url":"https://api.github.com/users/denzelby","html_url":"https://github.com/denzelby","followers_url":"https://api.github.com/users/denzelby/followers","following_url":"https://api.github.com/users/denzelby/following{/other_user}","gists_url":"https://api.github.com/users/denzelby/gists{/gist_id}","starred_url":"https://api.github.com/users/denzelby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denzelby/subscriptions","organizations_url":"https://api.github.com/users/denzelby/orgs","repos_url":"https://api.github.com/users/denzelby/repos","events_url":"https://api.github.com/users/denzelby/events{/privacy}","received_events_url":"https://api.github.com/users/denzelby/received_events","type":"User","site_admin":false},"repo":{"id":46003534,"name":"telegram-bot-bumblebee","full_name":"denzelby/telegram-bot-bumblebee","owner":{"login":"denzelby","id":4436204,"avatar_url":"https://avatars.githubusercontent.com/u/4436204?v=3","gravatar_id":"","url":"https://api.github.com/users/denzelby","html_url":"https://github.com/denzelby","followers_url":"https://api.github.com/users/denzelby/followers","following_url":"https://api.github.com/users/denzelby/following{/other_user}","gists_url":"https://api.github.com/users/denzelby/gists{/gist_id}","starred_url":"https://api.github.com/users/denzelby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denzelby/subscriptions","organizations_url":"https://api.github.com/users/denzelby/orgs","repos_url":"https://api.github.com/users/denzelby/repos","events_url":"https://api.github.com/users/denzelby/events{/privacy}","received_events_url":"https://api.github.com/users/denzelby/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/denzelby/telegram-bot-bumblebee","description":"Bumblebee telegram bot implementation","fork":false,"url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee","forks_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/forks","keys_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/teams","hooks_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/hooks","issue_events_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/issues/events{/number}","events_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/events","assignees_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/assignees{/user}","branches_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/branches{/branch}","tags_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/tags","blobs_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/git/refs{/sha}","trees_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/statuses/{sha}","languages_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/languages","stargazers_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/stargazers","contributors_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/contributors","subscribers_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/subscribers","subscription_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/subscription","commits_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/commits{/sha}","git_commits_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/git/commits{/sha}","comments_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/comments{/number}","issue_comment_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/issues/comments{/number}","contents_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/contents/{+path}","compare_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/merges","archive_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/downloads","issues_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/issues{/number}","pulls_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls{/number}","milestones_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/milestones{/number}","notifications_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/labels{/name}","releases_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/releases{/id}","deployments_url":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/deployments","created_at":"2015-11-11T19:09:51Z","updated_at":"2016-05-21T19:35:54Z","pushed_at":"2016-08-22T13:25:25Z","git_url":"git://github.com/denzelby/telegram-bot-bumblebee.git","ssh_url":"git@github.com:denzelby/telegram-bot-bumblebee.git","clone_url":"https://github.com/denzelby/telegram-bot-bumblebee.git","svn_url":"https://github.com/denzelby/telegram-bot-bumblebee","homepage":"","size":259,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/31"},"html":{"href":"https://github.com/denzelby/telegram-bot-bumblebee/pull/31"},"issue":{"href":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/issues/31"},"comments":{"href":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/denzelby/telegram-bot-bumblebee/statuses/0d1d7a20acdd146517f9affaaaccf99714ba6204"}}}}
{"actor":{"display_login":"denzelby"}}