At the moment, eval automatically truncates output that is greater than 10 lines or has more than 1000 characters.
The eval formatter cuts off the output past 1000 characters with a "message is too long" message and past 10 lines with a "too many lines" message. However, at the moment it is set (with MAX_PASTE_LEN) to not upload results that have more than 1000 characters.
elif len(output) >= 1000:
truncated = True
output = f"{output[:1000]}\n... (truncated - too long)"
if truncated:
paste_link = await self.upload_output(original_output)
This code contains a logic path that will only succeed at precisely 1000 characters, because the upload_output function checks len() > MAX_PASTE_LEN, but here we check len(output) >= 1000.
This is probably not worth cleaning up (because it's clearly intended to support higher MAX_PASTE_LEN values), but I think we should consider raising what we have this cap set to or moving the configuration value into the bot's actual configuration rather than a module constant. I'd vote for something around 2000-5000, at least enough to fit in a single message on the discord side, while keeping in mind we don't want to flood a channel with massive output.
At the moment, eval automatically truncates output that is greater than 10 lines or has more than 1000 characters.
The eval formatter cuts off the output past 1000 characters with a "message is too long" message and past 10 lines with a "too many lines" message. However, at the moment it is set (with
MAX_PASTE_LEN) to not upload results that have more than 1000 characters.This code contains a logic path that will only succeed at precisely 1000 characters, because the
upload_outputfunction checkslen() > MAX_PASTE_LEN, but here we checklen(output) >= 1000.This is probably not worth cleaning up (because it's clearly intended to support higher
MAX_PASTE_LENvalues), but I think we should consider raising what we have this cap set to or moving the configuration value into the bot's actual configuration rather than a module constant. I'd vote for something around 2000-5000, at least enough to fit in a single message on the discord side, while keeping in mind we don't want to flood a channel with massive output.