Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added a readme, fixed up example bot.

  • Loading branch information...
commit 3037e97cbe738ff2637f2ede19625e53281c5683 1 parent 1dbedbb
Jarrod authored

Showing 2 changed files with 52 additions and 0 deletions. Show diff stats Hide diff stats

  1. +4 0 Net/IRC/Bot.pm
  2. +48 0 README
4 Net/IRC/Bot.pm
@@ -92,6 +92,10 @@ class Net::IRC::Bot {
92 92 }
93 93 }
94 94
  95 + method reply($text) {
  96 + $.msg($text, $.channel);
  97 + }
  98 +
95 99 method send_ctcp($text, $to) {
96 100 $conn.sendln("NOTICE $to :\c01$text\c01");
97 101 }
48 README
... ... @@ -0,0 +1,48 @@
  1 +=head1 Net::IRC
  2 +
  3 +Elegant. Simple. Probably doesn't compile.
  4 +
  5 +=head1 Synopsis
  6 +
  7 + use Net::IRC::Bot;
  8 +
  9 + class AnnoyingBot is Net::IRC::Bot does ExtraAnnoying {
  10 + #Will be called when the bot gets a join event
  11 + multi method joined ($who, $channel) {
  12 + $.reply("Hi there, $who!");
  13 + }
  14 + }
  15 +
  16 + role ExtraAnnoying {
  17 + #Called on a regular privmsg event
  18 + multi method said ($msg, $who, $channel) {
  19 + $.reply($msg); #Parrot back what was said;
  20 + }
  21 + }
  22 +
  23 + AnnoyingBot.create(
  24 + nick => 'KickMe',
  25 + server => 'irc.freenode.net',
  26 + channels => <#bottest>,
  27 + ).run;
  28 +
  29 +=head1 Description
  30 +
  31 +Its an IRC Bot framework! Theres not much else to it.
  32 +It's currently in active development (read:broken + everything is changing constantly),
  33 +so unless you just want ot look or have an experimental tinker, you might want to wait
  34 +for just a little bit.
  35 +
  36 +=head1 Methods
  37 +
  38 +TODO
  39 +
  40 +=head2 External methods
  41 +
  42 +=head2 Callbacks
  43 +
  44 +said, emoted, joined, noticed, nickchange, connected
  45 +
  46 +=head2 Helper methods
  47 +
  48 +say, reply, send_ctcp

0 comments on commit 3037e97

Please sign in to comment.
Something went wrong with that request. Please try again.