{"action":"created","comment":{"url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/comments/64139494","id":64139494,"diff_hunk":"@@ -0,0 +1,67 @@\n+<?php\n+\n+namespace Telegram\\Bot\\Bots;\n+\n+use League\\Event\\Emitter;\n+use Telegram\\Bot\\Api;\n+use Telegram\\Bot\\Events\\UpdateWasReceived;\n+use Telegram\\Bot\\Events\\EmitsEvents;\n+\n+class Bot{\n+        \n+    use EmitsEvents;\n+    \n+    protected $api = null;\n+    \n+    protected $name = null;\n+    \n+    public function __construct($name = null, Api $api = null)\n+    {\n+        \n+        if($api === null){\n+            $this->api = new Api();\n+        }else{\n+            $this->api = $api;\n+        }\n+        \n+        $this->name = $name;\n+        $this->setEventEmitter(new Emitter());\n+    }\n+    \n+    public function getApi(){\n+        return $this->api;\n+    }\n+    \n+    public function getName(){\n+        return $this->name;\n+    }\n+    \n+    public function setName($name){","path":"src/Bots/Bot.php","position":39,"original_position":39,"commit_id":"82494ba1b885c50d0ae1ac257a26360cf78ba55c","original_commit_id":"82494ba1b885c50d0ae1ac257a26360cf78ba55c","user":{"login":"Nitpick-CI","id":12626182,"avatar_url":"https://avatars.githubusercontent.com/u/12626182?v=3","gravatar_id":"","url":"https://api.github.com/users/Nitpick-CI","html_url":"https://github.com/Nitpick-CI","followers_url":"https://api.github.com/users/Nitpick-CI/followers","following_url":"https://api.github.com/users/Nitpick-CI/following{/other_user}","gists_url":"https://api.github.com/users/Nitpick-CI/gists{/gist_id}","starred_url":"https://api.github.com/users/Nitpick-CI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nitpick-CI/subscriptions","organizations_url":"https://api.github.com/users/Nitpick-CI/orgs","repos_url":"https://api.github.com/users/Nitpick-CI/repos","events_url":"https://api.github.com/users/Nitpick-CI/events{/privacy}","received_events_url":"https://api.github.com/users/Nitpick-CI/received_events","type":"User","site_admin":false},"body":"Opening brace should be on a new line","created_at":"2016-05-21T20:01:16Z","updated_at":"2016-05-21T20:01:16Z","html_url":"https://github.com/irazasyed/telegram-bot-sdk/pull/182#discussion_r64139494","pull_request_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/182","_links":{"self":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/comments/64139494"},"html":{"href":"https://github.com/irazasyed/telegram-bot-sdk/pull/182#discussion_r64139494"},"pull_request":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/182"}}},"pull_request":{"url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/182","id":70958894,"html_url":"https://github.com/irazasyed/telegram-bot-sdk/pull/182","diff_url":"https://github.com/irazasyed/telegram-bot-sdk/pull/182.diff","patch_url":"https://github.com/irazasyed/telegram-bot-sdk/pull/182.patch","issue_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/182","number":182,"state":"open","locked":false,"title":"[WIP] Move non-API concerns out of Api","user":{"login":"sloothword","id":7378822,"avatar_url":"https://avatars.githubusercontent.com/u/7378822?v=3","gravatar_id":"","url":"https://api.github.com/users/sloothword","html_url":"https://github.com/sloothword","followers_url":"https://api.github.com/users/sloothword/followers","following_url":"https://api.github.com/users/sloothword/following{/other_user}","gists_url":"https://api.github.com/users/sloothword/gists{/gist_id}","starred_url":"https://api.github.com/users/sloothword/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloothword/subscriptions","organizations_url":"https://api.github.com/users/sloothword/orgs","repos_url":"https://api.github.com/users/sloothword/repos","events_url":"https://api.github.com/users/sloothword/events{/privacy}","received_events_url":"https://api.github.com/users/sloothword/received_events","type":"User","site_admin":false},"body":"I believe we should seperate the concerns of the Api class, which have nothing to do with a barebones telegram Api.\r\nLike handling commands, emitting events, building conversations, etc.\r\nFor these things i created a separate Bot class.\r\n\r\nThings still needed to be done before merging:\r\n- [ ]  Understand, implement and test the container/DI stuff\r\n\r\n- [ ] Document the Bot class\r\n\r\n- [ ] Write a usage example of Bot, checkForUpdates and Events.\r\nIs there an official Event tutorial? (I know the one of the pull request, but thats not official documentation) How to update the docs? What is the status of the upgrade guide?\r\n\r\n- [ ] Try to write some tests. (As i mainly moved some untested stuff from one place to another, there is not much to copy/modify) I am open for test suggestions ;-)\r\n\r\nThings to discuss (and tackle maybe afterwards)\r\n\r\n- [ ] Is all the magic __call stuff helpful or confusing. Yes, it may be convenient to call everything everywhere, but it also introduces bugs (the getXXX in Api) and adds complexity.\r\n\r\n- [ ] The telegram api object is not consistently named. Sometimes $telegram, sometimes $api. It gets a bit better with the distinction of $bot, but imho it should always be $api, never $telegram.\r\n\r\n- [ ] The config system is a bit too intricate. I get what you are trying to do with reusable config blocks like the shared commands and such, but with the addition of e.g. the event and conversation system we might find a seamless config mechanism for all of that.\r\n","created_at":"2016-05-21T20:01:06Z","updated_at":"2016-05-21T20:01:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aba2ddcb3e8f8479896900f679bb470ab76e873b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/182/commits","review_comments_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/182/comments","review_comment_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/182/comments","statuses_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/statuses/82494ba1b885c50d0ae1ac257a26360cf78ba55c","head":{"label":"sloothword:split-bot","ref":"split-bot","sha":"82494ba1b885c50d0ae1ac257a26360cf78ba55c","user":{"login":"sloothword","id":7378822,"avatar_url":"https://avatars.githubusercontent.com/u/7378822?v=3","gravatar_id":"","url":"https://api.github.com/users/sloothword","html_url":"https://github.com/sloothword","followers_url":"https://api.github.com/users/sloothword/followers","following_url":"https://api.github.com/users/sloothword/following{/other_user}","gists_url":"https://api.github.com/users/sloothword/gists{/gist_id}","starred_url":"https://api.github.com/users/sloothword/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloothword/subscriptions","organizations_url":"https://api.github.com/users/sloothword/orgs","repos_url":"https://api.github.com/users/sloothword/repos","events_url":"https://api.github.com/users/sloothword/events{/privacy}","received_events_url":"https://api.github.com/users/sloothword/received_events","type":"User","site_admin":false},"repo":{"id":57461353,"name":"telegram-bot-sdk","full_name":"sloothword/telegram-bot-sdk","owner":{"login":"sloothword","id":7378822,"avatar_url":"https://avatars.githubusercontent.com/u/7378822?v=3","gravatar_id":"","url":"https://api.github.com/users/sloothword","html_url":"https://github.com/sloothword","followers_url":"https://api.github.com/users/sloothword/followers","following_url":"https://api.github.com/users/sloothword/following{/other_user}","gists_url":"https://api.github.com/users/sloothword/gists{/gist_id}","starred_url":"https://api.github.com/users/sloothword/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloothword/subscriptions","organizations_url":"https://api.github.com/users/sloothword/orgs","repos_url":"https://api.github.com/users/sloothword/repos","events_url":"https://api.github.com/users/sloothword/events{/privacy}","received_events_url":"https://api.github.com/users/sloothword/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sloothword/telegram-bot-sdk","description":"Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.","fork":true,"url":"https://api.github.com/repos/sloothword/telegram-bot-sdk","forks_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/forks","keys_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/teams","hooks_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/hooks","issue_events_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/events","assignees_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/tags","blobs_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/languages","stargazers_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/stargazers","contributors_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/contributors","subscribers_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/subscribers","subscription_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/subscription","commits_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/merges","archive_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/downloads","issues_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/labels{/name}","releases_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/sloothword/telegram-bot-sdk/deployments","created_at":"2016-04-30T20:52:11Z","updated_at":"2016-04-30T20:52:12Z","pushed_at":"2016-05-14T20:30:29Z","git_url":"git://github.com/sloothword/telegram-bot-sdk.git","ssh_url":"git@github.com:sloothword/telegram-bot-sdk.git","clone_url":"https://github.com/sloothword/telegram-bot-sdk.git","svn_url":"https://github.com/sloothword/telegram-bot-sdk","homepage":"https://telegram-bot-sdk.readme.io/docs","size":1103,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"irazasyed:master","ref":"master","sha":"4f81cdcc8a2ddeb7037f5f04482899975f622e4a","user":{"login":"irazasyed","id":1915268,"avatar_url":"https://avatars.githubusercontent.com/u/1915268?v=3","gravatar_id":"","url":"https://api.github.com/users/irazasyed","html_url":"https://github.com/irazasyed","followers_url":"https://api.github.com/users/irazasyed/followers","following_url":"https://api.github.com/users/irazasyed/following{/other_user}","gists_url":"https://api.github.com/users/irazasyed/gists{/gist_id}","starred_url":"https://api.github.com/users/irazasyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irazasyed/subscriptions","organizations_url":"https://api.github.com/users/irazasyed/orgs","repos_url":"https://api.github.com/users/irazasyed/repos","events_url":"https://api.github.com/users/irazasyed/events{/privacy}","received_events_url":"https://api.github.com/users/irazasyed/received_events","type":"User","site_admin":false},"repo":{"id":38233033,"name":"telegram-bot-sdk","full_name":"irazasyed/telegram-bot-sdk","owner":{"login":"irazasyed","id":1915268,"avatar_url":"https://avatars.githubusercontent.com/u/1915268?v=3","gravatar_id":"","url":"https://api.github.com/users/irazasyed","html_url":"https://github.com/irazasyed","followers_url":"https://api.github.com/users/irazasyed/followers","following_url":"https://api.github.com/users/irazasyed/following{/other_user}","gists_url":"https://api.github.com/users/irazasyed/gists{/gist_id}","starred_url":"https://api.github.com/users/irazasyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irazasyed/subscriptions","organizations_url":"https://api.github.com/users/irazasyed/orgs","repos_url":"https://api.github.com/users/irazasyed/repos","events_url":"https://api.github.com/users/irazasyed/events{/privacy}","received_events_url":"https://api.github.com/users/irazasyed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/irazasyed/telegram-bot-sdk","description":"Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.","fork":false,"url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk","forks_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/forks","keys_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/teams","hooks_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/hooks","issue_events_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/events","assignees_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/tags","blobs_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/languages","stargazers_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/stargazers","contributors_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/contributors","subscribers_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/subscribers","subscription_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/subscription","commits_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/merges","archive_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/downloads","issues_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/labels{/name}","releases_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/deployments","created_at":"2015-06-29T07:12:35Z","updated_at":"2016-05-21T02:30:55Z","pushed_at":"2016-05-21T20:01:07Z","git_url":"git://github.com/irazasyed/telegram-bot-sdk.git","ssh_url":"git@github.com:irazasyed/telegram-bot-sdk.git","clone_url":"https://github.com/irazasyed/telegram-bot-sdk.git","svn_url":"https://github.com/irazasyed/telegram-bot-sdk","homepage":"https://telegram-bot-sdk.readme.io/docs","size":1238,"stargazers_count":420,"watchers_count":420,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":86,"mirror_url":null,"open_issues_count":3,"forks":86,"open_issues":3,"watchers":420,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/182"},"html":{"href":"https://github.com/irazasyed/telegram-bot-sdk/pull/182"},"issue":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/182"},"comments":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/182/comments"},"review_comments":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/182/comments"},"review_comment":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/182/commits"},"statuses":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/statuses/82494ba1b885c50d0ae1ac257a26360cf78ba55c"}}}}
{"actor":{"display_login":"Nitpick-CI"}}