mirror of
https://github.com/irssi/irssi.git
synced 2026-08-17 23:52:22 +02:00
Irssi 0.7.27 released.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@130 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
3d513eebfa
commit
f5fc624781
15 changed files with 135 additions and 29 deletions
19
examples/privmsg.pl
Normal file
19
examples/privmsg.pl
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# listen PRIVMSGs - send a notice to yourself when your nick is meantioned
|
||||
|
||||
use Irssi;
|
||||
|
||||
sub event_privmsg {
|
||||
my ($data, $server, $nick, $address) = @_;
|
||||
my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
|
||||
|
||||
return if (!Irssi::is_channel($target));
|
||||
|
||||
%sinfo = %{$server->values()};
|
||||
$mynick = $sinfo{'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");
|
||||
Loading…
Add table
Add a link
Reference in a new issue