Skip to content

Instantly share code, notes, and snippets.

@xopr
Created August 16, 2021 07:29
Show Gist options
  • Save xopr/269afe2f36eb4824190542741c0f0c74 to your computer and use it in GitHub Desktop.
Save xopr/269afe2f36eb4824190542741c0f0c74 to your computer and use it in GitHub Desktop.
use strict;
use Irssi;
use Irssi::Irc;
use vars qw($VERSION %IRSSI);
$VERSION = "0.9";
%IRSSI = (
authors => "xopr",
contact => "xopr\@ackspace.nl",
name => "autorespond",
description => "responds with a 'moved' message every so often",
license => "GPLv2",
url => "https://ackspace.nl/",
);
my $timeouttag;
sub checklimit
{
$timeouttag = undef;
}
sub cmd_autorespond
{
my ($server, $data, $nick, $mask, $target) = @_;
#return unless $server->{address}=~/^.*\.libera.chat$/i;
return unless $target=~/^#ackspace/i;
return unless $server->{address}=~/freenode/i;
if (not defined $timeouttag)
{
$server->command('msg '.$target.' FYI:');
$server->command('msg '.$target.' #ACKspace has moved to Libera');
$server->command('msg '.$target.' #ircs://irc.libera.chat:6697/ACKspace');
$server->command('msg '.$target.' https://ackspace.nl/wiki/Hackerspace_ACKspace:Communication#IRC');
$timeouttag = Irssi::timeout_add(10 * 60 * 1000, 'checklimit','');
}
}
Irssi::signal_add_last('message public', 'cmd_autorespond');
Irssi::print("Autorespond script loaded.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment