Renovate the module system and implement adding and resuming pool instances using the new relay/alias/network system
This commit is contained in:
24
commands/cmd.py
Normal file
24
commands/cmd.py
Normal 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)
|
||||
Reference in New Issue
Block a user