{"action":"created","comment":{"url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/comments/191273964","pull_request_review_id":123812790,"id":191273964,"diff_hunk":"@@ -0,0 +1,47 @@\n+require 'commands/command'\n+require 'commands/mixins/EventMessagePusher'\n+require 'Container'\n+\n+require 'i18n'\n+\n+class SubscribeCommand < Command\n+    include EventMessagePusher\n+\n+    def initialize(messageSender)\n+        super(messageSender)\n+    end\n+\n+    def process(msg, userid, chatid, orig)\n+        dataStore = Container::get(:dataStore)\n+        calendars = Container::get(:calendars)\n+        bot = Container::get(:bot)\n+        command, *args = msg.split(/\\s+/)\n+        if args.length == 0 then\n+            @messageSender.process(I18n.t('subscribe.choose_calendar'), chatid, self.getCalendarButtons);\n+            return\n+        end\n+        begin\n+            bot.bot_instance.api.editMessageReplyMarkup(chat_id: orig.message.chat.id, message_id: orig.message.message_id, reply_markup: Telegram::Bot::Types::InlineKeyboardMarkup.new(inline_keyboard: []))\n+        rescue\n+        end\n+        calendar_id = Integer(args[0]) rescue -1\n+        if calendars[calendar_id].nil? then\n+            @messageSender.process(I18n.t('errors.subscribe.command_invalid', calendar_id: calendars.keys.first, calendar_name: calendars.values.first[:description]), chatid)\n+            return\n+        end\n+        isSubbed = dataStore.getSubscriberById(userid, calendar_id)\n+        if (!isSubbed.nil?) then\n+            @messageSender.process(I18n.t('errors.subscribe.double_subscription', calendar_name: calendars[calendar_id][:description]), chatid);\n+            return\n+        end\n+        dataStore.addSubscriber({telegram_id: userid, eventlist_id: calendar_id, notificationday: 1, notificationtime: {hrs: 20, min: 0}, notifiedEvents: []})\n+        @messageSender.process(I18n.t('confirmations.subscribe_success', calendar_name: calendars[calendar_id][:description]), chatid)\n+        self.pushEventsDescription(calendar_id, 1, userid, chatid)","path":"src/commands/SubscribeCommand.rb","position":39,"original_position":39,"commit_id":"d369053cf2a1a71ab97322080ee23ee13cbb3816","original_commit_id":"d369053cf2a1a71ab97322080ee23ee13cbb3816","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Style/RedundantSelf: Redundant self detected.","created_at":"2018-05-28T21:32:30Z","updated_at":"2018-05-28T21:32:32Z","html_url":"https://github.com/benjaminsattler/icsTelegramBot/pull/15#discussion_r191273964","pull_request_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/15","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/comments/191273964"},"html":{"href":"https://github.com/benjaminsattler/icsTelegramBot/pull/15#discussion_r191273964"},"pull_request":{"href":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/15","id":190997078,"html_url":"https://github.com/benjaminsattler/icsTelegramBot/pull/15","diff_url":"https://github.com/benjaminsattler/icsTelegramBot/pull/15.diff","patch_url":"https://github.com/benjaminsattler/icsTelegramBot/pull/15.patch","issue_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/issues/15","number":15,"state":"open","locked":false,"title":"[wip] feat/multipleeventlists","user":{"login":"benjaminsattler","id":10059547,"avatar_url":"https://avatars2.githubusercontent.com/u/10059547?v=4","gravatar_id":"","url":"https://api.github.com/users/benjaminsattler","html_url":"https://github.com/benjaminsattler","followers_url":"https://api.github.com/users/benjaminsattler/followers","following_url":"https://api.github.com/users/benjaminsattler/following{/other_user}","gists_url":"https://api.github.com/users/benjaminsattler/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminsattler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminsattler/subscriptions","organizations_url":"https://api.github.com/users/benjaminsattler/orgs","repos_url":"https://api.github.com/users/benjaminsattler/repos","events_url":"https://api.github.com/users/benjaminsattler/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminsattler/received_events","type":"User","site_admin":false},"body":"work in progress - do not merge","created_at":"2018-05-28T21:11:13Z","updated_at":"2018-05-28T21:32:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fe964fc323e75c32aa65da8a0e8898f03df4463","assignee":{"login":"benjaminsattler","id":10059547,"avatar_url":"https://avatars2.githubusercontent.com/u/10059547?v=4","gravatar_id":"","url":"https://api.github.com/users/benjaminsattler","html_url":"https://github.com/benjaminsattler","followers_url":"https://api.github.com/users/benjaminsattler/followers","following_url":"https://api.github.com/users/benjaminsattler/following{/other_user}","gists_url":"https://api.github.com/users/benjaminsattler/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminsattler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminsattler/subscriptions","organizations_url":"https://api.github.com/users/benjaminsattler/orgs","repos_url":"https://api.github.com/users/benjaminsattler/repos","events_url":"https://api.github.com/users/benjaminsattler/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminsattler/received_events","type":"User","site_admin":false},"assignees":[{"login":"benjaminsattler","id":10059547,"avatar_url":"https://avatars2.githubusercontent.com/u/10059547?v=4","gravatar_id":"","url":"https://api.github.com/users/benjaminsattler","html_url":"https://github.com/benjaminsattler","followers_url":"https://api.github.com/users/benjaminsattler/followers","following_url":"https://api.github.com/users/benjaminsattler/following{/other_user}","gists_url":"https://api.github.com/users/benjaminsattler/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminsattler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminsattler/subscriptions","organizations_url":"https://api.github.com/users/benjaminsattler/orgs","repos_url":"https://api.github.com/users/benjaminsattler/repos","events_url":"https://api.github.com/users/benjaminsattler/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminsattler/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/15/commits","review_comments_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/15/comments","review_comment_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/issues/15/comments","statuses_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/statuses/d369053cf2a1a71ab97322080ee23ee13cbb3816","head":{"label":"benjaminsattler:feat/multipleeventlists","ref":"feat/multipleeventlists","sha":"d369053cf2a1a71ab97322080ee23ee13cbb3816","user":{"login":"benjaminsattler","id":10059547,"avatar_url":"https://avatars2.githubusercontent.com/u/10059547?v=4","gravatar_id":"","url":"https://api.github.com/users/benjaminsattler","html_url":"https://github.com/benjaminsattler","followers_url":"https://api.github.com/users/benjaminsattler/followers","following_url":"https://api.github.com/users/benjaminsattler/following{/other_user}","gists_url":"https://api.github.com/users/benjaminsattler/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminsattler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminsattler/subscriptions","organizations_url":"https://api.github.com/users/benjaminsattler/orgs","repos_url":"https://api.github.com/users/benjaminsattler/repos","events_url":"https://api.github.com/users/benjaminsattler/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminsattler/received_events","type":"User","site_admin":false},"repo":{"id":115441683,"name":"icsTelegramBot","full_name":"benjaminsattler/icsTelegramBot","owner":{"login":"benjaminsattler","id":10059547,"avatar_url":"https://avatars2.githubusercontent.com/u/10059547?v=4","gravatar_id":"","url":"https://api.github.com/users/benjaminsattler","html_url":"https://github.com/benjaminsattler","followers_url":"https://api.github.com/users/benjaminsattler/followers","following_url":"https://api.github.com/users/benjaminsattler/following{/other_user}","gists_url":"https://api.github.com/users/benjaminsattler/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminsattler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminsattler/subscriptions","organizations_url":"https://api.github.com/users/benjaminsattler/orgs","repos_url":"https://api.github.com/users/benjaminsattler/repos","events_url":"https://api.github.com/users/benjaminsattler/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminsattler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benjaminsattler/icsTelegramBot","description":"This is a quick and dirty telegram bot that can retrieve events from an ICS calendar file and send you reminder messages via telegram.","fork":false,"url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot","forks_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/forks","keys_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/teams","hooks_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/hooks","issue_events_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/issues/events{/number}","events_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/events","assignees_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/assignees{/user}","branches_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/branches{/branch}","tags_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/tags","blobs_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/git/refs{/sha}","trees_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/statuses/{sha}","languages_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/languages","stargazers_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/stargazers","contributors_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/contributors","subscribers_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/subscribers","subscription_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/subscription","commits_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/commits{/sha}","git_commits_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/git/commits{/sha}","comments_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/comments{/number}","issue_comment_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/issues/comments{/number}","contents_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/contents/{+path}","compare_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/merges","archive_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/downloads","issues_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/issues{/number}","pulls_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls{/number}","milestones_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/milestones{/number}","notifications_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/labels{/name}","releases_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/releases{/id}","deployments_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/deployments","created_at":"2017-12-26T17:26:02Z","updated_at":"2018-03-30T17:15:37Z","pushed_at":"2018-05-28T21:32:06Z","git_url":"git://github.com/benjaminsattler/icsTelegramBot.git","ssh_url":"git@github.com:benjaminsattler/icsTelegramBot.git","clone_url":"https://github.com/benjaminsattler/icsTelegramBot.git","svn_url":"https://github.com/benjaminsattler/icsTelegramBot","homepage":null,"size":5989,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"benjaminsattler:master","ref":"master","sha":"6318b3c96324ae6c0aad2dc94a4585d9e5cdd48a","user":{"login":"benjaminsattler","id":10059547,"avatar_url":"https://avatars2.githubusercontent.com/u/10059547?v=4","gravatar_id":"","url":"https://api.github.com/users/benjaminsattler","html_url":"https://github.com/benjaminsattler","followers_url":"https://api.github.com/users/benjaminsattler/followers","following_url":"https://api.github.com/users/benjaminsattler/following{/other_user}","gists_url":"https://api.github.com/users/benjaminsattler/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminsattler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminsattler/subscriptions","organizations_url":"https://api.github.com/users/benjaminsattler/orgs","repos_url":"https://api.github.com/users/benjaminsattler/repos","events_url":"https://api.github.com/users/benjaminsattler/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminsattler/received_events","type":"User","site_admin":false},"repo":{"id":115441683,"name":"icsTelegramBot","full_name":"benjaminsattler/icsTelegramBot","owner":{"login":"benjaminsattler","id":10059547,"avatar_url":"https://avatars2.githubusercontent.com/u/10059547?v=4","gravatar_id":"","url":"https://api.github.com/users/benjaminsattler","html_url":"https://github.com/benjaminsattler","followers_url":"https://api.github.com/users/benjaminsattler/followers","following_url":"https://api.github.com/users/benjaminsattler/following{/other_user}","gists_url":"https://api.github.com/users/benjaminsattler/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminsattler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminsattler/subscriptions","organizations_url":"https://api.github.com/users/benjaminsattler/orgs","repos_url":"https://api.github.com/users/benjaminsattler/repos","events_url":"https://api.github.com/users/benjaminsattler/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminsattler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benjaminsattler/icsTelegramBot","description":"This is a quick and dirty telegram bot that can retrieve events from an ICS calendar file and send you reminder messages via telegram.","fork":false,"url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot","forks_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/forks","keys_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/teams","hooks_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/hooks","issue_events_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/issues/events{/number}","events_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/events","assignees_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/assignees{/user}","branches_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/branches{/branch}","tags_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/tags","blobs_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/git/refs{/sha}","trees_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/statuses/{sha}","languages_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/languages","stargazers_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/stargazers","contributors_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/contributors","subscribers_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/subscribers","subscription_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/subscription","commits_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/commits{/sha}","git_commits_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/git/commits{/sha}","comments_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/comments{/number}","issue_comment_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/issues/comments{/number}","contents_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/contents/{+path}","compare_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/merges","archive_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/downloads","issues_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/issues{/number}","pulls_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls{/number}","milestones_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/milestones{/number}","notifications_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/labels{/name}","releases_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/releases{/id}","deployments_url":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/deployments","created_at":"2017-12-26T17:26:02Z","updated_at":"2018-03-30T17:15:37Z","pushed_at":"2018-05-28T21:32:06Z","git_url":"git://github.com/benjaminsattler/icsTelegramBot.git","ssh_url":"git@github.com:benjaminsattler/icsTelegramBot.git","clone_url":"https://github.com/benjaminsattler/icsTelegramBot.git","svn_url":"https://github.com/benjaminsattler/icsTelegramBot","homepage":null,"size":5989,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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/benjaminsattler/icsTelegramBot/pulls/15"},"html":{"href":"https://github.com/benjaminsattler/icsTelegramBot/pull/15"},"issue":{"href":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/issues/15"},"comments":{"href":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/benjaminsattler/icsTelegramBot/statuses/d369053cf2a1a71ab97322080ee23ee13cbb3816"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}