line-bot-sdk-php: Can't Send Carousel
$imageUrl = "http://1.bp.blogspot.com/-9izs08OyhuU/VeaBPrheKHI/AAAAAAAACMQ/uUN7ELsMw_o/s1600/Gambar-Konyol-Lucu-Gila-Unik-Aneh-34.jpg";
$carouselTemplateBuilder = new CarouselTemplateBuilder([
new CarouselColumnTemplateBuilder('foo', 'bar', $imageUrl, [
new UriTemplateActionBuilder('Go to line.me', 'https://line.me'),
new PostbackTemplateActionBuilder('Buy', 'action=buy&itemid=123'),
]),
new CarouselColumnTemplateBuilder('buz', 'qux', $imageUrl, [
new PostbackTemplateActionBuilder('Add to cart', 'action=add&itemid=123'),
new MessageTemplateActionBuilder('Say message', 'hello hello'),
]),
]);
file_put_contents('php://stderr', 'MessageBuilder: '.json_encode($carouselTemplateBuilder));
$messageBuilder = new TemplateMessageBuilder('Button alt text', $carouselTemplateBuilder);
$this->bot->pushMessage($wong, $messageBuilder);
This is part of my code… I want send a Carousel but the bot isn’t reply.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (8 by maintainers)
Probably this is NOT a question about this SDK, this is a PHP question.
I’ll show you an implementation sample of carousel with
foreachstatement;