summaryrefslogtreecommitdiffstats
path: root/bin/tecobot
diff options
context:
space:
mode:
Diffstat (limited to 'bin/tecobot')
-rw-r--r--bin/tecobot26
1 files changed, 26 insertions, 0 deletions
diff --git a/bin/tecobot b/bin/tecobot
new file mode 100644
index 0000000..2e84c41
--- /dev/null
+++ b/bin/tecobot
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+package Bot::TecoBot;
+use base 'Bot::BasicBot';
+use Language::TECO;
+
+my %users;
+sub said {
+ my $self = shift;
+ my %args = %{ shift() };
+
+ return unless $args{body} =~ s/^!teco // || $args{address};
+ $users{$args{who}} = Language::TECO->new unless exists $users{$args{who}};
+ return $users{$args{who}}->execute($args{body});
+}
+
+package main;
+
+Bot::TecoBot->new(
+ server => 'irc.freenode.net',
+ channels => ['#doytest'],
+ nick => 'tecobot',
+ username => 'tecobot',
+ name => 'tecobot',
+)->run;