diff options
| -rwxr-xr-x | pycrctrl.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/pycrctrl.py b/pycrctrl.py index 2a7ea89..3c0c5d3 100755 --- a/pycrctrl.py +++ b/pycrctrl.py @@ -38,7 +38,9 @@ from enum import IntEnum from gzip import GzipFile import asyncio -from blinker import signal +from blinker import signal, Namespace +signals = Namespace() +signal = signals.signal from asyncirc import irc import asyncirc.plugins.addressed @@ -491,7 +493,7 @@ def start(args): time = int(args[1]) except Exception: time = 5 - args[0](f"/start {time}") + server.writeToServer(f"/start {time}") @server.on("cmd-stop") def stop(args): @@ -561,6 +563,19 @@ def host(args): else: reply("Warteschlange ist voll!") +@server.on("cmd-help") +def hlp(args): + reply = args[0] + reply("Verfügbare Befehle:") + r = re.compile(r"cmd\-(.*)$") + s = [] + for sig in signals: + m = r.match(sig) + if m: + s.append(m[1]) + reply(", ".join(s)) + + @server.on("cmd-quit") def quit(args): reply = args[0] |
