diff options
| author | 2020-05-06 13:33:09 -0700 | |
|---|---|---|
| committer | 2020-06-13 11:21:05 -0700 | |
| commit | 59dfd276adabeb8ba643a0b22128af7d765d3210 (patch) | |
| tree | bd2daff440086f2933a363eb6f5be5182af2d30e | |
| parent | Code block: rework the instruction formatting functions (diff) | |
Code block: remove truncate function
No longer used anywhere.
| -rw-r--r-- | bot/cogs/codeblock/parsing.py | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/bot/cogs/codeblock/parsing.py b/bot/cogs/codeblock/parsing.py index d541441e0..bb71aaaaf 100644 --- a/bot/cogs/codeblock/parsing.py +++ b/bot/cogs/codeblock/parsing.py @@ -99,17 +99,3 @@ def is_repl_code(content: str, threshold: int = 3) -> bool: return True return False - - -def truncate(content: str, max_chars: int = 204, max_lines: int = 10) -> str: - """Return `content` truncated to be at most `max_chars` or `max_lines` in length.""" - current_length = 0 - lines_walked = 0 - - for line in content.splitlines(keepends=True): - if current_length + len(line) > max_chars or lines_walked == max_lines: - break - current_length += len(line) - lines_walked += 1 - - return content[:current_length] + "#..." |