}
use Irssi;
-our $VERSION = '0.05';
+our $VERSION = '0.06';
our %IRSSI = (
authors => 'aluser',
name => 'autovoice',
sub autovoice_cmd {
my ($data, $server, $witem) = @_;
my ($cmd, @args) = (split ' ', $data);
+ $cmd='' if (!defined $cmd);
$cmd = lc $cmd;
if (exists $commands{$cmd}) {
$commands{$cmd}->($server, $witem, @args)
} else {
- Irssi::print("No such command: autovoice $cmd");
+ Irssi::print("No such subcommand: autovoice '$cmd'");
}
}
Irssi::settings_add_bool('autovoice', 'autovoice_voice_ops' => 0);
Irssi::settings_add_bool('autovoice', 'autovoice_use_ident' => 0);
Irssi::settings_add_bool('autovoice', 'autovoice' => 1);
-Irssi::command_bind(autovoice => 'autovoice_cmd');
+
+Irssi::command_bind($IRSSI{name},'autovoice_cmd');
+foreach (keys %commands) {
+ Irssi::command_bind($IRSSI{name}.' '.$_,'autovoice_cmd');
+}