{"action":"created","comment":{"url":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/comments/123897985","pull_request_review_id":46144626,"id":123897985,"diff_hunk":"@@ -143,33 +244,66 @@ public enum DiscordEndpoint : String {\n \n         - parameter with: A DiscordToken that will be used for authentication\n         - parameter for: The endpoint this request is for\n-        - parameter replacing: A dictionary that will be used to fill in the endpoint's url\n         - parameter getParams: An optional dictionary of get parameters.\n \n         - returns: a URLRequest that can be further customized\n     */\n-    public static func createRequest(with token: DiscordToken, for endpoint: DiscordEndpoint,\n-                                     replacing: [String: String], getParams: [String: String]? = nil) -> URLRequest {\n+    public func createRequest(with token: DiscordToken, method: HTTPMethod) -> URLRequest? {\n+\n+        let getParams: [String: String]?\n+        if case let .get(params) = method {\n+            getParams = params\n+        }\n+        else {","path":"Sources/SwiftDiscord/DiscordEndpoint.swift","position":270,"original_position":270,"commit_id":"f5dec3df1334c06a332d06c743f369f9a8772ccc","original_commit_id":"f5dec3df1334c06a332d06c743f369f9a8772ccc","user":{"login":"nuclearace","id":1211049,"avatar_url":"https://avatars3.githubusercontent.com/u/1211049?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearace","html_url":"https://github.com/nuclearace","followers_url":"https://api.github.com/users/nuclearace/followers","following_url":"https://api.github.com/users/nuclearace/following{/other_user}","gists_url":"https://api.github.com/users/nuclearace/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearace/subscriptions","organizations_url":"https://api.github.com/users/nuclearace/orgs","repos_url":"https://api.github.com/users/nuclearace/repos","events_url":"https://api.github.com/users/nuclearace/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearace/received_events","type":"User","site_admin":false},"body":"Else should be on the same line as the }","created_at":"2017-06-25T12:37:26Z","updated_at":"2017-06-25T12:55:24Z","html_url":"https://github.com/nuclearace/SwiftDiscord/pull/20#discussion_r123897985","pull_request_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/comments/123897985"},"html":{"href":"https://github.com/nuclearace/SwiftDiscord/pull/20#discussion_r123897985"},"pull_request":{"href":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/20","id":127357220,"html_url":"https://github.com/nuclearace/SwiftDiscord/pull/20","diff_url":"https://github.com/nuclearace/SwiftDiscord/pull/20.diff","patch_url":"https://github.com/nuclearace/SwiftDiscord/pull/20.patch","issue_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/issues/20","number":20,"state":"open","locked":false,"title":"Less string replacement","user":{"login":"tellowkrinkle","id":3315070,"avatar_url":"https://avatars1.githubusercontent.com/u/3315070?v=3","gravatar_id":"","url":"https://api.github.com/users/tellowkrinkle","html_url":"https://github.com/tellowkrinkle","followers_url":"https://api.github.com/users/tellowkrinkle/followers","following_url":"https://api.github.com/users/tellowkrinkle/following{/other_user}","gists_url":"https://api.github.com/users/tellowkrinkle/gists{/gist_id}","starred_url":"https://api.github.com/users/tellowkrinkle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tellowkrinkle/subscriptions","organizations_url":"https://api.github.com/users/tellowkrinkle/orgs","repos_url":"https://api.github.com/users/tellowkrinkle/repos","events_url":"https://api.github.com/users/tellowkrinkle/events{/privacy}","received_events_url":"https://api.github.com/users/tellowkrinkle/received_events","type":"User","site_admin":false},"body":"- Logging no longer uses `%@` + varargs.  Swift string interpolation should be used instead.  This prevents accidents where you include args but forget to include a `%@` in the string.  The calls are now lazy as well, so any string conversion you do will only be run if the result is going to be printed.\r\n- `JSON.encodeJSONData` no longer converts the data to a string and back to data.  It seemed kind of unnecessary.\r\n- Endpoint generation now uses enums with associated types and a separate method which generates urls instead of string replacement with a dictionary.  This means that you won't be able to forget a required piece or mistype its name.\r\n- `DiscordEnpoint.createRequest` now takes the HTTP method and any data associated with it and fills the request object accordingly, so it should be much harder to accidentally leave one of those out (and much less to do in any method that makes requests).\r\n- New `executeRequest` method for `DiscordRateLimiter` which takes an endpoint (with its associated data), a token, an HTTP method (and its associated data), and a callback and does everything else for you.\r\n- New rate limit key creation which (I think) conforms to the spec listed on Discord's website.\r\n\r\nNote: If you want to add a new endpoint, there are now three places where you have to add code.  They're all default-less switch statements, so the compiler should complain at you if you forget one.  One is the enum definition, one is in the enum's description method (where it actually creates the URL), and the third is in DiscordRateLimitKey's init (to indicate what parts to use as the rate limit key).","created_at":"2017-06-25T08:43:48Z","updated_at":"2017-06-25T12:55:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6b646f894c0dcbb937892b3f10c8ea621a2d184","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/20/commits","review_comments_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/20/comments","review_comment_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/issues/20/comments","statuses_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/statuses/f5dec3df1334c06a332d06c743f369f9a8772ccc","head":{"label":"tellowkrinkle:LessStringReplacement","ref":"LessStringReplacement","sha":"f5dec3df1334c06a332d06c743f369f9a8772ccc","user":{"login":"tellowkrinkle","id":3315070,"avatar_url":"https://avatars1.githubusercontent.com/u/3315070?v=3","gravatar_id":"","url":"https://api.github.com/users/tellowkrinkle","html_url":"https://github.com/tellowkrinkle","followers_url":"https://api.github.com/users/tellowkrinkle/followers","following_url":"https://api.github.com/users/tellowkrinkle/following{/other_user}","gists_url":"https://api.github.com/users/tellowkrinkle/gists{/gist_id}","starred_url":"https://api.github.com/users/tellowkrinkle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tellowkrinkle/subscriptions","organizations_url":"https://api.github.com/users/tellowkrinkle/orgs","repos_url":"https://api.github.com/users/tellowkrinkle/repos","events_url":"https://api.github.com/users/tellowkrinkle/events{/privacy}","received_events_url":"https://api.github.com/users/tellowkrinkle/received_events","type":"User","site_admin":false},"repo":{"id":95079680,"name":"SwiftDiscord","full_name":"tellowkrinkle/SwiftDiscord","owner":{"login":"tellowkrinkle","id":3315070,"avatar_url":"https://avatars1.githubusercontent.com/u/3315070?v=3","gravatar_id":"","url":"https://api.github.com/users/tellowkrinkle","html_url":"https://github.com/tellowkrinkle","followers_url":"https://api.github.com/users/tellowkrinkle/followers","following_url":"https://api.github.com/users/tellowkrinkle/following{/other_user}","gists_url":"https://api.github.com/users/tellowkrinkle/gists{/gist_id}","starred_url":"https://api.github.com/users/tellowkrinkle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tellowkrinkle/subscriptions","organizations_url":"https://api.github.com/users/tellowkrinkle/orgs","repos_url":"https://api.github.com/users/tellowkrinkle/repos","events_url":"https://api.github.com/users/tellowkrinkle/events{/privacy}","received_events_url":"https://api.github.com/users/tellowkrinkle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tellowkrinkle/SwiftDiscord","description":"Discord API Client for Swift","fork":true,"url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord","forks_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/forks","keys_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/teams","hooks_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/hooks","issue_events_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/issues/events{/number}","events_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/events","assignees_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/assignees{/user}","branches_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/branches{/branch}","tags_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/tags","blobs_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/git/refs{/sha}","trees_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/statuses/{sha}","languages_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/languages","stargazers_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/stargazers","contributors_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/contributors","subscribers_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/subscribers","subscription_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/subscription","commits_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/commits{/sha}","git_commits_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/git/commits{/sha}","comments_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/comments{/number}","issue_comment_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/issues/comments{/number}","contents_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/contents/{+path}","compare_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/merges","archive_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/downloads","issues_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/issues{/number}","pulls_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/pulls{/number}","milestones_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/milestones{/number}","notifications_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/labels{/name}","releases_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/releases{/id}","deployments_url":"https://api.github.com/repos/tellowkrinkle/SwiftDiscord/deployments","created_at":"2017-06-22T05:53:58Z","updated_at":"2017-06-22T05:53:59Z","pushed_at":"2017-06-25T08:43:24Z","git_url":"git://github.com/tellowkrinkle/SwiftDiscord.git","ssh_url":"git@github.com:tellowkrinkle/SwiftDiscord.git","clone_url":"https://github.com/tellowkrinkle/SwiftDiscord.git","svn_url":"https://github.com/tellowkrinkle/SwiftDiscord","homepage":"","size":4063,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_projects":true,"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":"nuclearace:development","ref":"development","sha":"4fcbe6c42f48677d5d88143519665a2d61ce0447","user":{"login":"nuclearace","id":1211049,"avatar_url":"https://avatars3.githubusercontent.com/u/1211049?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearace","html_url":"https://github.com/nuclearace","followers_url":"https://api.github.com/users/nuclearace/followers","following_url":"https://api.github.com/users/nuclearace/following{/other_user}","gists_url":"https://api.github.com/users/nuclearace/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearace/subscriptions","organizations_url":"https://api.github.com/users/nuclearace/orgs","repos_url":"https://api.github.com/users/nuclearace/repos","events_url":"https://api.github.com/users/nuclearace/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearace/received_events","type":"User","site_admin":false},"repo":{"id":69760130,"name":"SwiftDiscord","full_name":"nuclearace/SwiftDiscord","owner":{"login":"nuclearace","id":1211049,"avatar_url":"https://avatars3.githubusercontent.com/u/1211049?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearace","html_url":"https://github.com/nuclearace","followers_url":"https://api.github.com/users/nuclearace/followers","following_url":"https://api.github.com/users/nuclearace/following{/other_user}","gists_url":"https://api.github.com/users/nuclearace/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearace/subscriptions","organizations_url":"https://api.github.com/users/nuclearace/orgs","repos_url":"https://api.github.com/users/nuclearace/repos","events_url":"https://api.github.com/users/nuclearace/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearace/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nuclearace/SwiftDiscord","description":"Discord API Client for Swift","fork":false,"url":"https://api.github.com/repos/nuclearace/SwiftDiscord","forks_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/forks","keys_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/teams","hooks_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/hooks","issue_events_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/issues/events{/number}","events_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/events","assignees_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/assignees{/user}","branches_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/branches{/branch}","tags_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/tags","blobs_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/statuses/{sha}","languages_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/languages","stargazers_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/stargazers","contributors_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/contributors","subscribers_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/subscribers","subscription_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/subscription","commits_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/contents/{+path}","compare_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/merges","archive_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/downloads","issues_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/issues{/number}","pulls_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls{/number}","milestones_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/milestones{/number}","notifications_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/labels{/name}","releases_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/releases{/id}","deployments_url":"https://api.github.com/repos/nuclearace/SwiftDiscord/deployments","created_at":"2016-10-01T19:52:23Z","updated_at":"2017-06-02T14:49:40Z","pushed_at":"2017-06-25T08:43:49Z","git_url":"git://github.com/nuclearace/SwiftDiscord.git","ssh_url":"git@github.com:nuclearace/SwiftDiscord.git","clone_url":"https://github.com/nuclearace/SwiftDiscord.git","svn_url":"https://github.com/nuclearace/SwiftDiscord","homepage":"","size":4050,"stargazers_count":15,"watchers_count":15,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/20"},"html":{"href":"https://github.com/nuclearace/SwiftDiscord/pull/20"},"issue":{"href":"https://api.github.com/repos/nuclearace/SwiftDiscord/issues/20"},"comments":{"href":"https://api.github.com/repos/nuclearace/SwiftDiscord/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nuclearace/SwiftDiscord/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/nuclearace/SwiftDiscord/statuses/f5dec3df1334c06a332d06c743f369f9a8772ccc"}}}}
{"actor":{"display_login":"nuclearace"}}