{"action":"created","comment":{"url":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/comments/55760450","id":55760450,"diff_hunk":"@@ -0,0 +1,264 @@\n+\"\"\"Cards cog.\n+\n+Will contain many card playable card games.\n+\n+\"\"\"\n+from discord.ext import commands\n+import random\n+\n+hilo_games = []\n+\n+\n+class Deck:\n+    \"\"\"Contains 52 unique Cards.\"\"\"\n+\n+    def __init__(self):\n+        \"\"\"Create, populate, and shuffle a new Deck of Cards.\"\"\"\n+        self.deck = self.generate_deck()\n+        random.shuffle(self.deck)\n+\n+    def draw_cards(self, amount):\n+        \"\"\"Remove card(s) from Deck.\n+\n+        Keyword arguments:\n+        amount -- Number of Cards to remove and return from Deck.\n+\n+        Returns:\n+        list -- Cards removed from Deck.\n+\n+        \"\"\"\n+        cards = []\n+        for _ in range(amount):\n+            cards.append(self.deck.pop())\n+        return cards\n+\n+    def get_deck(self):\n+        \"\"\"Get the current Deck of Cards.\n+\n+        Returns:\n+        list -- Cards within the Deck.\n+\n+        \"\"\"\n+        return self.deck\n+\n+    @staticmethod\n+    def generate_deck():\n+        \"\"\"Create a new Deck.\"\"\"\n+        ranks = [\"Ace\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"Joker\", \"Queen\", \"King\"]\n+        suits = [\"Clubs\", \"Diamonds\", \"Hearts\", \"Spades\"]\n+        return [Card(rank, suit) for rank in ranks for suit in suits]\n+\n+\n+class Card:\n+    \"\"\"A playing Card.\n+\n+    Supports the following operators: ==, +, -, <, >.\n+\n+    \"\"\"\n+\n+    def __init__(self, rank=\"random\", suit=\"random\"):\n+        \"\"\"Create a new Card with the supplied rank and suit.\n+\n+        Keyword Arguments:\n+        rank -- Rank of the Card [Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Joker, Queen, King] (default random)\n+        suit -- Suite of the Card [Clubs, Diamonds, Hearts, Spades] (default random)\n+\n+        \"\"\"\n+        ranks = [\"Ace\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"Joker\", \"Queen\", \"King\"]\n+        if rank == \"random\":\n+            self.rank = random.choice(ranks)\n+        else:\n+            self.rank = rank\n+\n+        if suit == \"random\":\n+            self.suit = random.choice([\"Clubs\", \"Diamonds\", \"Hearts\", \"Spades\"])\n+        else:\n+            self.suit = suit\n+        self.value = ranks.index(self.rank) + 1\n+\n+    def get_rank(self):\n+        \"\"\"Return rank of Card.\"\"\"\n+        return self.rank\n+\n+    def get_suit(self):\n+        \"\"\"Return suit of Card.\"\"\"\n+        return self.suit","path":"cogs/cards.py","position":85,"original_position":85,"commit_id":"d4d78640a763a7d921b18663b93c00beca533d22","original_commit_id":"d4d78640a763a7d921b18663b93c00beca533d22","user":{"login":"raylu","id":90059,"avatar_url":"https://avatars.githubusercontent.com/u/90059?v=3","gravatar_id":"","url":"https://api.github.com/users/raylu","html_url":"https://github.com/raylu","followers_url":"https://api.github.com/users/raylu/followers","following_url":"https://api.github.com/users/raylu/following{/other_user}","gists_url":"https://api.github.com/users/raylu/gists{/gist_id}","starred_url":"https://api.github.com/users/raylu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raylu/subscriptions","organizations_url":"https://api.github.com/users/raylu/orgs","repos_url":"https://api.github.com/users/raylu/repos","events_url":"https://api.github.com/users/raylu/events{/privacy}","received_events_url":"https://api.github.com/users/raylu/received_events","type":"User","site_admin":false},"body":"these accessor methods smell like java. you don't even use them since it's easier to just do `card.rank` directly anyway.","created_at":"2016-03-10T22:24:59Z","updated_at":"2016-03-10T22:24:59Z","html_url":"https://github.com/PythonBuddies/main_bot/pull/3#discussion_r55760450","pull_request_url":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/comments/55760450"},"html":{"href":"https://github.com/PythonBuddies/main_bot/pull/3#discussion_r55760450"},"pull_request":{"href":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/3","id":62464720,"html_url":"https://github.com/PythonBuddies/main_bot/pull/3","diff_url":"https://github.com/PythonBuddies/main_bot/pull/3.diff","patch_url":"https://github.com/PythonBuddies/main_bot/pull/3.patch","issue_url":"https://api.github.com/repos/PythonBuddies/main_bot/issues/3","number":3,"state":"open","locked":false,"title":"Added cards.py, including Card and Deck class.","user":{"login":"RascalTwo","id":9403665,"avatar_url":"https://avatars.githubusercontent.com/u/9403665?v=3","gravatar_id":"","url":"https://api.github.com/users/RascalTwo","html_url":"https://github.com/RascalTwo","followers_url":"https://api.github.com/users/RascalTwo/followers","following_url":"https://api.github.com/users/RascalTwo/following{/other_user}","gists_url":"https://api.github.com/users/RascalTwo/gists{/gist_id}","starred_url":"https://api.github.com/users/RascalTwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RascalTwo/subscriptions","organizations_url":"https://api.github.com/users/RascalTwo/orgs","repos_url":"https://api.github.com/users/RascalTwo/repos","events_url":"https://api.github.com/users/RascalTwo/events{/privacy}","received_events_url":"https://api.github.com/users/RascalTwo/received_events","type":"User","site_admin":false},"body":"Basic Cards and Deck class and most-basic HiLo game. Still not comfortable with making it a pull request of this though, as there are quite a few flaws with it and I wanted to squash all the small commits too.","created_at":"2016-03-10T22:10:02Z","updated_at":"2016-03-10T22:24:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80642b587ab790f390d8f963af0d822924c467f6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/3/commits","review_comments_url":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/3/comments","review_comment_url":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PythonBuddies/main_bot/issues/3/comments","statuses_url":"https://api.github.com/repos/PythonBuddies/main_bot/statuses/d4d78640a763a7d921b18663b93c00beca533d22","head":{"label":"RascalTwo:cards","ref":"cards","sha":"d4d78640a763a7d921b18663b93c00beca533d22","user":{"login":"RascalTwo","id":9403665,"avatar_url":"https://avatars.githubusercontent.com/u/9403665?v=3","gravatar_id":"","url":"https://api.github.com/users/RascalTwo","html_url":"https://github.com/RascalTwo","followers_url":"https://api.github.com/users/RascalTwo/followers","following_url":"https://api.github.com/users/RascalTwo/following{/other_user}","gists_url":"https://api.github.com/users/RascalTwo/gists{/gist_id}","starred_url":"https://api.github.com/users/RascalTwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RascalTwo/subscriptions","organizations_url":"https://api.github.com/users/RascalTwo/orgs","repos_url":"https://api.github.com/users/RascalTwo/repos","events_url":"https://api.github.com/users/RascalTwo/events{/privacy}","received_events_url":"https://api.github.com/users/RascalTwo/received_events","type":"User","site_admin":false},"repo":{"id":53471340,"name":"main_bot","full_name":"RascalTwo/main_bot","owner":{"login":"RascalTwo","id":9403665,"avatar_url":"https://avatars.githubusercontent.com/u/9403665?v=3","gravatar_id":"","url":"https://api.github.com/users/RascalTwo","html_url":"https://github.com/RascalTwo","followers_url":"https://api.github.com/users/RascalTwo/followers","following_url":"https://api.github.com/users/RascalTwo/following{/other_user}","gists_url":"https://api.github.com/users/RascalTwo/gists{/gist_id}","starred_url":"https://api.github.com/users/RascalTwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RascalTwo/subscriptions","organizations_url":"https://api.github.com/users/RascalTwo/orgs","repos_url":"https://api.github.com/users/RascalTwo/repos","events_url":"https://api.github.com/users/RascalTwo/events{/privacy}","received_events_url":"https://api.github.com/users/RascalTwo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RascalTwo/main_bot","description":"This is our discord bot","fork":true,"url":"https://api.github.com/repos/RascalTwo/main_bot","forks_url":"https://api.github.com/repos/RascalTwo/main_bot/forks","keys_url":"https://api.github.com/repos/RascalTwo/main_bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RascalTwo/main_bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RascalTwo/main_bot/teams","hooks_url":"https://api.github.com/repos/RascalTwo/main_bot/hooks","issue_events_url":"https://api.github.com/repos/RascalTwo/main_bot/issues/events{/number}","events_url":"https://api.github.com/repos/RascalTwo/main_bot/events","assignees_url":"https://api.github.com/repos/RascalTwo/main_bot/assignees{/user}","branches_url":"https://api.github.com/repos/RascalTwo/main_bot/branches{/branch}","tags_url":"https://api.github.com/repos/RascalTwo/main_bot/tags","blobs_url":"https://api.github.com/repos/RascalTwo/main_bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RascalTwo/main_bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RascalTwo/main_bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/RascalTwo/main_bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RascalTwo/main_bot/statuses/{sha}","languages_url":"https://api.github.com/repos/RascalTwo/main_bot/languages","stargazers_url":"https://api.github.com/repos/RascalTwo/main_bot/stargazers","contributors_url":"https://api.github.com/repos/RascalTwo/main_bot/contributors","subscribers_url":"https://api.github.com/repos/RascalTwo/main_bot/subscribers","subscription_url":"https://api.github.com/repos/RascalTwo/main_bot/subscription","commits_url":"https://api.github.com/repos/RascalTwo/main_bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/RascalTwo/main_bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/RascalTwo/main_bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/RascalTwo/main_bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/RascalTwo/main_bot/contents/{+path}","compare_url":"https://api.github.com/repos/RascalTwo/main_bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RascalTwo/main_bot/merges","archive_url":"https://api.github.com/repos/RascalTwo/main_bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RascalTwo/main_bot/downloads","issues_url":"https://api.github.com/repos/RascalTwo/main_bot/issues{/number}","pulls_url":"https://api.github.com/repos/RascalTwo/main_bot/pulls{/number}","milestones_url":"https://api.github.com/repos/RascalTwo/main_bot/milestones{/number}","notifications_url":"https://api.github.com/repos/RascalTwo/main_bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RascalTwo/main_bot/labels{/name}","releases_url":"https://api.github.com/repos/RascalTwo/main_bot/releases{/id}","deployments_url":"https://api.github.com/repos/RascalTwo/main_bot/deployments","created_at":"2016-03-09T05:40:03Z","updated_at":"2016-03-09T05:40:04Z","pushed_at":"2016-03-09T14:18:29Z","git_url":"git://github.com/RascalTwo/main_bot.git","ssh_url":"git@github.com:RascalTwo/main_bot.git","clone_url":"https://github.com/RascalTwo/main_bot.git","svn_url":"https://github.com/RascalTwo/main_bot","homepage":null,"size":30,"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":"PythonBuddies:master","ref":"master","sha":"355a1d5bc5b71a1722022727f4a5f06949c3e78b","user":{"login":"PythonBuddies","id":17649242,"avatar_url":"https://avatars.githubusercontent.com/u/17649242?v=3","gravatar_id":"","url":"https://api.github.com/users/PythonBuddies","html_url":"https://github.com/PythonBuddies","followers_url":"https://api.github.com/users/PythonBuddies/followers","following_url":"https://api.github.com/users/PythonBuddies/following{/other_user}","gists_url":"https://api.github.com/users/PythonBuddies/gists{/gist_id}","starred_url":"https://api.github.com/users/PythonBuddies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PythonBuddies/subscriptions","organizations_url":"https://api.github.com/users/PythonBuddies/orgs","repos_url":"https://api.github.com/users/PythonBuddies/repos","events_url":"https://api.github.com/users/PythonBuddies/events{/privacy}","received_events_url":"https://api.github.com/users/PythonBuddies/received_events","type":"Organization","site_admin":false},"repo":{"id":53238744,"name":"main_bot","full_name":"PythonBuddies/main_bot","owner":{"login":"PythonBuddies","id":17649242,"avatar_url":"https://avatars.githubusercontent.com/u/17649242?v=3","gravatar_id":"","url":"https://api.github.com/users/PythonBuddies","html_url":"https://github.com/PythonBuddies","followers_url":"https://api.github.com/users/PythonBuddies/followers","following_url":"https://api.github.com/users/PythonBuddies/following{/other_user}","gists_url":"https://api.github.com/users/PythonBuddies/gists{/gist_id}","starred_url":"https://api.github.com/users/PythonBuddies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PythonBuddies/subscriptions","organizations_url":"https://api.github.com/users/PythonBuddies/orgs","repos_url":"https://api.github.com/users/PythonBuddies/repos","events_url":"https://api.github.com/users/PythonBuddies/events{/privacy}","received_events_url":"https://api.github.com/users/PythonBuddies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PythonBuddies/main_bot","description":"This is our discord bot","fork":false,"url":"https://api.github.com/repos/PythonBuddies/main_bot","forks_url":"https://api.github.com/repos/PythonBuddies/main_bot/forks","keys_url":"https://api.github.com/repos/PythonBuddies/main_bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PythonBuddies/main_bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PythonBuddies/main_bot/teams","hooks_url":"https://api.github.com/repos/PythonBuddies/main_bot/hooks","issue_events_url":"https://api.github.com/repos/PythonBuddies/main_bot/issues/events{/number}","events_url":"https://api.github.com/repos/PythonBuddies/main_bot/events","assignees_url":"https://api.github.com/repos/PythonBuddies/main_bot/assignees{/user}","branches_url":"https://api.github.com/repos/PythonBuddies/main_bot/branches{/branch}","tags_url":"https://api.github.com/repos/PythonBuddies/main_bot/tags","blobs_url":"https://api.github.com/repos/PythonBuddies/main_bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PythonBuddies/main_bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PythonBuddies/main_bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/PythonBuddies/main_bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PythonBuddies/main_bot/statuses/{sha}","languages_url":"https://api.github.com/repos/PythonBuddies/main_bot/languages","stargazers_url":"https://api.github.com/repos/PythonBuddies/main_bot/stargazers","contributors_url":"https://api.github.com/repos/PythonBuddies/main_bot/contributors","subscribers_url":"https://api.github.com/repos/PythonBuddies/main_bot/subscribers","subscription_url":"https://api.github.com/repos/PythonBuddies/main_bot/subscription","commits_url":"https://api.github.com/repos/PythonBuddies/main_bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/PythonBuddies/main_bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/PythonBuddies/main_bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/PythonBuddies/main_bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/PythonBuddies/main_bot/contents/{+path}","compare_url":"https://api.github.com/repos/PythonBuddies/main_bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PythonBuddies/main_bot/merges","archive_url":"https://api.github.com/repos/PythonBuddies/main_bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PythonBuddies/main_bot/downloads","issues_url":"https://api.github.com/repos/PythonBuddies/main_bot/issues{/number}","pulls_url":"https://api.github.com/repos/PythonBuddies/main_bot/pulls{/number}","milestones_url":"https://api.github.com/repos/PythonBuddies/main_bot/milestones{/number}","notifications_url":"https://api.github.com/repos/PythonBuddies/main_bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PythonBuddies/main_bot/labels{/name}","releases_url":"https://api.github.com/repos/PythonBuddies/main_bot/releases{/id}","deployments_url":"https://api.github.com/repos/PythonBuddies/main_bot/deployments","created_at":"2016-03-06T05:06:17Z","updated_at":"2016-03-07T23:02:35Z","pushed_at":"2016-03-10T22:10:02Z","git_url":"git://github.com/PythonBuddies/main_bot.git","ssh_url":"git@github.com:PythonBuddies/main_bot.git","clone_url":"https://github.com/PythonBuddies/main_bot.git","svn_url":"https://github.com/PythonBuddies/main_bot","homepage":null,"size":27,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/3"},"html":{"href":"https://github.com/PythonBuddies/main_bot/pull/3"},"issue":{"href":"https://api.github.com/repos/PythonBuddies/main_bot/issues/3"},"comments":{"href":"https://api.github.com/repos/PythonBuddies/main_bot/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PythonBuddies/main_bot/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/PythonBuddies/main_bot/statuses/d4d78640a763a7d921b18663b93c00beca533d22"}}}}