mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
test
This commit is contained in:
parent
348b8f2fdb
commit
50f3e170c3
@ -92,16 +92,13 @@ class ToolsOSD:
|
|||||||
if text_method == 'ACTION':
|
if text_method == 'ACTION':
|
||||||
text_method = 'PRIVMSG'
|
text_method = 'PRIVMSG'
|
||||||
|
|
||||||
available_bytes = 512
|
# available_bytes = 512
|
||||||
reserved_irc_bytes = 15
|
# reserved_irc_bytes = 15
|
||||||
available_bytes -= reserved_irc_bytes
|
# available_bytes -= reserved_irc_bytes
|
||||||
try:
|
try:
|
||||||
hostmaskbytes = len((bot.users.get(bot.nick).hostmask).encode('utf-8'))
|
hostmaskbytes = len((bot.users.get(bot.nick).hostmask).encode('utf-8'))
|
||||||
available_bytes -= hostmaskbytes
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# hostmaskbytes = len((bot.nick).encode('utf-8')) + 12 + 63
|
# hostmaskbytes = len((bot.nick).encode('utf-8')) + 12 + 63
|
||||||
hostmaskbytes = len((bot.nick).encode('utf-8')) + 12 + 63
|
|
||||||
available_bytes -= hostmaskbytes
|
|
||||||
hostmaskbytes = (len((bot.nick).encode('utf-8')) # Bot's NICKLEN
|
hostmaskbytes = (len((bot.nick).encode('utf-8')) # Bot's NICKLEN
|
||||||
+ 1 # (! separator)
|
+ 1 # (! separator)
|
||||||
+ len('~') # (for the optional ~ in user)
|
+ len('~') # (for the optional ~ in user)
|
||||||
@ -117,7 +114,7 @@ class ToolsOSD:
|
|||||||
groupbytes.append(len((recipients_part).encode('utf-8')))
|
groupbytes.append(len((recipients_part).encode('utf-8')))
|
||||||
|
|
||||||
max_recipients_bytes = max(groupbytes)
|
max_recipients_bytes = max(groupbytes)
|
||||||
available_bytes -= max_recipients_bytes
|
# available_bytes -= max_recipients_bytes
|
||||||
|
|
||||||
allowedLength = (512
|
allowedLength = (512
|
||||||
- len(':') - hostmaskbytes
|
- len(':') - hostmaskbytes
|
||||||
@ -127,8 +124,6 @@ class ToolsOSD:
|
|||||||
- len('\r\n')
|
- len('\r\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
bot.say("old length of " + text_method + " to " + str(recipientgroups) + " is " + str(allowedLength), "#deathbybandaid")
|
|
||||||
bot.say("new length of " + text_method + " to " + str(recipientgroups) + " is " + str(available_bytes), "#deathbybandaid")
|
|
||||||
return allowedLength
|
return allowedLength
|
||||||
|
|
||||||
def get_sendable_message_list(messages, max_length=400):
|
def get_sendable_message_list(messages, max_length=400):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user