Renovate the module system and implement adding and resuming pool instances using the new relay/alias/network system

This commit is contained in:
2019-01-26 18:58:21 +00:00
parent 4efea3f535
commit 8926cb76ec
37 changed files with 184 additions and 302 deletions

24
commands/cmd.py Normal file
View File

@@ -0,0 +1,24 @@
import main
from core.bot import deliverRelayCommands
class Cmd:
def __init__(self, *args):
self.cmd(*args)
def cmd(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
if authed:
if length > 4:
if not spl[1] in main.relay.keys():
failure("No such relay: %s" % spl[1])
return
commands = {spl[3]: [" ".join(spl[4:])]}
print(" ".join(spl[4:]))
success("Sending commands to relay %s as user %s" % (spl[1], spl[2]))
deliverRelayCommands(spl[1], commands, user=spl[2])
return
else:
incUsage("cmd")
return
else:
incUsage(None)