{"action":"created","issue":{"url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/6","labels_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/6/comments","events_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/6/events","html_url":"https://github.com/irazasyed/telegram-bot-sdk/issues/6","id":94565133,"number":6,"title":"Invalid resource type: integer","user":{"login":"amirmasoud","id":4637052,"avatar_url":"https://avatars.githubusercontent.com/u/4637052?v=3","gravatar_id":"","url":"https://api.github.com/users/amirmasoud","html_url":"https://github.com/amirmasoud","followers_url":"https://api.github.com/users/amirmasoud/followers","following_url":"https://api.github.com/users/amirmasoud/following{/other_user}","gists_url":"https://api.github.com/users/amirmasoud/gists{/gist_id}","starred_url":"https://api.github.com/users/amirmasoud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amirmasoud/subscriptions","organizations_url":"https://api.github.com/users/amirmasoud/orgs","repos_url":"https://api.github.com/users/amirmasoud/repos","events_url":"https://api.github.com/users/amirmasoud/events{/privacy}","received_events_url":"https://api.github.com/users/amirmasoud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-12T13:24:46Z","updated_at":"2015-07-12T14:31:05Z","closed_at":null,"body":"I face Invalid resource type: integer when trying to send a photo.\r\nmy sendPhoto method is ok, what should I do?"},"comment":{"url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/comments/120725450","html_url":"https://github.com/irazasyed/telegram-bot-sdk/issues/6#issuecomment-120725450","issue_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/6","id":120725450,"user":{"login":"amirmasoud","id":4637052,"avatar_url":"https://avatars.githubusercontent.com/u/4637052?v=3","gravatar_id":"","url":"https://api.github.com/users/amirmasoud","html_url":"https://github.com/amirmasoud","followers_url":"https://api.github.com/users/amirmasoud/followers","following_url":"https://api.github.com/users/amirmasoud/following{/other_user}","gists_url":"https://api.github.com/users/amirmasoud/gists{/gist_id}","starred_url":"https://api.github.com/users/amirmasoud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amirmasoud/subscriptions","organizations_url":"https://api.github.com/users/amirmasoud/orgs","repos_url":"https://api.github.com/users/amirmasoud/repos","events_url":"https://api.github.com/users/amirmasoud/events{/privacy}","received_events_url":"https://api.github.com/users/amirmasoud/received_events","type":"User","site_admin":false},"created_at":"2015-07-12T14:31:05Z","updated_at":"2015-07-12T14:31:05Z","body":"same for sending audio and video.\r\n\r\nclass TelegramController extends Controller\r\n{\r\n\tprotected $telegram;\r\n\r\n\tprivate $lastOffset = 0;\r\n\r\n\tpublic function __construct()\r\n\t{\r\n\t\t$this->telegram = new Telegram(getenv('TELEGRAM_BOT_TOKEN'));\r\n\t}\r\n\r\n\tpublic function updates()\r\n\t{\r\n\t\tforeach ($this->telegram->getUpdates() as $item) {\r\n\t\t\t$keyboard = [\r\n\t\t\t    ['poem', 'pic', 'video', 'song']\r\n\t\t\t];\r\n\t\t\t$reply_markup = $this->telegram->replyKeyboardMarkup($keyboard, true, true);\r\n\t\t\t$chat_id = $item['message']['chat']['id'];\r\n\r\n\t\t\tif($item['message']['text'] == 'شعر')\r\n\t\t\t{\r\n\t\t\t\t$this->telegram->sendChatAction($chat_id, 'typing');\r\n\r\n\t\t\t\t$poet = json_decode(file_get_contents('http://c.ganjoor.net/beyt-json.php'));\r\n\t\t\t\t$message = $poet->m1 . PHP_EOL . $poet->m2 . PHP_EOL . PHP_EOL . $poet->poet . PHP_EOL . $poet->url;\r\n\t\t\t\t$response = $this->telegram->sendMessage($chat_id, $message, true, null, $reply_markup);\r\n\r\n\t\t\t}\r\n\t\t\telseif($item['message']['text'] == 'pic')\r\n\t\t\t{\r\n\t\t\t\t$this->telegram->sendChatAction($chat_id, 'upload_photo');\r\n\r\n\t\t\t\t$url = 'http://www.savethecat.com/wp-content/uploads/2015/06/cats.jpg';\r\n\t\t\t\t$caption = 'sample caption';\r\n\r\n\t\t\t\t$response = $this->telegram->sendPhoto($chat_id, $url, $caption);\r\n\t\t\t}\r\n\t\t\telseif($item['message']['text'] == 'video')\r\n\t\t\t{\r\n\t\t\t\t$this->telegram->sendChatAction($chat_id, 'upload_video');\r\n\r\n\t\t\t\t$url = 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4';\r\n\r\n\t\t\t\t$response = $this->telegram->sendVideo($chat_id, $url);\r\n\t\t\t}\r\n\t\t\telseif($item['message']['text'] == 'song')\r\n\t\t\t{\r\n\t\t\t\t$this->telegram->sendChatAction($chat_id, 'upload_audio');\r\n\t\t\t\t\r\n\t\t\t\t$url = 'http://www.tonycuffe.com/mp3/cairnomount.mp3';\r\n\r\n\t\t\t\t$response = $this->telegram->sendAudio($chat_id, $url);\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$response = $this->telegram->sendMessage($chat_id, 'Invalid response.', true, null, $reply_markup);\r\n\t\t\t}\r\n\t\t\treturn $this->telegram->getUpdates($this->lastMessageId());\r\n\t\t}"}}