]>
jfr.im git - irc/pisg.git/blob - pisg/modules/Pisg/Parser/Format/zcbot.pm
1 package Pisg
::Parser
::Format
::zcbot
;
3 # Documentation for the Pisg::Parser::Format modules is found in Template.pm
10 my ($type, %args) = @_;
13 normalline
=> '^[^ ]+ (\d+):[^ ]+ :([^!]+)[^ ]+ PRIVMSG (\#[^ ]+) :([^\001].*)',
14 actionline
=> '^[^ ]+ (\d+):[^ ]+ :([^!]+)[^ ]+ PRIVMSG (\#[^ ]+) :\001ACTION (.*)',
15 thirdline
=> '^[^ ]+ (\d+):(\d+):\d+ :([^!]+)[^ ]+ ([A-Z]+) (.*)',
24 my ($self, $line, $lines) = @_;
27 if ($line =~ /$self->{normalline}/o && lc($3) eq lc($self->{cfg
}->{channel
})) {
41 my ($self, $line, $lines) = @_;
44 if ($line =~ /$self->{actionline}/o && lc($3) eq lc($self->{cfg
}->{channel
})) {
58 my ($self, $line, $lines) = @_;
62 if ($line =~ /$self->{thirdline}/o) {
68 my @arr = split(" ", $5);
69 if ($4 eq 'KICK' && lc($arr[0]) eq lc($self->{cfg
}->{channel
})) {
70 $hash{kicker
} = $hash{nick
};
71 $hash{nick
} = $arr[1];
73 } elsif ($4 eq 'TOPIC' && lc($arr[0]) eq lc($self->{cfg
}->{channel
})) {
74 $tmp = join(" ", @arr[1..$#arr]);
76 $hash{newtopic
} = $tmp;
78 } elsif ($4 eq 'MODE' && lc($arr[0]) eq lc($self->{cfg
}->{channel
})) {
79 $hash{newmode
} = $arr[1];
81 } elsif ($4 eq 'JOIN' && lc($arr[0]) eq ":".lc($self->{cfg
}->{channel
})) {
84 } elsif ($4 eq 'NICK') {
86 $hash{newnick
} = $arr[0];