2019-08-15 20:20:49 +00:00
|
|
|
import main
|
2022-07-21 12:40:05 +00:00
|
|
|
from utils.deliver_relay_commands import deliverRelayCommands
|
2019-08-15 20:20:49 +00:00
|
|
|
|
2022-07-21 12:39:41 +00:00
|
|
|
|
2019-09-29 13:57:36 +00:00
|
|
|
class AllCommand:
|
2019-08-15 20:20:49 +00:00
|
|
|
def __init__(self, *args):
|
|
|
|
self.all(*args)
|
|
|
|
|
2022-09-05 06:20:30 +00:00
|
|
|
def all(
|
|
|
|
self, addr, authed, data, obj, spl, success, failure, info, incUsage, length
|
|
|
|
):
|
2019-08-15 20:20:49 +00:00
|
|
|
if authed:
|
|
|
|
if length > 2:
|
2019-09-29 13:57:36 +00:00
|
|
|
for i in main.network.keys():
|
|
|
|
for x in main.network[i].relays.keys():
|
|
|
|
num = main.network[i].relays[x]["id"]
|
|
|
|
net = main.network[i].relays[x]["net"]
|
2019-09-29 21:45:16 +00:00
|
|
|
alias = main.alias[x]["nick"]
|
2019-09-29 13:57:36 +00:00
|
|
|
commands = {spl[1]: [" ".join(spl[2:])]}
|
2022-09-05 06:20:30 +00:00
|
|
|
success(
|
|
|
|
"Sending commands to relay %s as user %s"
|
|
|
|
% (num, alias + "/" + net)
|
|
|
|
)
|
2022-07-21 12:39:41 +00:00
|
|
|
deliverRelayCommands(num, commands, user=alias + "/" + net)
|
2019-08-15 20:20:49 +00:00
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("all")
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage(None)
|