| 1 | package Exobrain::Agent::Action::Ping; | ||
| 2 | use Moose; | ||
| 3 | use Method::Signatures; | ||
| 4 | |||
| 5 | with 'Exobrain::Agent::Run'; | ||
| 6 | |||
| 7 | # ABSTRACT: Automatically respond to any 'ping' tag sent to us. | ||
| 8 | our $VERSION = '1.08'; # VERSION | ||
| 9 | |||
| 10 | method run() { | ||
| 11 | $self->exobrain->watch_loop( | ||
| 12 | class => 'Measurement::Social', | ||
| 13 | filter => sub { $_->to_me and grep { /^ping$/ } @{ $_->tags } }, | ||
| 14 | then => sub { $_->respond("Ack (via exobrain)"); }, | ||
| 15 | ); | ||
| 16 | } | ||
| 17 | |||
| 18 | 1; | ||
| 19 | |||
| 20 | __END__ |