From d397c31beaa805b92bcb00951e405b4cd1a90301 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Tue, 1 Oct 2019 15:59:52 -0400 Subject: [PATCH 1/2] even more precise --- sopel_modules/SpiceBot/osd.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sopel_modules/SpiceBot/osd.py b/sopel_modules/SpiceBot/osd.py index 99e2ae8..aa31973 100644 --- a/sopel_modules/SpiceBot/osd.py +++ b/sopel_modules/SpiceBot/osd.py @@ -90,7 +90,11 @@ class ToolsOSD: """ if text_method == 'ACTION': - text_method = "\x01ACTION \x01" + text_method_bytes = (len('PRIVMSG') + + len("\x01ACTION \x01") + ) + else: + text_method_bytes = len(text_method) # available_bytes = 512 # reserved_irc_bytes = 15 @@ -118,7 +122,7 @@ class ToolsOSD: allowedLength = (512 - len(':') - hostmaskbytes - - len(' ' + text_method + ' ') + - len(' ') + text_method_bytes + len(' ') - max_recipients_bytes - len(' :') - len('\r\n') From 59a53b3ae649441c3144101eef5127e5e1bd8dce Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Tue, 1 Oct 2019 16:01:00 -0400 Subject: [PATCH 2/2] better --- sopel_modules/SpiceBot/osd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sopel_modules/SpiceBot/osd.py b/sopel_modules/SpiceBot/osd.py index aa31973..80cc245 100644 --- a/sopel_modules/SpiceBot/osd.py +++ b/sopel_modules/SpiceBot/osd.py @@ -122,7 +122,7 @@ class ToolsOSD: allowedLength = (512 - len(':') - hostmaskbytes - - len(' ') + text_method_bytes + len(' ') + - len(' ') - text_method_bytes - len(' ') - max_recipients_bytes - len(' :') - len('\r\n')