diff options
author | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2015-10-21 17:25:23 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2015-10-21 17:25:23 -0700 |
commit | a60c6ac88208c11eee3de4addfc32f2bea3598ad (patch) | |
tree | e888c207c3238c465c941bf2fcb2e3834d9e4f63 /irssi-jtv.pl | |
parent | e548f47fdc91a52f27f3b5be2ee700b690b24bd6 (diff) | |
download | twitchtools-a60c6ac88208c11eee3de4addfc32f2bea3598ad.tar.gz twitchtools-a60c6ac88208c11eee3de4addfc32f2bea3598ad.zip |
irssi-jtv.pl: new
Diffstat (limited to 'irssi-jtv.pl')
-rw-r--r-- | irssi-jtv.pl | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/irssi-jtv.pl b/irssi-jtv.pl new file mode 100644 index 0000000..e9e72f5 --- /dev/null +++ b/irssi-jtv.pl @@ -0,0 +1,29 @@ +use Irssi 0.8.10 (); +use strict; + +use vars qw($VERSION %IRSSI); + +$VERSION="0.1.7"; +%IRSSI = ( + authors=> 'jrayhawk', + name=> 'jtv', + description=> 'repeats JTV information', + license=> 'GPL v2', +); + +sub jtv_say { + my ($server, $msg, $nick, $address) = @_; + + return if ($nick ne 'jtv'); + + return if ($msg !~ /(.+) is now hosting you for (.+) viewers\./ ); + + open(FILE, "~/.config/twitch/channel"); + my $channel = <FILE>; + $channel = chomp($channel); + close(FILE); + + $server->command("msg $channel Welcome, $2 viewers! Thanks for the host, $1!"); +} + +Irssi::signal_add_last('message private', 'jtv_say'); |