hangman: edit board in place + fix ASCII art rendering; wyr: debug reaction logging
- Add edit_html() to utils using m.replace so messages can be updated - Hangman board now edits in place on every guess — shows progressing ASCII figure as wrong guesses accumulate instead of spamming new messages - Extract _hangman_board_html() helper for consistent board rendering - wyr: add INFO-level logging to reaction callback to diagnose vote tracking Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+13
-3
@@ -81,19 +81,29 @@ class Callbacks:
|
||||
|
||||
# m.reaction events come as UnknownEvent with type "m.reaction"
|
||||
if not hasattr(event, "source"):
|
||||
logger.info("reaction: event has no source attr, type=%s sender=%s", type(event).__name__, event.sender)
|
||||
return
|
||||
|
||||
event_type = event.source.get("type", "")
|
||||
content = event.source.get("content", {})
|
||||
relates_to = content.get("m.relates_to", {})
|
||||
if relates_to.get("rel_type") != "m.annotation":
|
||||
return
|
||||
|
||||
rel_type = relates_to.get("rel_type", "")
|
||||
reacted_event_id = relates_to.get("event_id", "")
|
||||
key = relates_to.get("key", "")
|
||||
|
||||
logger.info(
|
||||
"reaction: type=%s rel_type=%s key=%r target=%s sender=%s",
|
||||
event_type, rel_type, key, reacted_event_id[:16] if reacted_event_id else "", event.sender,
|
||||
)
|
||||
|
||||
if rel_type != "m.annotation":
|
||||
return
|
||||
|
||||
await handle_welcome_reaction(
|
||||
self.client, room.room_id, event.sender, reacted_event_id, key
|
||||
)
|
||||
from commands import _WYR_POLLS
|
||||
logger.info("reaction: wyr polls active=%s matched=%s", list(_WYR_POLLS.keys()), reacted_event_id in _WYR_POLLS)
|
||||
record_wyr_vote(reacted_event_id, event.sender, key)
|
||||
|
||||
async def member(self, room, event):
|
||||
|
||||
Reference in New Issue
Block a user