Implement admall command to run commands as the administrative relay user
This commit is contained in:
parent
b19dfcc113
commit
0f31d7f5e2
|
@ -0,0 +1,22 @@
|
||||||
|
import main
|
||||||
|
from core.bot import deliverRelayCommands
|
||||||
|
|
||||||
|
class AdmallCommand:
|
||||||
|
def __init__(self, *args):
|
||||||
|
self.admall(*args)
|
||||||
|
|
||||||
|
def admall(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||||||
|
if authed:
|
||||||
|
if length > 2:
|
||||||
|
for i in main.network.keys():
|
||||||
|
for x in main.network[i].relays.keys():
|
||||||
|
num = main.network[i].relays[x]["id"]
|
||||||
|
commands = {spl[1]: [" ".join(spl[2:])]}
|
||||||
|
success("Sending commands to relay %s" % (num))
|
||||||
|
deliverRelayCommands(num, commands)
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
incUsage("admall")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
incUsage(None)
|
|
@ -26,5 +26,6 @@
|
||||||
"token": "token <add|del|list> [<key>] [<relay>]",
|
"token": "token <add|del|list> [<key>] [<relay>]",
|
||||||
"all": "all <entity> <text ...>",
|
"all": "all <entity> <text ...>",
|
||||||
"allc": "allc <network|alias> <(network)|(alias)> <entity> <text ...>",
|
"allc": "allc <network|alias> <(network)|(alias)> <entity> <text ...>",
|
||||||
|
"admall": "admall <entity> <text ...>",
|
||||||
"swho": "swho <network> [<channel>]"
|
"swho": "swho <network> [<channel>]"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue