commit - 3ae69e2798977f4020618e9bc7a749cc9c03c1a5
commit + 2a82acd0d20f1fc7f958327aa94108dca12dab55
blob - 386a0ddd5276af6e1210ab87ac6efead4f89e952
blob + 442c0c1978c37d5254288820c5cd1833b596d376
--- botnow
+++ botnow
if ($hostmask ne '*status!znc@znc.in') {
if ($text =~ /^(PING|VERSION|TIME|USERINFO) (.*)$/i) {
my ($key, $val) = ($1, $2);
- my $id = SQLite::id("irc", "nick", $sendnick, $expires);
- SQLite::set("irc", "id", $id, "ctcp".lc($key), $val);
- SQLite::set("irc", "id", $id, "localtime", time());
+ my $id = BotNow::SQLite::id("irc", "nick", $sendnick, $expires);
+ BotNow::SQLite::set("irc", "id", $id, "ctcp".lc($key), $val);
+ BotNow::SQLite::set("irc", "id", $id, "localtime", time());
}
}
}
} elsif ($code == 307 && $text =~ /^([-_\|`a-zA-Z0-9]+) (.*)/) {
my ($sender, $key) = ($1, "registered");
$val = $2 eq ":is a registered nick" ? "True" : "$2";
- my $id = SQLite::id("irc", "nick", $sender, $expires);
- SQLite::set("irc", "id", $id, "identified", $val);
+ my $id = BotNow::SQLite::id("irc", "nick", $sender, $expires);
+ BotNow::SQLite::set("irc", "id", $id, "identified", $val);
debug(ALL, "$key: $val");
} elsif ($code == 311 && $text =~ /^([-_\|`a-zA-Z0-9]+) ([^:]+)\s+([^:]+) \* :([^:]*)/) {
my ($sender, $key, $val) = ($1, "hostmask", "$1\!$2\@$3");
- my $id = SQLite::id("irc", "nick", $sender, $expires);
- SQLite::set("irc", "id", $id, $key, $val);
+ my $id = BotNow::SQLite::id("irc", "nick", $sender, $expires);
+ BotNow::SQLite::set("irc", "id", $id, $key, $val);
debug(ALL, "$key: $val");
} elsif ($code == 312 && $text =~ /^([-_\|`a-zA-Z0-9]+) ([^:]+) :([^:]+)/) {
my ($sender, $key, $val) = ($1, "server", $2);
- my $id = SQLite::id("irc", "nick", $sender, $expires);
- SQLite::set("irc", "id", $id, $key, $val);
+ my $id = BotNow::SQLite::id("irc", "nick", $sender, $expires);
+ BotNow::SQLite::set("irc", "id", $id, $key, $val);
debug(ALL, "$key: $val");
} elsif ($code == 313 && $text =~ /^([-_\|`a-zA-Z0-9]+) :?(.*)/) {
my ($sender, $key, $val) = ($1, "oper", ($2 eq "is an IRC operator" ? "True" : "$2"));
- my $id = SQLite::id("irc", "nick", $sender, $expires);
- SQLite::set("irc", "id", $id, $key, $val);
+ my $id = BotNow::SQLite::id("irc", "nick", $sender, $expires);
+ BotNow::SQLite::set("irc", "id", $id, $key, $val);
debug(ALL, "$key: $val");
} elsif ($code == 315 && $text =~ /^([-_\|`a-zA-Z0-9]+) :End of \/?WHO(IS)? list/) {
debug(ALL, "End of WHOIS");
} elsif ($code == 317 && $text =~ /^([-_\|`a-zA-Z0-9]+) (\d+) (\d+) :?(.*)/) {
($sender, my $idle, my $epochtime) = ($1, $2, $3);
- my $id = SQLite::id("irc", "nick", $sender, $expires);
- SQLite::set("irc", "id", $id, "idle", $idle);
-# SQLite::set("irc", "id", $id, "epochtime", time());
+ my $id = BotNow::SQLite::id("irc", "nick", $sender, $expires);
+ BotNow::SQLite::set("irc", "id", $id, "idle", $idle);
+# BotNow::SQLite::set("irc", "id", $id, "epochtime", time());
debug(ALL, "idle: $idle, epochtime: $epochtime");
} elsif ($code == 318 && $text =~ /^([-_\|`a-zA-Z0-9]+) :End of \/?WHOIS list/) {
debug(ALL, "End of WHOIS");
} elsif ($code == 319 && $text =~ /^([-_\|`a-zA-Z0-9]+) :(.*)/) {
my ($sender, $key, $val) = ($1, "chans", $2);
- my $id = SQLite::id("irc", "nick", $sender, $expires);
- SQLite::set("irc", "id", $id, $key, $val);
+ my $id = BotNow::SQLite::id("irc", "nick", $sender, $expires);
+ BotNow::SQLite::set("irc", "id", $id, $key, $val);
debug(ALL, "$key: $val");
} elsif ($code == 330 && $text =~ /^([-_\|`a-zA-Z0-9]+) ([-_\|`a-zA-Z0-9]+) :?(.*)/) {
my ($sender, $key, $val) = ($1, "identified", ($3 eq "is logged in as" ? "True" : $2));
- my $id = SQLite::id("irc", "nick", $sender, $expires);
- SQLite::set("irc", "id", $id, $key, $val);
+ my $id = BotNow::SQLite::id("irc", "nick", $sender, $expires);
+ BotNow::SQLite::set("irc", "id", $id, $key, $val);
debug(ALL, "$key: $val");
} elsif ($code == 338 && $text =~ /^([-_\|`a-zA-Z0-9]+) ([0-9a-fA-F:.]+) :actually using host/) {
my ($sender, $key, $val) = ($1, "ip", $2);
- my $id = SQLite::id("irc", "nick", $sender, $expires);
- SQLite::set("irc", "id", $id, $key, $val);
+ my $id = BotNow::SQLite::id("irc", "nick", $sender, $expires);
+ BotNow::SQLite::set("irc", "id", $id, $key, $val);
debug(ALL, "$key: $val");
#Unexpected: efnet.port80.se 338 jrmu 206.253.167.44 :actually using host
} elsif ($code == 378 && $text =~ /^([-_\|`a-zA-Z0-9]+) :is connecting from ([^ ]+)\s*([0-9a-fA-F:.]+)?/) {
my ($sender, $key, $val) = ($1, "ip", $3);
- my $id = SQLite::id("irc", "nick", $sender, $expires);
- SQLite::set("irc", "id", $id, $key, $val);
+ my $id = BotNow::SQLite::id("irc", "nick", $sender, $expires);
+ BotNow::SQLite::set("irc", "id", $id, $key, $val);
debug(ALL, "$key: $val");
} elsif ($code == 671 && $text =~ /^([-_\|`a-zA-Z0-9]+) :is using a secure connection/) {
my ($sender, $key, $val) = ($1, "ssl", "True");
- my $id = SQLite::id("irc", "nick", $sender, $expires);
- SQLite::set("irc", "id", $id, $key, $val);
+ my $id = BotNow::SQLite::id("irc", "nick", $sender, $expires);
+ BotNow::SQLite::set("irc", "id", $id, $key, $val);
debug(ALL, "$key: $val");
} elsif ($code =~ /^332$/) { # Topic
# print "$text\r\n";