Use the new getHelpLine and getModules APIs instead of accessing \@modulenames and $helpline directly. This also makes the CTCP VERSION reply be sorted. b=130532, r=imajes

This commit is contained in:
ian%hixie.ch 2002-04-01 04:32:42 +00:00
Родитель ba1bf1d780
Коммит 71a6be2fe7
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -57,13 +57,13 @@ sub Told {
$self->say($event, "No help for topic '$1'.");
}
} else {
# XXX amusingly, $helpline is defined here, because this
# entire module is evaluated in the scope of mozbot.pl.
my $helpline = $self->getHelpLine();
$self->directSay($event, "Help topics for mozbot $VERSION ($helpline):");
$self->say($event, "$event->{'from'}: help info /msg'ed") if ($event->{'channel'});
local @" = ', '; # to reset font-lock: "
my @helplist;
foreach my $module (@modules) {
foreach my $module ($self->getModules()) {
$module = $self->getModule($module);
my %commands = %{$module->Help($event)};
my $moduleHelp = delete($commands{''});
my @commands = sort keys %commands;
@ -87,6 +87,7 @@ sub Told {
sub CTCPVersion {
my $self = shift;
my ($event, $who, $what) = @_;
my @modulenames = $self->getModules();
local $" = ', ';
$self->ctcpReply($event, 'VERSION', "mozbot $VERSION (@modulenames)");
}