Skip to content

Instantly share code, notes, and snippets.

@oxagast
Created October 24, 2025 22:32
Show Gist options
  • Select an option

  • Save oxagast/06b3da32f671b122c1d9a4d1017d394c to your computer and use it in GitHub Desktop.

Select an option

Save oxagast/06b3da32f671b122c1d9a4d1017d394c to your computer and use it in GitHub Desktop.
Strips IRC colors from outbound messages (irssi)
#!/usr/bin/perl
use strict;
use vars qw($VERSION %IRSSI);
$VERSION = '1.0';
%IRSSI = (
authors => 'oxagast',
contact => 'oxagast@oxasploits.com',
name => 'StripColor',
description => 'Strips IRC special codes from outgoing messages.',
license => 'BSD',
);
sub event_send_text {
my ($line, $serv, $m) = @_;
if ($line !~ /^\//) {
# Strip codes from the outgoing message.
my $cleaned_line = Irssi::strip_codes($line);
Irssi::signal_stop();
$serv->command("MSG " . $m->{name} . " " . $cleaned_line);
}
}
Irssi::signal_add("send text", "event_send_text");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment