aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shirayuki Nekomata <[email protected]>2019-11-06 09:18:35 +0700
committerGravatar Shirayuki Nekomata <[email protected]>2019-11-06 09:18:35 +0700
commit80967822c06f9ece1ad6989bd9448464dea73ece (patch)
treef8441ec4dbc7d2d16aa9c712b194a1ba450e19c5
parentChanged link used in hyperlink (diff)
Merged `else` and its single `if`, changed style to be more consistent
Following Mark's reviews: - The single `if` inside the `else` can be merged with its `else` - this will reduce the level of complexity and indentation. - Changed from style ```py new = ('hello' 'world') ``` to ```py new = ( 'hello' 'world' ) ``` to be more consistent with the rest of the code
-rw-r--r--bot/cogs/moderation/modlog.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/bot/cogs/moderation/modlog.py b/bot/cogs/moderation/modlog.py
index 6ce83840d..c86bf6faa 100644
--- a/bot/cogs/moderation/modlog.py
+++ b/bot/cogs/moderation/modlog.py
@@ -656,13 +656,14 @@ class ModLog(Cog, name="ModLog"):
_before = _before.replace(sub, f"[{sub}](http://o.hi)")
elif diff_type == '+':
_after = _after.replace(sub, f"[{sub}](http://o.hi)")
- else:
- if len(words) > 2:
- new = (f"{words[0] if index > 0 else ''}"
- " ... "
- f"{words[-1] if index < len(diff_groups) - 1 else ''}")
- _before = _before.replace(sub, new)
- _after = _after.replace(sub, new)
+ elif len(words) > 2:
+ new = (
+ f"{words[0] if index > 0 else ''}"
+ " ... "
+ f"{words[-1] if index < len(diff_groups) - 1 else ''}"
+ )
+ _before = _before.replace(sub, new)
+ _after = _after.replace(sub, new)
response = (
f"**Author:** {author} (`{author.id}`)\n"