commit a58e176adaaa59ec2b49c2dc146fd00592bb23a1 from: jrmu date: Sat May 06 06:10:39 2023 UTC Ensure that only enabled modules have help messages displayed, patch thanks to izzyb commit - edcb1b2b0cbd67fbcfcdf615e3ab137b1b702d8d commit + a58e176adaaa59ec2b49c2dc146fd00592bb23a1 blob - e0916b6e10ddf428620b26e57b7fe9090a02812c blob + be3c6aec6cf5715734ac15fd026dfe8fedc66a00 --- Help.pm +++ Help.pm @@ -24,24 +24,41 @@ sub init { sub help { my ($bot, $nick, $host, $hand, @args) = @_; my ($chan, $text); - my $msg = <<"EOF"; -$terms -To request a free bouncer, type !bnc . For example, !bnc john john\@example.com. -To request a free shell account, type !shell . For example, !shell john john\@example.com. -To request a free email account, type !mail . For example, !mail john john\@example.com. -EOF -#To request a free VPN account, type !vpn . For example, !vpn john john\@example.com. - if (main::isstaff($bot, $nick)) { - $msg .= <<"EOF"; + my $mod_msgs= { + BNC => "To request a free bouncer, type !bnc . For example, !bnc john john\@example.com.", + Shell => "To request a free shell account, type !shell . For example, !shell john john\@example.com.)", + Mail => "To request a free email account, type !mail . For example, !mail john john\@example.com.)", + VPN => "To request a free VPN account, type !vpn . For example, !vpn john john\@example.com.)" + }; + my $msg = $terms."\n"; + for my $mod (split ' ',$conf{modules}) { + if (exists $mod_msgs->{$mod}) { + $msg.=$mod_msgs->{$mod}."\n"; + } + } + + my $mod_admin_msgs={ + BNC => <<"EOF", To delete a bouncer, type !bnc delete To verify a captcha, type !bnc captcha To approve a bouncer, type !bnc approve To recreate cloneuser, type !bnc cloneuser +EOF + Shell => <<"EOF", +To delete a shell account, type !shell delete +To verify a captcha, type !shell captcha +EOF + }; + if (main::isstaff($bot, $nick)) { + for my $mod (split ' ',$conf{modules}) { + if (exists $mod_admin_msgs->{$mod}) { + $msg.=$mod_admin_msgs->{$mod}; + } + } + $msg .=<<"EOF"; To get a list of usernames that match IPs, type !regex ips To get a list of IPs that match usernames, type !regex users To regex search znc.log and output to the terminal, type !regex -To delete a shell account, type !shell delete -To verify a captcha, type !shell captcha EOF #To get a list of usernames that match IPs, type !shell regex ips #To get a list of IPs that match usernames, type !shell regex users