diff options
| author | 2020-02-18 18:14:31 +0100 | |
|---|---|---|
| committer | 2020-02-18 18:14:31 +0100 | |
| commit | 8b386b533662e7f4be44cc57b9d9c63fde8a7ebf (patch) | |
| tree | e967c4700b6f976955d89fcc5ab661f3252b4be4 | |
| parent | Suppress HTTPException while deleting bot output (diff) | |
Snekbox small refactoring
Makes the code a bit clearer
Co-authored-by: Shirayuki Nekomata <[email protected]>
Diffstat (limited to '')
| -rw-r--r-- | bot/cogs/snekbox.py | 7 | 
1 files changed, 3 insertions, 4 deletions
| diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py index 42830fb58..efa4696b5 100644 --- a/bot/cogs/snekbox.py +++ b/bot/cogs/snekbox.py @@ -158,8 +158,8 @@ class Snekbox(Cog):          lines = output.count("\n")          if lines > 0: -            output = output.split("\n")[:11]  # Only first 11 cause the rest is truncated anyway -            output = (f"{i:03d} | {line}" for i, line in enumerate(output, 1)) +            output = [f"{i:03d} | {line}" for i, line in enumerate(output.split('\n'), 1)] +            output = output[:11]  # Limiting to only 11 lines              output = "\n".join(output)          if lines > 10: @@ -175,8 +175,7 @@ class Snekbox(Cog):          if truncated:              paste_link = await self.upload_output(original_output) -        if not output: -            output = "[No output]" +        output = output or "[No output]"          return output, paste_link | 
