mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-25 04:02:37 +01:00
Plugins: pluglist
now shows count
This commit is contained in:
parent
f30c68d602
commit
b3a5637d9f
@ -155,18 +155,12 @@ sub unload_cmd {
|
|||||||
|
|
||||||
sub list_cmd {
|
sub list_cmd {
|
||||||
my ($self, $from, $nick, $user, $host, $arguments) = @_;
|
my ($self, $from, $nick, $user, $host, $arguments) = @_;
|
||||||
my $result = "Loaded plugins: ";
|
|
||||||
my $count = 0;
|
|
||||||
my $comma = '';
|
|
||||||
|
|
||||||
foreach my $plugin (sort keys %{$self->{plugins}}) {
|
my @plugins = sort keys %{$self->{plugins}};
|
||||||
$result .= $comma . $plugin;
|
|
||||||
$count++;
|
|
||||||
$comma = ', ';
|
|
||||||
}
|
|
||||||
|
|
||||||
$result .= 'none' if $count == 0;
|
return "No plugins loaded." if not @plugins;
|
||||||
return $result;
|
|
||||||
|
return scalar @plugins . ' plugin' . (@plugins == 1 ? '' : 's') . ' loaded: ' . join (', ', @plugins);
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user