fix: detect oper status when users join channels

Previously the bot only sent WHO on connect (001), so users joining
after the initial scan were never checked for oper status. Now sends
WHO <nick> on every JOIN event to detect opers mid-session.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
user
2026-02-15 12:53:12 +01:00
parent 2333af0624
commit fd8f72c3cc
2 changed files with 27 additions and 0 deletions

View File

@@ -265,6 +265,12 @@ class Bot:
if "*" in flags:
self._opers.add(f"{nick}!{user}@{host}")
# JOIN — WHO the joining user to detect oper status
if msg.command == "JOIN" and msg.nick and msg.nick != self.nick:
channel = msg.params[0] if msg.params else ""
if channel:
await self.conn.send(format_msg("WHO", msg.nick))
# QUIT — remove departed nicks from oper set
if msg.command == "QUIT" and msg.prefix:
self._opers.discard(msg.prefix)