Skype::Any::Declare - Addition of an interface similar to hubot for Skype::Any
use Skype::Any::Declare; skype(name => 'ping-pong'); hear 'ping' => sub { my ($msg) = @_; $msg->chat->send_message('pong'); }; run;
Skype::Any::Declare has interface similar to hubot.
Return Skype::Any object. Also, this function can specify arguments to pass to the object.
respond qr/pattern/ => sub { my ($chatmessage, @match) = @_; ... }; respond 'string' => sub { my ($chatmessage, @match) = @_; ... };
Register handlers which is called if a message matches regexp. (Only when you received a message from 1:1 chat)
$chatmessage is Skype::Any::Object::ChatMessage object, @match is subgroups in regexp.
respond 'yes' => sub { $_[0]->chat->send_message('no') }, 'stop' => sub { $_[0]->chat->send_message('go go go') }, 'goodbye' => sub { $_[0]->chat->send_message('hello') };
hear qr/pattern/ => sub { my ($chatmessage, @match) = @_; ... }; hear 'string' => sub { my ($chatmessage, @match) = @_; ... };
Register handlers which is called if a message matches regexp. (Only when you received a message from group chat)
hear qr/\A([0-9]{1,2}) : ([0-9]{1,2}) \s+ (.+)\z/xms => sub { my ($msg, $hour, $min, $reminder) = @_; ... };
run;
Running event loop.
Skype::Any
To install Skype::Any, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Skype::Any
CPAN shell
perl -MCPAN -e shell install Skype::Any
For more information on module installation, please visit the detailed CPAN module installation guide.