feat: auto-resume music on reconnect, sorcerer tier, cert auth
Auto-resume: save playback position on stream errors and cancellation, restore automatically after reconnect or container restart once the channel is silent. Plugin lifecycle hook (on_connected) ensures the reconnect watcher starts without waiting for user commands. Sorcerer tier: new permission level between oper and admin. Configured via [mumble] sorcerers list in derp.toml. Mumble cert auth: pass certfile/keyfile to pymumble for client certificate authentication. Fixes: stream_audio now re-raises CancelledError and Exception so _play_loop detects failures correctly. Subprocess cleanup uses 3s timeout. Graceful shutdown cancels background tasks before stopping pymumble. Safe getattr for _opers in core plugin. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -145,7 +145,8 @@ async def cmd_whoami(bot, message):
|
||||
prefix = message.prefix or "unknown"
|
||||
tier = bot._get_tier(message)
|
||||
tags = [tier]
|
||||
if message.prefix and message.prefix in bot._opers:
|
||||
opers = getattr(bot, "_opers", set())
|
||||
if message.prefix and message.prefix in opers:
|
||||
tags.append("IRCOP")
|
||||
await bot.reply(message, f"{prefix} [{', '.join(tags)}]")
|
||||
|
||||
@@ -158,12 +159,16 @@ async def cmd_admins(bot, message):
|
||||
parts.append(f"Admin: {', '.join(bot._admins)}")
|
||||
else:
|
||||
parts.append("Admin: (none)")
|
||||
sorcerers = getattr(bot, "_sorcerers", [])
|
||||
if sorcerers:
|
||||
parts.append(f"Sorcerer: {', '.join(sorcerers)}")
|
||||
if bot._operators:
|
||||
parts.append(f"Oper: {', '.join(bot._operators)}")
|
||||
if bot._trusted:
|
||||
parts.append(f"Trusted: {', '.join(bot._trusted)}")
|
||||
if bot._opers:
|
||||
parts.append(f"IRCOPs: {', '.join(sorted(bot._opers))}")
|
||||
opers = getattr(bot, "_opers", set())
|
||||
if opers:
|
||||
parts.append(f"IRCOPs: {', '.join(sorted(opers))}")
|
||||
else:
|
||||
parts.append("IRCOPs: (none)")
|
||||
await bot.reply(message, " | ".join(parts))
|
||||
|
||||
Reference in New Issue
Block a user