зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
2680157167
Коммит
2adebbfa76
|
@ -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)");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче