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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user