From 1af59f32dc01a7bf60408d9c2c5907be9843ac20 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 3 Apr 2021 18:53:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Display=20non-cropped=20names=20?= =?UTF-8?q?in=20the=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- royalpack/commands/ship.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/royalpack/commands/ship.py b/royalpack/commands/ship.py index 54cb7109..61a47c2a 100644 --- a/royalpack/commands/ship.py +++ b/royalpack/commands/ship.py @@ -36,13 +36,13 @@ async def ship(*, _sentry: engi.Sentry, _msg: engi.Message, first: str, second: log.debug(f"Matches: {first_match!r} + {second_match!r}") # Get the matched characters if the matches were successful, or cut the names in half if they weren't - first = first_match.group(0) if first_match else first[:(len(first) // 2)] - second = second_match.group(0) if second_match else second[(len(second) // 2):] + first_crop = first_match.group(0) if first_match else first[:(len(first) // 2)] + second_crop = second_match.group(0) if second_match else second[(len(second) // 2):] - log.debug(f"Cropped: {first!r} + {second!r}") + log.debug(f"Cropped: {first_crop!r} + {second_crop!r}") # Combine the two parts - combined = f"{first}{second}" + combined = f"{first_crop}{second_crop}" log.info(f"Combined: {combined!r}")