Created
October 24, 2025 22:32
-
-
Save oxagast/06b3da32f671b122c1d9a4d1017d394c to your computer and use it in GitHub Desktop.
Strips IRC colors from outbound messages (irssi)
This file contains hidden or 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
| #!/usr/bin/perl | |
| use strict; | |
| use vars qw($VERSION %IRSSI); | |
| $VERSION = '1.0'; | |
| %IRSSI = ( | |
| authors => 'oxagast', | |
| contact => '[email protected]', | |
| 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