{"action":"created","comment":{"url":"https://api.github.com/repos/discord-python/bot/pulls/comments/169200646","pull_request_review_id":97688539,"id":169200646,"diff_hunk":"@@ -45,3 +57,100 @@ def _convert_keys(self):\n         for k in list(self.keys()):\n             v = super(CaseInsensitiveDict, self).pop(k)\n             self.__setitem__(k, v)\n+\n+\n+async def paginate(lines: Iterable[str], ctx: Context, embed: Embed,\n+                   prefix: str = \"\", suffix: str = \"\", max_size: int = 500, empty: bool = True,\n+                   restrict_to_user: User = None):\n+    \"\"\"\n+    Use a paginator and set of reactions to provide pagination over a set of lines. The reactions are used to\n+    switch page, or to finish with pagination.\n+\n+    When used, this will send a message using `ctx.send()` and apply a set of reactions to it. These reactions may\n+    be used to change page, or to remove pagination from the message. Pagination will also be removed automatically\n+    if no reaction is added for five minutes (300 seconds).\n+\n+    >>> embed = Embed()\n+    >>> embed.set_author(name=\"Some Operation\", url=url, icon_url=icon)\n+    >>> await paginate(\n+    ...     (line for line in lines),\n+    ...     ctx, embed\n+    ... )\n+\n+    :param lines: The lines to be paginated\n+    :param ctx: Current context object\n+    :param embed: A pre-configured embed to be used as a template for each page\n+    :param prefix: Text to place before each page\n+    :param suffix: Text to place after each page\n+    :param max_size: The maximum number of characters on each page\n+    :param empty: Whether to place an empty line between each given line\n+    :param restrict_to_user: A user to lock pagination operations to for this message, if supplied\n+    \"\"\"\n+\n+    paginator = Paginator(prefix=prefix, suffix=suffix, max_size=max_size)\n+    current_page = 0\n+\n+    for line in lines:\n+        paginator.add_line(line, empty=empty)\n+\n+    embed.description = paginator.pages[current_page]\n+\n+    message = await ctx.send(embed=embed)\n+\n+    if len(paginator.pages) <= 1:\n+        return  # There's only one page\n+\n+    embed.set_footer(text=f\"Page {current_page + 1}/{len(paginator.pages)}\")\n+\n+    def event_check(reaction_: Reaction, user_: Member):","path":"bot/utils.py","position":66,"original_position":66,"commit_id":"d35c64869af0e03662c5b75265cf7d6358027561","original_commit_id":"d35c64869af0e03662c5b75265cf7d6358027561","user":{"login":"1mn","id":2098517,"avatar_url":"https://avatars2.githubusercontent.com/u/2098517?v=4","gravatar_id":"","url":"https://api.github.com/users/1mn","html_url":"https://github.com/1mn","followers_url":"https://api.github.com/users/1mn/followers","following_url":"https://api.github.com/users/1mn/following{/other_user}","gists_url":"https://api.github.com/users/1mn/gists{/gist_id}","starred_url":"https://api.github.com/users/1mn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1mn/subscriptions","organizations_url":"https://api.github.com/users/1mn/orgs","repos_url":"https://api.github.com/users/1mn/repos","events_url":"https://api.github.com/users/1mn/events{/privacy}","received_events_url":"https://api.github.com/users/1mn/received_events","type":"User","site_admin":false},"body":"I'm not a fan of this function def being in the middle of the other function body. I'd prefer it right at the start..","created_at":"2018-02-20T01:34:00Z","updated_at":"2018-02-20T01:34:00Z","html_url":"https://github.com/discord-python/bot/pull/10#discussion_r169200646","pull_request_url":"https://api.github.com/repos/discord-python/bot/pulls/10","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/discord-python/bot/pulls/comments/169200646"},"html":{"href":"https://github.com/discord-python/bot/pull/10#discussion_r169200646"},"pull_request":{"href":"https://api.github.com/repos/discord-python/bot/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/discord-python/bot/pulls/10","id":169800222,"html_url":"https://github.com/discord-python/bot/pull/10","diff_url":"https://github.com/discord-python/bot/pull/10.diff","patch_url":"https://github.com/discord-python/bot/pull/10.patch","issue_url":"https://api.github.com/repos/discord-python/bot/issues/10","number":10,"state":"open","locked":false,"title":"Clickup commands #z20f","user":{"login":"gdude2002","id":204153,"avatar_url":"https://avatars3.githubusercontent.com/u/204153?v=4","gravatar_id":"","url":"https://api.github.com/users/gdude2002","html_url":"https://github.com/gdude2002","followers_url":"https://api.github.com/users/gdude2002/followers","following_url":"https://api.github.com/users/gdude2002/following{/other_user}","gists_url":"https://api.github.com/users/gdude2002/gists{/gist_id}","starred_url":"https://api.github.com/users/gdude2002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdude2002/subscriptions","organizations_url":"https://api.github.com/users/gdude2002/orgs","repos_url":"https://api.github.com/users/gdude2002/repos","events_url":"https://api.github.com/users/gdude2002/events{/privacy}","received_events_url":"https://api.github.com/users/gdude2002/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-17T20:30:47Z","updated_at":"2018-02-20T01:34:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afdd5eca6c2021eadf9ce005a76ca2831251cc9b","assignee":{"login":"gdude2002","id":204153,"avatar_url":"https://avatars3.githubusercontent.com/u/204153?v=4","gravatar_id":"","url":"https://api.github.com/users/gdude2002","html_url":"https://github.com/gdude2002","followers_url":"https://api.github.com/users/gdude2002/followers","following_url":"https://api.github.com/users/gdude2002/following{/other_user}","gists_url":"https://api.github.com/users/gdude2002/gists{/gist_id}","starred_url":"https://api.github.com/users/gdude2002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdude2002/subscriptions","organizations_url":"https://api.github.com/users/gdude2002/orgs","repos_url":"https://api.github.com/users/gdude2002/repos","events_url":"https://api.github.com/users/gdude2002/events{/privacy}","received_events_url":"https://api.github.com/users/gdude2002/received_events","type":"User","site_admin":false},"assignees":[{"login":"gdude2002","id":204153,"avatar_url":"https://avatars3.githubusercontent.com/u/204153?v=4","gravatar_id":"","url":"https://api.github.com/users/gdude2002","html_url":"https://github.com/gdude2002","followers_url":"https://api.github.com/users/gdude2002/followers","following_url":"https://api.github.com/users/gdude2002/following{/other_user}","gists_url":"https://api.github.com/users/gdude2002/gists{/gist_id}","starred_url":"https://api.github.com/users/gdude2002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdude2002/subscriptions","organizations_url":"https://api.github.com/users/gdude2002/orgs","repos_url":"https://api.github.com/users/gdude2002/repos","events_url":"https://api.github.com/users/gdude2002/events{/privacy}","received_events_url":"https://api.github.com/users/gdude2002/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"AkiraSama","id":15204920,"avatar_url":"https://avatars2.githubusercontent.com/u/15204920?v=4","gravatar_id":"","url":"https://api.github.com/users/AkiraSama","html_url":"https://github.com/AkiraSama","followers_url":"https://api.github.com/users/AkiraSama/followers","following_url":"https://api.github.com/users/AkiraSama/following{/other_user}","gists_url":"https://api.github.com/users/AkiraSama/gists{/gist_id}","starred_url":"https://api.github.com/users/AkiraSama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AkiraSama/subscriptions","organizations_url":"https://api.github.com/users/AkiraSama/orgs","repos_url":"https://api.github.com/users/AkiraSama/repos","events_url":"https://api.github.com/users/AkiraSama/events{/privacy}","received_events_url":"https://api.github.com/users/AkiraSama/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/discord-python/bot/pulls/10/commits","review_comments_url":"https://api.github.com/repos/discord-python/bot/pulls/10/comments","review_comment_url":"https://api.github.com/repos/discord-python/bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/discord-python/bot/issues/10/comments","statuses_url":"https://api.github.com/repos/discord-python/bot/statuses/d35c64869af0e03662c5b75265cf7d6358027561","head":{"label":"discord-python:clickup-commands","ref":"clickup-commands","sha":"d35c64869af0e03662c5b75265cf7d6358027561","user":{"login":"discord-python","id":36101493,"avatar_url":"https://avatars0.githubusercontent.com/u/36101493?v=4","gravatar_id":"","url":"https://api.github.com/users/discord-python","html_url":"https://github.com/discord-python","followers_url":"https://api.github.com/users/discord-python/followers","following_url":"https://api.github.com/users/discord-python/following{/other_user}","gists_url":"https://api.github.com/users/discord-python/gists{/gist_id}","starred_url":"https://api.github.com/users/discord-python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discord-python/subscriptions","organizations_url":"https://api.github.com/users/discord-python/orgs","repos_url":"https://api.github.com/users/discord-python/repos","events_url":"https://api.github.com/users/discord-python/events{/privacy}","received_events_url":"https://api.github.com/users/discord-python/received_events","type":"Organization","site_admin":false},"repo":{"id":120088519,"name":"bot","full_name":"discord-python/bot","owner":{"login":"discord-python","id":36101493,"avatar_url":"https://avatars0.githubusercontent.com/u/36101493?v=4","gravatar_id":"","url":"https://api.github.com/users/discord-python","html_url":"https://github.com/discord-python","followers_url":"https://api.github.com/users/discord-python/followers","following_url":"https://api.github.com/users/discord-python/following{/other_user}","gists_url":"https://api.github.com/users/discord-python/gists{/gist_id}","starred_url":"https://api.github.com/users/discord-python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discord-python/subscriptions","organizations_url":"https://api.github.com/users/discord-python/orgs","repos_url":"https://api.github.com/users/discord-python/repos","events_url":"https://api.github.com/users/discord-python/events{/privacy}","received_events_url":"https://api.github.com/users/discord-python/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/discord-python/bot","description":"Source code for our Discord bot","fork":false,"url":"https://api.github.com/repos/discord-python/bot","forks_url":"https://api.github.com/repos/discord-python/bot/forks","keys_url":"https://api.github.com/repos/discord-python/bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/discord-python/bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/discord-python/bot/teams","hooks_url":"https://api.github.com/repos/discord-python/bot/hooks","issue_events_url":"https://api.github.com/repos/discord-python/bot/issues/events{/number}","events_url":"https://api.github.com/repos/discord-python/bot/events","assignees_url":"https://api.github.com/repos/discord-python/bot/assignees{/user}","branches_url":"https://api.github.com/repos/discord-python/bot/branches{/branch}","tags_url":"https://api.github.com/repos/discord-python/bot/tags","blobs_url":"https://api.github.com/repos/discord-python/bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/discord-python/bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/discord-python/bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/discord-python/bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/discord-python/bot/statuses/{sha}","languages_url":"https://api.github.com/repos/discord-python/bot/languages","stargazers_url":"https://api.github.com/repos/discord-python/bot/stargazers","contributors_url":"https://api.github.com/repos/discord-python/bot/contributors","subscribers_url":"https://api.github.com/repos/discord-python/bot/subscribers","subscription_url":"https://api.github.com/repos/discord-python/bot/subscription","commits_url":"https://api.github.com/repos/discord-python/bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/discord-python/bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/discord-python/bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/discord-python/bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/discord-python/bot/contents/{+path}","compare_url":"https://api.github.com/repos/discord-python/bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/discord-python/bot/merges","archive_url":"https://api.github.com/repos/discord-python/bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/discord-python/bot/downloads","issues_url":"https://api.github.com/repos/discord-python/bot/issues{/number}","pulls_url":"https://api.github.com/repos/discord-python/bot/pulls{/number}","milestones_url":"https://api.github.com/repos/discord-python/bot/milestones{/number}","notifications_url":"https://api.github.com/repos/discord-python/bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/discord-python/bot/labels{/name}","releases_url":"https://api.github.com/repos/discord-python/bot/releases{/id}","deployments_url":"https://api.github.com/repos/discord-python/bot/deployments","created_at":"2018-02-03T12:20:25Z","updated_at":"2018-02-17T20:08:22Z","pushed_at":"2018-02-19T19:21:02Z","git_url":"git://github.com/discord-python/bot.git","ssh_url":"git@github.com:discord-python/bot.git","clone_url":"https://github.com/discord-python/bot.git","svn_url":"https://github.com/discord-python/bot","homepage":"","size":108,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":2,"open_issues":2,"watchers":4,"default_branch":"master"}},"base":{"label":"discord-python:master","ref":"master","sha":"47136cf9378216c140fae475e188bbee48a822e6","user":{"login":"discord-python","id":36101493,"avatar_url":"https://avatars0.githubusercontent.com/u/36101493?v=4","gravatar_id":"","url":"https://api.github.com/users/discord-python","html_url":"https://github.com/discord-python","followers_url":"https://api.github.com/users/discord-python/followers","following_url":"https://api.github.com/users/discord-python/following{/other_user}","gists_url":"https://api.github.com/users/discord-python/gists{/gist_id}","starred_url":"https://api.github.com/users/discord-python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discord-python/subscriptions","organizations_url":"https://api.github.com/users/discord-python/orgs","repos_url":"https://api.github.com/users/discord-python/repos","events_url":"https://api.github.com/users/discord-python/events{/privacy}","received_events_url":"https://api.github.com/users/discord-python/received_events","type":"Organization","site_admin":false},"repo":{"id":120088519,"name":"bot","full_name":"discord-python/bot","owner":{"login":"discord-python","id":36101493,"avatar_url":"https://avatars0.githubusercontent.com/u/36101493?v=4","gravatar_id":"","url":"https://api.github.com/users/discord-python","html_url":"https://github.com/discord-python","followers_url":"https://api.github.com/users/discord-python/followers","following_url":"https://api.github.com/users/discord-python/following{/other_user}","gists_url":"https://api.github.com/users/discord-python/gists{/gist_id}","starred_url":"https://api.github.com/users/discord-python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discord-python/subscriptions","organizations_url":"https://api.github.com/users/discord-python/orgs","repos_url":"https://api.github.com/users/discord-python/repos","events_url":"https://api.github.com/users/discord-python/events{/privacy}","received_events_url":"https://api.github.com/users/discord-python/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/discord-python/bot","description":"Source code for our Discord bot","fork":false,"url":"https://api.github.com/repos/discord-python/bot","forks_url":"https://api.github.com/repos/discord-python/bot/forks","keys_url":"https://api.github.com/repos/discord-python/bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/discord-python/bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/discord-python/bot/teams","hooks_url":"https://api.github.com/repos/discord-python/bot/hooks","issue_events_url":"https://api.github.com/repos/discord-python/bot/issues/events{/number}","events_url":"https://api.github.com/repos/discord-python/bot/events","assignees_url":"https://api.github.com/repos/discord-python/bot/assignees{/user}","branches_url":"https://api.github.com/repos/discord-python/bot/branches{/branch}","tags_url":"https://api.github.com/repos/discord-python/bot/tags","blobs_url":"https://api.github.com/repos/discord-python/bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/discord-python/bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/discord-python/bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/discord-python/bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/discord-python/bot/statuses/{sha}","languages_url":"https://api.github.com/repos/discord-python/bot/languages","stargazers_url":"https://api.github.com/repos/discord-python/bot/stargazers","contributors_url":"https://api.github.com/repos/discord-python/bot/contributors","subscribers_url":"https://api.github.com/repos/discord-python/bot/subscribers","subscription_url":"https://api.github.com/repos/discord-python/bot/subscription","commits_url":"https://api.github.com/repos/discord-python/bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/discord-python/bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/discord-python/bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/discord-python/bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/discord-python/bot/contents/{+path}","compare_url":"https://api.github.com/repos/discord-python/bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/discord-python/bot/merges","archive_url":"https://api.github.com/repos/discord-python/bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/discord-python/bot/downloads","issues_url":"https://api.github.com/repos/discord-python/bot/issues{/number}","pulls_url":"https://api.github.com/repos/discord-python/bot/pulls{/number}","milestones_url":"https://api.github.com/repos/discord-python/bot/milestones{/number}","notifications_url":"https://api.github.com/repos/discord-python/bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/discord-python/bot/labels{/name}","releases_url":"https://api.github.com/repos/discord-python/bot/releases{/id}","deployments_url":"https://api.github.com/repos/discord-python/bot/deployments","created_at":"2018-02-03T12:20:25Z","updated_at":"2018-02-17T20:08:22Z","pushed_at":"2018-02-19T19:21:02Z","git_url":"git://github.com/discord-python/bot.git","ssh_url":"git@github.com:discord-python/bot.git","clone_url":"https://github.com/discord-python/bot.git","svn_url":"https://github.com/discord-python/bot","homepage":"","size":108,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":2,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/discord-python/bot/pulls/10"},"html":{"href":"https://github.com/discord-python/bot/pull/10"},"issue":{"href":"https://api.github.com/repos/discord-python/bot/issues/10"},"comments":{"href":"https://api.github.com/repos/discord-python/bot/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/discord-python/bot/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/discord-python/bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/discord-python/bot/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/discord-python/bot/statuses/d35c64869af0e03662c5b75265cf7d6358027561"}},"author_association":"OWNER"}}
{"actor":{"display_login":"1mn"}}