2019-07-09 19:48:38 +00:00
|
|
|
#--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")
|
2019-07-09 20:24:35 +00:00
|
|
|
@utils.kwarg("channel_only", True)
|
|
|
|
@utils.kwarg("help", "Alert the ops in the current channel")
|
2019-07-09 19:48:38 +00:00
|
|
|
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))
|
|
|
|
|