From 9a681e993262af2a10752ff1998df0691b120ff2 Mon Sep 17 00:00:00 2001 From: "ian%hixie.ch" Date: Mon, 1 Apr 2002 04:32:42 +0000 Subject: [PATCH] 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 git-svn-id: svn://10.0.0.236/trunk@117836 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/mozbot/BotModules/General.bm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mozilla/webtools/mozbot/BotModules/General.bm b/mozilla/webtools/mozbot/BotModules/General.bm index 3114b92d3fd..ec1eb9eb45b 100644 --- a/mozilla/webtools/mozbot/BotModules/General.bm +++ b/mozilla/webtools/mozbot/BotModules/General.bm @@ -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)"); }