lint: fix E741 ambiguous variable names and F841 unused variable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1266,7 +1266,7 @@ async def cmd_hangman(client: AsyncClient, room_id: str, sender: str, args: str)
|
||||
display = _hangman_display(game)
|
||||
wrong = game["wrong_count"]
|
||||
guessed = sorted(game["guessed_letters"])
|
||||
wrong_letters = [l for l in guessed if l not in game["word"]]
|
||||
wrong_letters = [ch for ch in guessed if ch not in game["word"]]
|
||||
plain = (
|
||||
f"Hangman already in progress!\n"
|
||||
f"{_HANGMAN_STAGES[wrong]}\n"
|
||||
@@ -1370,7 +1370,7 @@ async def cmd_guess(client: AsyncClient, room_id: str, sender: str, args: str):
|
||||
await send_html(client, room_id, plain, html)
|
||||
return
|
||||
|
||||
wrong_letters = sorted(l for l in game["guessed_letters"] if l not in word)
|
||||
wrong_letters = sorted(ch for ch in game["guessed_letters"] if ch not in word)
|
||||
plain = (
|
||||
f"✅ '{letter.upper()}' is in the word!\n"
|
||||
f"{_HANGMAN_STAGES[game['wrong_count']]}\n"
|
||||
@@ -1389,7 +1389,7 @@ async def cmd_guess(client: AsyncClient, room_id: str, sender: str, args: str):
|
||||
game["wrong_count"] += 1
|
||||
wrong_count = game["wrong_count"]
|
||||
display = _hangman_display(game)
|
||||
wrong_letters = sorted(l for l in game["guessed_letters"] if l not in word)
|
||||
wrong_letters = sorted(ch for ch in game["guessed_letters"] if ch not in word)
|
||||
|
||||
if wrong_count >= 6:
|
||||
del _HANGMAN_GAMES[room_id]
|
||||
@@ -1598,7 +1598,6 @@ async def cmd_wyr(client: AsyncClient, room_id: str, sender: str, args: str):
|
||||
if hasattr(resp, "event_id"):
|
||||
await send_reaction(client, room_id, resp.event_id, "🅰️")
|
||||
await send_reaction(client, room_id, resp.event_id, "🅱️")
|
||||
event_id = resp.event_id
|
||||
|
||||
async def reveal():
|
||||
await asyncio.sleep(30)
|
||||
@@ -1976,7 +1975,7 @@ async def cmd_debate(client: AsyncClient, room_id: str, sender: str, args: str):
|
||||
against_text = against_part.strip()
|
||||
else:
|
||||
# Fallback: try to split in half
|
||||
lines = [l.strip() for l in text.split("\n") if l.strip()]
|
||||
lines = [ln.strip() for ln in text.split("\n") if ln.strip()]
|
||||
mid = len(lines) // 2
|
||||
for_text = " ".join(lines[:mid]) if lines else "No argument generated."
|
||||
against_text = " ".join(lines[mid:]) if lines else "No argument generated."
|
||||
|
||||
Reference in New Issue
Block a user