diff options
| author | 2020-05-30 02:42:38 +0200 | |
|---|---|---|
| committer | 2020-05-30 02:42:38 +0200 | |
| commit | c8f5f8597c8eb3cccf9cd7867fbc4777cc4b4f99 (patch) | |
| tree | bbc3ff188aa4669f0c40b3160ffc7974c3894971 | |
| parent | Truncate amount of lines in int eval output to 15. (diff) | |
Strip empty lines from int eval output.
The output generates trailing newlines, which can cause
the output to be uploaded to the paste service in cases where
it's not needed, as discord will automatically remove those in messages.
| -rw-r--r-- | bot/cogs/eval.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bot/cogs/eval.py b/bot/cogs/eval.py index edb59d286..5b7469bdf 100644 --- a/bot/cogs/eval.py +++ b/bot/cogs/eval.py @@ -172,6 +172,8 @@ async def func(): # (None,) -> Any res = traceback.format_exc() out, embed = self._format(code, res) + out = out.rstrip("\n") # Strip empty lines from output + # Truncate output to max 15 lines or 1500 characters newline_truncate_index = find_nth_occurrence(out, "\n", 15) |