Blame


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