From 0260da349d165ae8b90c23a00359879b25c62334 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 31 Oct 2009 02:50:52 -0500 Subject: move !help out into its own default plugin --- lib/IM/Engine/Plugin/Commands/Command/Help.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/IM/Engine/Plugin/Commands/Command/Help.pm (limited to 'lib/IM/Engine/Plugin/Commands') diff --git a/lib/IM/Engine/Plugin/Commands/Command/Help.pm b/lib/IM/Engine/Plugin/Commands/Command/Help.pm new file mode 100644 index 0000000..b28472a --- /dev/null +++ b/lib/IM/Engine/Plugin/Commands/Command/Help.pm @@ -0,0 +1,16 @@ +package IM::Engine::Plugin::Commands::Command::Help; +use IM::Engine::Plugin::Commands::OO; + +sub default { + my $self = shift; + my ($sender, $action) = @_; + $self->is_active(0); + my $prefix = $self->_ime_plugin->prefix; + my $message = IM::Engine::Incoming->new( + sender => $self->_ime_plugin->_last_message->sender, + message => "${prefix}$action -help", + ); + return $self->_ime_plugin->incoming($message); +} + +1; -- cgit v1.2.3-54-g00ecf