Skip to content

Instantly share code, notes, and snippets.

@Spikeophant
Created November 22, 2023 16:45
Show Gist options
  • Save Spikeophant/9c4c1843d113e7a0fd8dc379ae857edd to your computer and use it in GitHub Desktop.
Save Spikeophant/9c4c1843d113e7a0fd8dc379ae857edd to your computer and use it in GitHub Desktop.
add irssi timeout to autovoice.pl
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