| 1 | package Amethyst::Brain; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use Data::Dumper; | ||
| 5 | use POE; | ||
| 6 | |||
| 7 | sub new { | ||
| 8 | my $class = shift; | ||
| 9 | my $self = ($#_ == 0) ? { %{ (shift) } } : { @_ }; | ||
| 10 | return bless $self, $class; | ||
| 11 | } | ||
| 12 | |||
| 13 | sub init { | ||
| 14 | my ($self) = @_; | ||
| 15 | # Not overriding this is not fatal. | ||
| 16 | } | ||
| 17 | |||
| 18 | sub think { | ||
| 19 | my ($self, $messages, @args) = @_; | ||
| 20 | die "Think not implemented by brain"; | ||
| 21 | } | ||
| 22 | |||
| 23 | sub reply_to { | ||
| 24 | my ($self, $message, $text) = @_; | ||
| 25 | return $message->reply($text); | ||
| 26 | } | ||
| 27 | |||
| 28 | 1; |