{"action":"created","issue":{"url":"https://api.github.com/repos/Yoctol/bottender/issues/264","repository_url":"https://api.github.com/repos/Yoctol/bottender","labels_url":"https://api.github.com/repos/Yoctol/bottender/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/Yoctol/bottender/issues/264/comments","events_url":"https://api.github.com/repos/Yoctol/bottender/issues/264/events","html_url":"https://github.com/Yoctol/bottender/issues/264","id":322024744,"node_id":"MDU6SXNzdWUzMjIwMjQ3NDQ=","number":264,"title":"Cross platform issue: replyImage and sendImage","user":{"login":"tigercosmos","id":18013815,"node_id":"MDQ6VXNlcjE4MDEzODE1","avatar_url":"https://avatars0.githubusercontent.com/u/18013815?v=4","gravatar_id":"","url":"https://api.github.com/users/tigercosmos","html_url":"https://github.com/tigercosmos","followers_url":"https://api.github.com/users/tigercosmos/followers","following_url":"https://api.github.com/users/tigercosmos/following{/other_user}","gists_url":"https://api.github.com/users/tigercosmos/gists{/gist_id}","starred_url":"https://api.github.com/users/tigercosmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tigercosmos/subscriptions","organizations_url":"https://api.github.com/users/tigercosmos/orgs","repos_url":"https://api.github.com/users/tigercosmos/repos","events_url":"https://api.github.com/users/tigercosmos/events{/privacy}","received_events_url":"https://api.github.com/users/tigercosmos/received_events","type":"User","site_admin":false},"labels":[{"id":721214053,"node_id":"MDU6TGFiZWw3MjEyMTQwNTM=","url":"https://api.github.com/repos/Yoctol/bottender/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-10T17:59:43Z","updated_at":"2018-10-09T16:18:45Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Considering a condition:\r\nA bot for two platform: a free account Line bot and a Messenger bot.\r\nIf I want to reply an image for a message. For Line, I would call `replyImage`(because I use free account), but there's no `replyImage` for Messenger, so I would need to call `sendImage`. But I cannot call `sendImage` directly, because I use free account for Line.\r\n\r\nA simple way to solve this, I write a tricky code for this: \r\n```js\r\nasync function platformReplyImage(context, url) {\r\n    if (config.chatroomPlatform == 'messenger') {\r\n        await context.sendImage(url)\r\n    } else {\r\n        await context.replyImage(url);\r\n    }\r\n}\r\n```\r\n\r\nI think it can be a feature for later version to solve this kind problem.(so as `sendText`)"},"comment":{"url":"https://api.github.com/repos/Yoctol/bottender/issues/comments/428256683","html_url":"https://github.com/Yoctol/bottender/issues/264#issuecomment-428256683","issue_url":"https://api.github.com/repos/Yoctol/bottender/issues/264","id":428256683,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODI1NjY4Mw==","user":{"login":"chentsulin","id":3382565,"node_id":"MDQ6VXNlcjMzODI1NjU=","avatar_url":"https://avatars2.githubusercontent.com/u/3382565?v=4","gravatar_id":"","url":"https://api.github.com/users/chentsulin","html_url":"https://github.com/chentsulin","followers_url":"https://api.github.com/users/chentsulin/followers","following_url":"https://api.github.com/users/chentsulin/following{/other_user}","gists_url":"https://api.github.com/users/chentsulin/gists{/gist_id}","starred_url":"https://api.github.com/users/chentsulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chentsulin/subscriptions","organizations_url":"https://api.github.com/users/chentsulin/orgs","repos_url":"https://api.github.com/users/chentsulin/repos","events_url":"https://api.github.com/users/chentsulin/events{/privacy}","received_events_url":"https://api.github.com/users/chentsulin/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T16:18:45Z","updated_at":"2018-10-09T16:18:45Z","author_association":"MEMBER","body":"This question has been well-answered, so I am going to close this issue.\r\n\r\nBy the way, `bottender-compose` also has an util function to help this:\r\nhttps://github.com/Yoctol/bottender-compose#platform "}}
{"actor":{"display_login":"chentsulin"}}