Created
November 22, 2023 16:45
-
-
Save Spikeophant/9c4c1843d113e7a0fd8dc379ae857edd to your computer and use it in GitHub Desktop.
add irssi timeout to autovoice.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub voicem { | |
my ($channel_rec, @nicks) = @_; | |
if (is_auto($channel_rec)) { | |
for my $nick_rec (@nicks) { | |
unless (is_bad($channel_rec, $nick_rec) | |
or $nick_rec->{voice}) { | |
if (get_voiceops() or | |
!($nick_rec->{op} or $nick_rec->{halfop})) { | |
my $nick_text = $nick_rec->{nick}; | |
# Introduce a delay before voicing | |
Irssi::timeout_add_once(10000, sub { | |
$channel_rec->command("voice $nick_text") if $channel_rec->nick_find($nick_text); | |
}, undef); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment