< ページ移動: 1 2 >
use strict;use warnings;use utf8;use LINE::Bot::API;use LINE::Bot::API::Builder::SendMessage;use Plack::Request;my $channel_secret = '84xxxxxxxxxxxxxxxxxxxxxxxxxxxxec';my $channel_access_token = '8sXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcDnyilFU=';my $bot = LINE::Bot::API->new(channel_secret => $channel_secret,channel_access_token => $channel_access_token,);sub {my $req = Plack::Request->new(shift);unless ($bot->validate_signature($req->content,$req->header('X-Line-Signature'))) {return [200, [], ['bad request']];}my $events = $bot->parse_events_from_json($req->content);foreach my $event (@{ $events }) {if ($event->is_user_event && $event->is_message_event&& $event->is_text_message) {