parent
b46a1f22f0
commit
4f781f30eb
1 changed files with 18 additions and 0 deletions
18
modules/ops.py
Normal file
18
modules/ops.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#--depends-on commands
|
||||||
|
#--depends-on config
|
||||||
|
|
||||||
|
from src import ModuleManager, utils
|
||||||
|
|
||||||
|
@utils.export("channelset", utils.BoolSetting("op-ping",
|
||||||
|
"Enable/disable command that highlights all online channel ops"))
|
||||||
|
class Module(ModuleManager.BaseModule):
|
||||||
|
@utils.hook("received.command.ops")
|
||||||
|
def ops(self, event):
|
||||||
|
if event["target"].get_setting("op-ping", False):
|
||||||
|
ops = []
|
||||||
|
for user in event["target"].users:
|
||||||
|
if event["target"].mode_or_above(user, "o"):
|
||||||
|
ops.append(user.nickname)
|
||||||
|
if ops:
|
||||||
|
event["stdout"].write(" ".join(ops))
|
||||||
|
|
Loading…
Reference in a new issue