From 14e7d4e74e77ee92b55e5c117d7e17477b83ef8a Mon Sep 17 00:00:00 2001 From: Georg Date: Sun, 29 Aug 2021 00:13:44 +0200 Subject: [PATCH] OPER and DEOPER notices Signed-off-by: Georg --- plugin.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/plugin.py b/plugin.py index 1adf2ef..cf2e05c 100644 --- a/plugin.py +++ b/plugin.py @@ -358,6 +358,26 @@ class SnoParser(callbacks.Plugin): self._setvhost(irc, msg, account) self._sendSnotice(irc, msg, repl) + if 'OPER' in text and 'Client opered up' in text: + + operregex = "^-OPER- Client opered up \[(.*)\]" + couple = re.match(operregex, text) + account = couple.group(1) + DictFromSnotice = {'notice': 'oper'} + repl = f"\x02\x1FNOTICE:\x0F [{account}] opered up." + + self._sendSnotice(irc, msg, repl) + + if 'OPER' in text and 'Client deopered' in text: + + operregex = "^-OPER- Client deopered \[(.*)\]" + couple = re.match(operregex, text) + account = couple.group(1) + DictFromSnotice = {'notice': 'oper'} + repl = f"\x02\x1FNOTICE:\x0F [{account}] opered down." + + self._sendSnotice(irc, msg, repl) + # Post Registration