Commit Diff
Diff:
edcb1b2b0cbd67fbcfcdf615e3ab137b1b702d8d
a58e176adaaa59ec2b49c2dc146fd00592bb23a1
Commit:
a58e176adaaa59ec2b49c2dc146fd00592bb23a1
Tree:
33bcd65a59497a24aef60f71942cd79af30603c9
Author:
jrmu <jrmu@ircnow.org>
Committer:
jrmu <jrmu@ircnow.org>
Date:
Sat May 6 06:10:39 2023 UTC
Message:
Ensure that only enabled modules have help messages displayed, patch thanks to izzyb
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 <username> <email>. For example, !bnc john john\@example.com.
-To request a free shell account, type !shell <username> <email>. For example, !shell john john\@example.com.
-To request a free email account, type !mail <username> <email>. For example, !mail john john\@example.com.
-EOF
-#To request a free VPN account, type !vpn <username> <email>. 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 <username> <email>. For example, !bnc john john\@example.com.",
+ Shell => "To request a free shell account, type !shell <username> <email>. For example, !shell john john\@example.com.)",
+ Mail => "To request a free email account, type !mail <username> <email>. For example, !mail john john\@example.com.)",
+ VPN => "To request a free VPN account, type !vpn <username> <email>. 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 <username>
To verify a captcha, type !bnc captcha <username>
To approve a bouncer, type !bnc approve <username>
To recreate cloneuser, type !bnc cloneuser
+EOF
+ Shell => <<"EOF",
+To delete a shell account, type !shell delete <username>
+To verify a captcha, type !shell captcha <username>
+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 <ips>
To get a list of IPs that match usernames, type !regex users <usernames>
To regex search znc.log and output to the terminal, type !regex <regex>
-To delete a shell account, type !shell delete <username>
-To verify a captcha, type !shell captcha <username>
EOF
#To get a list of usernames that match IPs, type !shell regex ips <ips>
#To get a list of IPs that match usernames, type !shell regex users <usernames>
IRCNow