From 74e886839e669b29b540113a3ace6ea779acbda3 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 14 Feb 2018 22:13:07 +0100 Subject: Change colour escape codes to constants Make this more readable by using constants in place of the actual escape codes. --- dimpid.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dimpid.pl b/dimpid.pl index ca32c6d..78db3f6 100644 --- a/dimpid.pl +++ b/dimpid.pl @@ -12,10 +12,18 @@ our %IRSSI = { }; +use constant ESCAPE => "\x{03}"; +use constant GREY => '14'; + Irssi::signal_add('message public', sub { my ($server, $text, $nick, @rest) = @_; if ($nick eq 'test-3kj469y5h') { - Irssi::signal_continue($server, "\x{03}14" . $text . "\x{03}", $nick, @rest); + Irssi::signal_continue( + $server, + ESCAPE . GREY . $text . ESCAPE, + $nick, + @rest, + ); } }); -- cgit v1.2.3