Facebook::Messenger::Client - Messenger Send API
use Facebook::Messenger::Client; my $client = Facebook::Messenger::Client->new( access_token => 'blabla' ); $client->send_text( 0123456789, 'Some message...' ); my $hashref = $client->get_user( 01234567890 );
If you want to build a Facebook chatbot you will need to use the Send API to send back messages to a recipient. This is a basic implementation of the Messenger Send API that allows (for the moment) to send text messages.
The access token provided by Facebook. This can also be set via the GRAPH_ACCESS_TOKEN environment variable.
my $hashref = $client->send( $recipient_id, $model );
Generic send function. This will that a Facebook::Messenger::Client::Model instance and send it to the server.
my $hashref = $client->send_text( $recipient_id, 'The message goes here ...' );
$hashref = $client->get_user( $user_id );
Tudor Marghidanu <tudor@marghidanu.com>
Moose
Mojolicious
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
To install Facebook::Messenger::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Facebook::Messenger::Client
CPAN shell
perl -MCPAN -e shell install Facebook::Messenger::Client
For more information on module installation, please visit the detailed CPAN module installation guide.