Blob


1 #!/usr/bin/perl
3 package Help;
5 use strict;
6 use warnings;
7 use OpenBSD::Pledge;
8 use OpenBSD::Unveil;
10 my %conf = %main::conf;
11 my $chans = $conf{chans};
12 my $teamchans = $conf{teamchans};
13 my @teamchans = split /[,\s]+/m, $teamchans;
14 my $staff = $conf{staff};
15 my $terms = $conf{terms};
16 my $time = "600";
17 main::cbind("pub", "-", "help", \&help);
18 main::cbind("msg", "-", "help", \&help);
19 main::cbind("pub", "-", "request", \&help);
21 sub init {
22 }
24 sub help {
25 my ($bot, $nick, $host, $hand, @args) = @_;
26 my ($chan, $text);
27 my $mod_msgs= {
28 BNC => "To request a free bouncer, type !bnc <username> <email>. For example, !bnc john john\@example.com.",
29 Shell => "To request a free shell account, type !shell <username> <email>. For example, !shell john john\@example.com.)",
30 Mail => "To request a free email account, type !mail <username> <email>. For example, !mail john john\@example.com.)",
31 VPN => "To request a free VPN account, type !vpn <username> <email>. For example, !vpn john john\@example.com.)"
32 };
33 my $msg = $terms."\n";
34 for my $mod (split ' ',$conf{modules}) {
35 if (exists $mod_msgs->{$mod}) {
36 $msg.=$mod_msgs->{$mod}."\n";
37 }
38 }
40 my $mod_admin_msgs={
41 BNC => <<"EOF",
42 To delete a bouncer, type !bnc delete <username>
43 To verify a captcha, type !bnc captcha <username>
44 To approve a bouncer, type !bnc approve <username>
45 To recreate cloneuser, type !bnc cloneuser
46 EOF
47 Shell => <<"EOF",
48 To delete a shell account, type !shell delete <username>
49 To verify a captcha, type !shell captcha <username>
50 EOF
51 };
52 if (main::isstaff($bot, $nick)) {
53 for my $mod (split ' ',$conf{modules}) {
54 if (exists $mod_admin_msgs->{$mod}) {
55 $msg.=$mod_admin_msgs->{$mod};
56 }
57 }
58 $msg .=<<"EOF";
59 To get a list of usernames that match IPs, type !regex ips <ips>
60 To get a list of IPs that match usernames, type !regex users <usernames>
61 To regex search znc.log and output to the terminal, type !regex <regex>
62 EOF
63 #To get a list of usernames that match IPs, type !shell regex ips <ips>
64 #To get a list of IPs that match usernames, type !shell regex users <usernames>
65 #To regex search znc.log and output to the terminal, type !shell regex <regex>
66 }
67 if (@args == 2) {
68 ($chan, $text) = ($args[0], $args[1]);
69 if ($chans =~ $chan) {
70 main::putserv($bot, "PRIVMSG $chan :$nick: Please see private message.");
71 }
72 } else {
73 $text = $args[0];
74 }
75 main::putserv($bot, "PRIVMSG $nick :$msg");
76 foreach my $chan (@teamchans) {
77 main::putservlocalnet($bot, "PRIVMSG $chan :$staff: Help *$nick* on network ".$bot->{name}.". If you don't help the user, he will probably leave");
78 }
79 }
81 1; # MUST BE LAST STATEMENT IN FILE