summaryrefslogtreecommitdiff
path: root/irssi/irssi-jtv.pl
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk+git@omgwallhack.org>2020-10-24 23:57:08 -0700
committerJoe Rayhawk <jrayhawk+git@omgwallhack.org>2020-10-24 23:57:08 -0700
commit004705ff1d0d227fa186384121fae939b9314e7d (patch)
tree5ca62c6346282f6975a8b5a9458470168d65b465 /irssi/irssi-jtv.pl
parent93aebe7498b3f3bf5079e4f218072b0ec5ad9b6c (diff)
downloadtwitchtools-004705ff1d0d227fa186384121fae939b9314e7d.tar.gz
twitchtools-004705ff1d0d227fa186384121fae939b9314e7d.zip
A handful of Irssi plugins.
irssi-jtv.pl is able to repeat host information irssi-serverevent.pl is used for triggering or debugging based on ircv3 server events.
Diffstat (limited to 'irssi/irssi-jtv.pl')
-rw-r--r--irssi/irssi-jtv.pl29
1 files changed, 29 insertions, 0 deletions
diff --git a/irssi/irssi-jtv.pl b/irssi/irssi-jtv.pl
new file mode 100644
index 0000000..e9e72f5
--- /dev/null
+++ b/irssi/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');