Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 93fea36bd4
Fetching contributors…

Cannot retrieve contributors at this time

53 lines (39 sloc) 0.816 kb
package MITBot;
use strict;
use warnings;
use POE;
use POSIX qw(mktime strftime);
use MIT;
use MIT::Session;
use MIT::UserDB;
use TOC::AIMUtils;
use MIT::Common;
my $helpText;
sub help {
my ($self, $who, $chat, $msg) = @_;
if ($msg =~ /^!?help$/) {
$self->sendMsg($who, 0, $helpText);
return 1;
}
return 0;
}
$helpText = "";
open(HELP, "<", "data/help");
while (<HELP>) {
chomp;
s/&/&amp;/g;
s/</&lt;/g;
s/>/&gt;/g;
if (/^\[(.*)\]$/) {
my $head = $1 . " Commands";
my $pad = "-" x (30 - length($head));
$helpText .= "$pad$head$pad<br>";
} elsif (/^(.+) -- (.*)/) {
$helpText .= "<b>$1</b> - $2<br>";
} else {
$helpText .= "$_<br>";
}
}
close(HELP);
registerHandler("HELP" => \&help);
1;
Jump to Line
Something went wrong with that request. Please try again.