Improvements to query and self event detection, implement all command and debug flags

This commit is contained in:
2019-08-15 21:20:49 +01:00
parent 1ec0e1f7e6
commit f34ddab6fc
13 changed files with 103 additions and 25 deletions

23
commands/all.py Normal file
View File

@@ -0,0 +1,23 @@
import main
from core.bot import deliverRelayCommands
class All:
def __init__(self, *args):
self.all(*args)
def all(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
if authed:
if length > 2:
for i in main.pool.keys():
relay = main.pool[i]["relay"]
network = main.pool[i]["network"]
alias = main.pool[i]["alias"]
commands = {spl[1]: [" ".join(spl[2:])]}
success("Sending commands to relay %s as user %s" % (relay, alias+"/"+network))
deliverRelayCommands(relay, commands, user=alias+"/"+network)
return
else:
incUsage("all")
return
else:
incUsage(None)