commit edcb1b2b0cbd67fbcfcdf615e3ab137b1b702d8d from: jrmu date: Sat May 06 05:44:50 2023 UTC Check if accounts exists before approving, patch thanks to izzyb commit - e112f2ae812467b89f1ff59bb00ee89bc15e25f9 commit + edcb1b2b0cbd67fbcfcdf615e3ab137b1b702d8d blob - 461514fc5dc2a77ba272186f663be6b698eae990 blob + 167cd4f0a52817ac1a6ee54259ec974c9db93531 --- BNC.pm +++ BNC.pm @@ -121,9 +121,13 @@ sub mbnc { return; } elsif (main::isstaff($bot, $nick) && $text =~ /^approve\s+([[:ascii:]]+)/) { my $username = $1; - main::putserv($bot, "PRIVMSG *blockuser :unblock $username"); - foreach my $chan (@teamchans) { + if (SQLite::selectrows("bnc", "username", $username)) { + main::putserv($bot, "PRIVMSG *blockuser :unblock $username"); + foreach my $chan (@teamchans) { main::putserv($bot, "PRIVMSG $chan :$username bnc approved"); + } + } else { + main::putserv($bot, "PRIVMSG $chan :$username hasn't requested a bnc account"); } return; } elsif ($staff =~ /$nick/ && $text =~ /^cloneuser$/i) {