ruff: Fix B005 Using .strip()
with multi-character strings is misleading.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
347490c647
commit
32e0520196
1 changed files with 6 additions and 2 deletions
|
@ -693,7 +693,11 @@ To move subjects, send your message again, otherwise join the game using the lin
|
||||||
verified_users = []
|
verified_users = []
|
||||||
failed = False
|
failed = False
|
||||||
for u in users:
|
for u in users:
|
||||||
user = u.strip().lstrip("@**").rstrip("**")
|
user = u.strip()
|
||||||
|
if user.startswith("@**"):
|
||||||
|
user = user[len("@**") :]
|
||||||
|
if user.endswith("**"):
|
||||||
|
user = user[: -len("**")]
|
||||||
if (
|
if (
|
||||||
user == self.get_bot_username() or user == self.email
|
user == self.get_bot_username() or user == self.email
|
||||||
) and not self.supports_computer:
|
) and not self.supports_computer:
|
||||||
|
@ -1007,7 +1011,7 @@ class GameInstance:
|
||||||
if winner == "draw":
|
if winner == "draw":
|
||||||
self.broadcast("It was a draw!")
|
self.broadcast("It was a draw!")
|
||||||
elif winner.startswith("except:"):
|
elif winner.startswith("except:"):
|
||||||
loser = winner.lstrip("except:")
|
loser = winner[len("except:") :]
|
||||||
else:
|
else:
|
||||||
winner_name = self.game_adapter.get_username_by_email(winner)
|
winner_name = self.game_adapter.get_username_by_email(winner)
|
||||||
self.broadcast(f"**{winner_name}** won! :tada:")
|
self.broadcast(f"**{winner_name}** won! :tada:")
|
||||||
|
|
Loading…
Add table
Reference in a new issue