Skip to content

Commit

Permalink
Add the other forms of speaking on command
Browse files Browse the repository at this point in the history
  • Loading branch information
grickit committed Apr 30, 2016
1 parent 181e2ac commit 0abb7a6
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion modules/PluginParser/Staff/Speak.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ sub match {
if($core->{'event'} ne 'on_public_message' and $core->{'event'} ne 'on_private_message') { return ''; }


if($core->{'message'} =~ /^say $validChanStrict (.+)$/) {
if($core->{'message'} =~ /^tell $validChanStrict (.+)$/) {
return order_message($core,$1,$2);
}

elsif($core->{'message'} =~ /^act $validChanStrict (.+)$/) {
return order_act($core,$1,$2);
}

elsif($core->{'message'} =~ /^notify $validChanStrict (.+)$/) {
return order_notice($core,$1,$2);
}

return '';
}
Expand All @@ -25,3 +33,16 @@ sub order_message {
$core->{'output'}->parse("MESSAGE>${chan}>${message}");
}

sub order_act {
my ($core,$chan,$message) = @_;
if(!$core->{'auth'}->test_sender($core,$chan)) { $core->{'auth'}->error($core,$chan); return ''; }

$core->{'output'}->parse("ACTION>${chan}>${message}");
}

sub order_notice {
my ($core,$chan,$message) = @_;
if(!$core->{'auth'}->test_sender($core,$chan)) { $core->{'auth'}->error($core,$chan); return ''; }

$core->{'output'}->parse("NOTICE>${chan}>${message}");
}

0 comments on commit 0abb7a6

Please sign in to comment.