Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a readme, fixed up example bot.

  • Loading branch information...
commit 3037e97cbe738ff2637f2ede19625e53281c5683 1 parent 1dbedbb
Jarrod authored
Showing with 52 additions and 0 deletions.
  1. +4 −0 Net/IRC/Bot.pm
  2. +48 −0 README
4 Net/IRC/Bot.pm
View
@@ -92,6 +92,10 @@ class Net::IRC::Bot {
}
}
+ method reply($text) {
+ $.msg($text, $.channel);
+ }
+
method send_ctcp($text, $to) {
$conn.sendln("NOTICE $to :\c01$text\c01");
}
48 README
View
@@ -0,0 +1,48 @@
+=head1 Net::IRC
+
+Elegant. Simple. Probably doesn't compile.
+
+=head1 Synopsis
+
+ use Net::IRC::Bot;
+
+ class AnnoyingBot is Net::IRC::Bot does ExtraAnnoying {
+ #Will be called when the bot gets a join event
+ multi method joined ($who, $channel) {
+ $.reply("Hi there, $who!");
+ }
+ }
+
+ role ExtraAnnoying {
+ #Called on a regular privmsg event
+ multi method said ($msg, $who, $channel) {
+ $.reply($msg); #Parrot back what was said;
+ }
+ }
+
+ AnnoyingBot.create(
+ nick => 'KickMe',
+ server => 'irc.freenode.net',
+ channels => <#bottest>,
+ ).run;
+
+=head1 Description
+
+Its an IRC Bot framework! Theres not much else to it.
+It's currently in active development (read:broken + everything is changing constantly),
+so unless you just want ot look or have an experimental tinker, you might want to wait
+for just a little bit.
+
+=head1 Methods
+
+TODO
+
+=head2 External methods
+
+=head2 Callbacks
+
+said, emoted, joined, noticed, nickchange, connected
+
+=head2 Helper methods
+
+say, reply, send_ctcp
Please sign in to comment.
Something went wrong with that request. Please try again.