diff options
author | David Phillips <david@sighup.nz> | 2018-09-11 23:08:11 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-09-11 23:08:11 +1200 |
commit | f830c55498f4da422ba3c28abbc480f4d9edb3d6 (patch) | |
tree | b1c34113ec9d4295f313c70fc2baa8f1e11e3194 /Plugin | |
parent | 45e19c655dbc5edd733d574b53384ffcc8655d78 (diff) | |
download | idalius-f830c55498f4da422ba3c28abbc480f4d9edb3d6.tar.xz |
Add DevNull.pm
Diffstat (limited to 'Plugin')
-rw-r--r-- | Plugin/DevNull.pm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Plugin/DevNull.pm b/Plugin/DevNull.pm new file mode 100644 index 0000000..e8a51e7 --- /dev/null +++ b/Plugin/DevNull.pm @@ -0,0 +1,29 @@ +package Plugin::DevNull; + +use strict; +use warnings; + +my %config; +my $run_command; + +sub configure { + my $self = shift; + my $cmdref = shift; + my $cref = shift; + $run_command = shift; + %config = %$cref; + + $cmdref->("hush", sub { $self->hush(@_); } ); + $cmdref->("devnull", sub { $self->hush(@_); } ); + + return $self; +} + +sub hush { + my ($self, $irc, $logger, $who, $where, $rest, @arguments) = @_; + + $run_command->($rest); + + return; +} +1; |