aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shirayuki Nekomata <[email protected]>2019-11-14 12:05:18 +0700
committerGravatar Shirayuki Nekomata <[email protected]>2019-11-14 12:05:18 +0700
commit501aa5655c8039f43b3cf3106474b8be16b4074a (patch)
tree2cad1a428c2cf6097ff04ab1a31ae7cb789887f3
parentSwitched to using list instead of `str.replace()` for much better control ove... (diff)
Condensed logic, now only check for `add` `remove` `same` diff_type only.
-rw-r--r--bot/cogs/moderation/modlog.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/bot/cogs/moderation/modlog.py b/bot/cogs/moderation/modlog.py
index 3a7e0d3ce..ce2a5e1f7 100644
--- a/bot/cogs/moderation/modlog.py
+++ b/bot/cogs/moderation/modlog.py
@@ -656,15 +656,13 @@ class ModLog(Cog, name="ModLog"):
_before.append(f"[{sub}](http://o.hi)")
elif diff_type == '+':
_after.append(f"[{sub}](http://o.hi)")
- elif len(words) > 2:
- new = (
- f"{words[0] if index > 0 else ''}"
- " ... "
- f"{words[-1] if index < len(diff_groups) - 1 else ''}"
- )
- _before.append(new)
- _after.append(new)
elif diff_type == ' ':
+ if len(words) > 2:
+ sub = (
+ f"{words[0] if index > 0 else ''}"
+ " ... "
+ f"{words[-1] if index < len(diff_groups) - 1 else ''}"
+ )
_before.append(sub)
_after.append(sub)