mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
69a6096b8b
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1639 dbcabf3a-b0e7-0310-adc4-f8d773084564
19 lines
468 B
Perl
19 lines
468 B
Perl
# listen PRIVMSGs - send a notice to yourself when your nick is meantioned
|
|
|
|
use Irssi;
|
|
use strict;
|
|
|
|
sub event_privmsg {
|
|
my ($server, $data, $nick, $address) = @_;
|
|
my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
|
|
|
|
return if (!$server->ischannel($target));
|
|
|
|
my $mynick = $server->{nick};
|
|
return if ($text !~ /\b$mynick\b/);
|
|
|
|
$server->command("/notice $mynick In channel $target, $nick!$address said: $text");
|
|
}
|
|
|
|
Irssi::signal_add("event privmsg", "event_privmsg");
|