feat: management polish, !cancel, !wordlestats, welcome fixes
Lint / Shell (shellcheck) (push) Successful in 11s
Lint / JS (eslint) (push) Successful in 7s
Lint / Python (ruff) (push) Failing after 5s
Lint / Python deps (pip-audit) (push) Successful in 41s
Lint / Secret scan (gitleaks) (push) Successful in 5s

- Add !cancel command (anyone cancels own blackjack; PL50+ clears all room games)
- Add !wordlestats top-level command (wraps wordle stats function)
- Add !cleanwelcome admin command to purge stale welcome DM records
- !help now hides management section from sub-PL50 users, hides !health from non-admins
- !announce uses nio room cache for join_rule instead of an API call per room
- Fix _INVITEALL_BLOCKED comment (Commands is knock-gated, not restricted)
- welcome.py: skip duplicate DM if a pending welcome already exists for the user
- welcome.py: add clean_stale_dm_messages() helper
- welcome.py: replace no-op post_welcome_message with log_ready()
- bot.py: update import/call to match welcome.py rename

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-29 14:50:14 -04:00
parent 4ef73afed2
commit 88627470c1
3 changed files with 433 additions and 21 deletions
+2 -3
View File
@@ -26,7 +26,7 @@ from config import (
)
from callbacks import Callbacks
from utils import setup_logging
from welcome import post_welcome_message
from welcome import log_ready as _welcome_log_ready
logger = setup_logging(LOG_LEVEL)
@@ -179,8 +179,7 @@ async def main():
# Trust devices after initial sync loads the device store
await trust_devices(client)
# Post welcome message (idempotent — only posts if not already stored)
await post_welcome_message(client)
_welcome_log_ready()
logger.info("Bot ready as %s — listening for commands", MATRIX_USER_ID)