From 105ea0350a8b65fe80044c1ba15e85c86688bab3 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Mon, 3 Sep 2018 16:17:21 +1200 Subject: Add missing Plugin::Introspect --- Plugin/Introspect.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Plugin/Introspect.pm diff --git a/Plugin/Introspect.pm b/Plugin/Introspect.pm new file mode 100644 index 0000000..2f42cb2 --- /dev/null +++ b/Plugin/Introspect.pm @@ -0,0 +1,23 @@ +package Plugin::Introspect; + +use strict; +use warnings; + +my %config; + +sub configure { + my $self = shift; + my $cmdref = shift; + my $cref = shift; + %config = %$cref; + + $cmdref->("plugins", sub { $self->dump_plugins(@_); } ); + + return $self; +} + +sub dump_plugins { + my ($self, $irc, $logger, $who, $where, $rest, @arguments) = @_; + return "Plugins: " . join ", ", @{$config{plugins}}; +} +1; -- cgit v1.1