{"action":"created","comment":{"url":"https://api.github.com/repos/zulip/zulip/pulls/comments/93110545","pull_request_review_id":13632608,"id":93110545,"diff_hunk":"@@ -0,0 +1,105 @@\n+\n+\n+class PollHandler(object):\n+    '''\n+    This plugin facilitates polling.\n+    '''\n+\n+    def __init__(self):\n+        # polls is a dict of dict. First dict corresponds to poll title,\n+        # second refers to answers in poll\n+        self.polls = dict()\n+\n+        # streams is a convenience object that keeps track of the latest\n+        # question for each stream.\n+        self.streams = dict()\n+\n+    def usage(self):\n+        return '''\n+        This plugin facilitates polling.\n+\n+        Commands:\n+        @question poll title: option 1, option 2, option 3\n+        A valid poll must use a colon (:) to devide question from answers.\n+        Answers must be seperate by coma (,).\n+\n+        @answer option 1\n+        Question will be infered by scanning channel for last poll with\n+        valid answer.\n+\n+        @result poll title\n+        Returns a formatted version of the poll.\n+\n+        >> @question what's the best ice cream flavour: vanilla, chocolate\n+        << Question successfully created! Answer away\n+        >> @answer vanilla\n+        << vanilla has 1 vote\n+        >> @result what's the best ice cream flavour\n+        << what's the best ice cream flavour:\n+        << vanilla: 1\n+        << chocolate: 0\n+        '''\n+\n+    # Returns True if message is respondable\n+    def triage_message(self, message):\n+        original_content = message['content'].lower()\n+\n+        if message['display_recipient'] == 'poll':\n+            return False\n+\n+        if original_content.startswith('@question'):","path":"contrib_bots/lib/poll.py","position":50,"original_position":50,"commit_id":"35e3223151cb39ad57700848d4f35b5c071c61d3","original_commit_id":"35e3223151cb39ad57700848d4f35b5c071c61d3","user":{"login":"KaiCode2","id":7867183,"avatar_url":"https://avatars.githubusercontent.com/u/7867183?v=3","gravatar_id":"","url":"https://api.github.com/users/KaiCode2","html_url":"https://github.com/KaiCode2","followers_url":"https://api.github.com/users/KaiCode2/followers","following_url":"https://api.github.com/users/KaiCode2/following{/other_user}","gists_url":"https://api.github.com/users/KaiCode2/gists{/gist_id}","starred_url":"https://api.github.com/users/KaiCode2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaiCode2/subscriptions","organizations_url":"https://api.github.com/users/KaiCode2/orgs","repos_url":"https://api.github.com/users/KaiCode2/repos","events_url":"https://api.github.com/users/KaiCode2/events{/privacy}","received_events_url":"https://api.github.com/users/KaiCode2/received_events","type":"User","site_admin":false},"body":"Hm, I think this would indeed be nicer. Having a consistent `@poll` domain for this bot: would keep its keywords nice and confined. I'll change the keywords this evening. \r\n\r\nThe one keyword I'm not a huge fan of is init. Sounds a little bit too tech-y imho. I'll use it tentatively while I make changes though.","created_at":"2016-12-19T20:15:14Z","updated_at":"2016-12-19T20:15:14Z","html_url":"https://github.com/zulip/zulip/pull/2783#discussion_r93110545","pull_request_url":"https://api.github.com/repos/zulip/zulip/pulls/2783","_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments/93110545"},"html":{"href":"https://github.com/zulip/zulip/pull/2783#discussion_r93110545"},"pull_request":{"href":"https://api.github.com/repos/zulip/zulip/pulls/2783"}}},"pull_request":{"url":"https://api.github.com/repos/zulip/zulip/pulls/2783","id":98523681,"html_url":"https://github.com/zulip/zulip/pull/2783","diff_url":"https://github.com/zulip/zulip/pull/2783.diff","patch_url":"https://github.com/zulip/zulip/pull/2783.patch","issue_url":"https://api.github.com/repos/zulip/zulip/issues/2783","number":2783,"state":"open","locked":false,"title":"Interactive bots: Create polling bot by KaiCode2","user":{"login":"KaiCode2","id":7867183,"avatar_url":"https://avatars.githubusercontent.com/u/7867183?v=3","gravatar_id":"","url":"https://api.github.com/users/KaiCode2","html_url":"https://github.com/KaiCode2","followers_url":"https://api.github.com/users/KaiCode2/followers","following_url":"https://api.github.com/users/KaiCode2/following{/other_user}","gists_url":"https://api.github.com/users/KaiCode2/gists{/gist_id}","starred_url":"https://api.github.com/users/KaiCode2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaiCode2/subscriptions","organizations_url":"https://api.github.com/users/KaiCode2/orgs","repos_url":"https://api.github.com/users/KaiCode2/repos","events_url":"https://api.github.com/users/KaiCode2/events{/privacy}","received_events_url":"https://api.github.com/users/KaiCode2/received_events","type":"User","site_admin":false},"body":"See GCI task [here.](https://codein.withgoogle.com/dashboard/task-instances/4742242021408768/)","created_at":"2016-12-19T08:24:23Z","updated_at":"2016-12-19T20:18:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"584631ea519d6273e122b4c8d77a3d4d7f0b3a12","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zulip/zulip/pulls/2783/commits","review_comments_url":"https://api.github.com/repos/zulip/zulip/pulls/2783/comments","review_comment_url":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/2783/comments","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/35e3223151cb39ad57700848d4f35b5c071c61d3","head":{"label":"KaiCode2:master","ref":"master","sha":"35e3223151cb39ad57700848d4f35b5c071c61d3","user":{"login":"KaiCode2","id":7867183,"avatar_url":"https://avatars.githubusercontent.com/u/7867183?v=3","gravatar_id":"","url":"https://api.github.com/users/KaiCode2","html_url":"https://github.com/KaiCode2","followers_url":"https://api.github.com/users/KaiCode2/followers","following_url":"https://api.github.com/users/KaiCode2/following{/other_user}","gists_url":"https://api.github.com/users/KaiCode2/gists{/gist_id}","starred_url":"https://api.github.com/users/KaiCode2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaiCode2/subscriptions","organizations_url":"https://api.github.com/users/KaiCode2/orgs","repos_url":"https://api.github.com/users/KaiCode2/repos","events_url":"https://api.github.com/users/KaiCode2/events{/privacy}","received_events_url":"https://api.github.com/users/KaiCode2/received_events","type":"User","site_admin":false},"repo":{"id":76631646,"name":"zulip","full_name":"KaiCode2/zulip","owner":{"login":"KaiCode2","id":7867183,"avatar_url":"https://avatars.githubusercontent.com/u/7867183?v=3","gravatar_id":"","url":"https://api.github.com/users/KaiCode2","html_url":"https://github.com/KaiCode2","followers_url":"https://api.github.com/users/KaiCode2/followers","following_url":"https://api.github.com/users/KaiCode2/following{/other_user}","gists_url":"https://api.github.com/users/KaiCode2/gists{/gist_id}","starred_url":"https://api.github.com/users/KaiCode2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaiCode2/subscriptions","organizations_url":"https://api.github.com/users/KaiCode2/orgs","repos_url":"https://api.github.com/users/KaiCode2/repos","events_url":"https://api.github.com/users/KaiCode2/events{/privacy}","received_events_url":"https://api.github.com/users/KaiCode2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KaiCode2/zulip","description":"Zulip server - powerful open source group chat","fork":true,"url":"https://api.github.com/repos/KaiCode2/zulip","forks_url":"https://api.github.com/repos/KaiCode2/zulip/forks","keys_url":"https://api.github.com/repos/KaiCode2/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KaiCode2/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KaiCode2/zulip/teams","hooks_url":"https://api.github.com/repos/KaiCode2/zulip/hooks","issue_events_url":"https://api.github.com/repos/KaiCode2/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/KaiCode2/zulip/events","assignees_url":"https://api.github.com/repos/KaiCode2/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/KaiCode2/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/KaiCode2/zulip/tags","blobs_url":"https://api.github.com/repos/KaiCode2/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KaiCode2/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KaiCode2/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/KaiCode2/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KaiCode2/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/KaiCode2/zulip/languages","stargazers_url":"https://api.github.com/repos/KaiCode2/zulip/stargazers","contributors_url":"https://api.github.com/repos/KaiCode2/zulip/contributors","subscribers_url":"https://api.github.com/repos/KaiCode2/zulip/subscribers","subscription_url":"https://api.github.com/repos/KaiCode2/zulip/subscription","commits_url":"https://api.github.com/repos/KaiCode2/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/KaiCode2/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/KaiCode2/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/KaiCode2/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/KaiCode2/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/KaiCode2/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KaiCode2/zulip/merges","archive_url":"https://api.github.com/repos/KaiCode2/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KaiCode2/zulip/downloads","issues_url":"https://api.github.com/repos/KaiCode2/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/KaiCode2/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/KaiCode2/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/KaiCode2/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KaiCode2/zulip/labels{/name}","releases_url":"https://api.github.com/repos/KaiCode2/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/KaiCode2/zulip/deployments","created_at":"2016-12-16T07:24:52Z","updated_at":"2016-12-16T07:24:59Z","pushed_at":"2016-12-19T07:03:40Z","git_url":"git://github.com/KaiCode2/zulip.git","ssh_url":"git@github.com:KaiCode2/zulip.git","clone_url":"https://github.com/KaiCode2/zulip.git","svn_url":"https://github.com/KaiCode2/zulip","homepage":"","size":124780,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"zulip:master","ref":"master","sha":"3227484fbf9e5cec3caf969b87fbf98cbd75d972","user":{"login":"zulip","id":4921959,"avatar_url":"https://avatars.githubusercontent.com/u/4921959?v=3","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"repo":{"id":43160685,"name":"zulip","full_name":"zulip/zulip","owner":{"login":"zulip","id":4921959,"avatar_url":"https://avatars.githubusercontent.com/u/4921959?v=3","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zulip/zulip","description":"Zulip server - powerful open source group chat","fork":false,"url":"https://api.github.com/repos/zulip/zulip","forks_url":"https://api.github.com/repos/zulip/zulip/forks","keys_url":"https://api.github.com/repos/zulip/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zulip/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zulip/zulip/teams","hooks_url":"https://api.github.com/repos/zulip/zulip/hooks","issue_events_url":"https://api.github.com/repos/zulip/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/zulip/zulip/events","assignees_url":"https://api.github.com/repos/zulip/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/zulip/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/zulip/zulip/tags","blobs_url":"https://api.github.com/repos/zulip/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zulip/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zulip/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/zulip/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/zulip/zulip/languages","stargazers_url":"https://api.github.com/repos/zulip/zulip/stargazers","contributors_url":"https://api.github.com/repos/zulip/zulip/contributors","subscribers_url":"https://api.github.com/repos/zulip/zulip/subscribers","subscription_url":"https://api.github.com/repos/zulip/zulip/subscription","commits_url":"https://api.github.com/repos/zulip/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/zulip/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/zulip/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/zulip/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/zulip/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/zulip/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zulip/zulip/merges","archive_url":"https://api.github.com/repos/zulip/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zulip/zulip/downloads","issues_url":"https://api.github.com/repos/zulip/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/zulip/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/zulip/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/zulip/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zulip/zulip/labels{/name}","releases_url":"https://api.github.com/repos/zulip/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/zulip/zulip/deployments","created_at":"2015-09-25T16:37:25Z","updated_at":"2016-12-19T18:49:41Z","pushed_at":"2016-12-19T20:17:34Z","git_url":"git://github.com/zulip/zulip.git","ssh_url":"git@github.com:zulip/zulip.git","clone_url":"https://github.com/zulip/zulip.git","svn_url":"https://github.com/zulip/zulip","homepage":"","size":125951,"stargazers_count":4341,"watchers_count":4341,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":936,"mirror_url":null,"open_issues_count":624,"forks":936,"open_issues":624,"watchers":4341,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/2783"},"html":{"href":"https://github.com/zulip/zulip/pull/2783"},"issue":{"href":"https://api.github.com/repos/zulip/zulip/issues/2783"},"comments":{"href":"https://api.github.com/repos/zulip/zulip/issues/2783/comments"},"review_comments":{"href":"https://api.github.com/repos/zulip/zulip/pulls/2783/comments"},"review_comment":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zulip/zulip/pulls/2783/commits"},"statuses":{"href":"https://api.github.com/repos/zulip/zulip/statuses/35e3223151cb39ad57700848d4f35b5c071c61d3"}}}}
{"actor":{"display_login":"KaiCode2"}}