commit 87877d714fc8fdec1f079812bd8bd53c80389446 from: Izzy Blacklock date: Mon Jul 17 04:03:24 2023 UTC updated BNC.pm to use IRCNOW::IO::debug() commit - 8902697ccceb74b8d7a113de1b7dbbad5905e305 commit + 87877d714fc8fdec1f079812bd8bd53c80389446 blob - ae83bbf264c165e07c089dfc36ac84e771111036 blob + 0f4be858d5a3dc9e0eb36bf1440ce501909a747b --- lib/BotNow/BNC.pm +++ lib/BotNow/BNC.pm @@ -6,7 +6,7 @@ use OpenBSD::Pledge; use OpenBSD::Unveil; use Digest::SHA qw(sha256_hex); use lib qw(./lib); -use IRCNOW::IO qw(readarray); +use IRCNOW::IO qw(:DEBUG readarray); require "BotNow::SQLite"; require "BotNow::Hash"; require "BotNow::DNS"; @@ -32,13 +32,6 @@ my $approval = $conf{approval}; my $webpanel = $conf{webpanel}; my @networks; -use constant { - NONE => 0, - ERRORS => 1, - WARNINGS => 2, - ALL => 3, -}; - `doas chmod g+r /home/znc/home/znc/.znc/`; my @users; main::cbind("pub", "-", "bnc", \&mbnc); @@ -287,23 +280,23 @@ sub mcontrolpanel { main::putserv($bot, "PRIVMSG $chan :Cloneuser created"); } } elsif ($text =~ /^User (.*) added!$/) { - main::debug(ALL, "User $1 created"); + debug(ALL, "User $1 created"); } elsif ($text =~ /^Password has been changed!$/) { - main::debug(ALL, "Password changed"); + debug(ALL, "Password changed"); } elsif ($text =~ /^Queued network (.*) of user (.*) for a reconnect.$/) { - main::debug(ALL, "$2 now connecting to $1..."); + debug(ALL, "$2 now connecting to $1..."); } elsif ($text =~ /^Admin = false/) { foreach my $chan (@teamchans) { main::putserv($bot, "PRIVMSG $chan :ERROR: $nick is not admin"); } die "ERROR: $nick is not admin"; } elsif ($text =~ /^Admin = true/) { - main::debug(ALL, "$nick is ZNC admin"); + debug(ALL, "$nick is ZNC admin"); } elsif ($text =~ /(.*) = (.*)/) { my ($key, $val) = ($1, $2); - main::debug(ALL, "ZNC: $key => $val"); + debug(ALL, "ZNC: $key => $val"); } else { - main::debug(ERRORS, "Unexpected 290 BNC.pm: $hostmask $text"); + debug(ERRORS, "Unexpected 290 BNC.pm: $hostmask $text"); } } } @@ -587,7 +580,7 @@ sub mlastseen { # } # } else { print "ERROR: $line\n"; } # #TODO ERRORS not defined?? - ## } else { main::debug(ERRORS, "ERROR: $line"); } + ## } else { debug(ERRORS, "ERROR: $line"); } # } # return $tree; #}