mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
Verify message is not space
This commit is contained in:
parent
d61db4b06b
commit
31997b3c58
@ -188,7 +188,7 @@ class ToolsOSD:
|
|||||||
messages_list[-1] = messages_list[-1] + message_padding + message
|
messages_list[-1] = messages_list[-1] + message_padding + message
|
||||||
else:
|
else:
|
||||||
text_list = []
|
text_list = []
|
||||||
while len(message.encode('utf-8')) > max_length:
|
while len(message.encode('utf-8')) > max_length and not message.isspace():
|
||||||
last_space = message.rfind(' ', 0, max_length)
|
last_space = message.rfind(' ', 0, max_length)
|
||||||
if last_space == -1:
|
if last_space == -1:
|
||||||
# No last space, just split where it is possible
|
# No last space, just split where it is possible
|
||||||
@ -202,7 +202,7 @@ class ToolsOSD:
|
|||||||
if not splitappend.isspace():
|
if not splitappend.isspace():
|
||||||
text_list.append(splitappend)
|
text_list.append(splitappend)
|
||||||
message = message[last_space:]
|
message = message[last_space:]
|
||||||
if len(message.encode('utf-8')):
|
if len(message.encode('utf-8')) and not message.isspace():
|
||||||
text_list.append(message)
|
text_list.append(message)
|
||||||
messages_list.extend(text_list)
|
messages_list.extend(text_list)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user