diff options
| author | 2019-07-09 20:48:38 +0100 | |
|---|---|---|
| committer | 2019-07-09 20:48:38 +0100 | |
| commit | 4f781f30eb9927f4b2593a71b506b894fac65346 (patch) | |
| tree | 3d8fd56015291db349d268783ff99e441ce91328 /modules/ops.py | |
| parent | add --depends-on hashflag for slowvoice.py (diff) | |
| signature | ||
add ops.py
closes #91
Diffstat (limited to 'modules/ops.py')
| -rw-r--r-- | modules/ops.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/ops.py b/modules/ops.py new file mode 100644 index 00000000..1cc2aff9 --- /dev/null +++ b/modules/ops.py @@ -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)) + |
