More debugging for reg tests and getstr command
parent
39059084ef
commit
0b20a05b19
@ -0,0 +1,33 @@
|
||||
import main
|
||||
|
||||
from utils.get import getRelay
|
||||
|
||||
class GetstrCommand:
|
||||
def __init__(self, *args):
|
||||
self.getstr(*args)
|
||||
|
||||
def getstr(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||||
if authed:
|
||||
if length == 3:
|
||||
net = spl[1]
|
||||
num = spl[2]
|
||||
if not net in main.network.keys():
|
||||
failure("Network does not exist: %s" % net)
|
||||
return
|
||||
if not num.isdigit():
|
||||
failure("Must be a number, not %s" % num)
|
||||
return
|
||||
num = int(num)
|
||||
alias = main.alias[num]["nick"].lower()
|
||||
host, port = getRelay(num)
|
||||
password = main.config["Relay"]["Password"]
|
||||
connstr = f"/connect -ssl {host} {port}"
|
||||
authstr = f"/quote PASS {alias}/{net}:{password}"
|
||||
obj.send(connstr)
|
||||
obj.send(authstr)
|
||||
|
||||
else:
|
||||
incUsage("getstr")
|
||||
return
|
||||
else:
|
||||
incUsage(None)
|
Loading…
Reference in New Issue