2019-10-29 18:00:38 +00:00
|
|
|
from . import irc
|
2018-11-13 10:40:49 +00:00
|
|
|
|
|
|
|
def bool_input(s: str):
|
|
|
|
result = input("%s (Y/n): " % s)
|
|
|
|
return not result or result[0].lower() in ["", "y"]
|
|
|
|
|
2019-10-29 18:00:38 +00:00
|
|
|
def add_server():
|
2018-11-13 10:40:49 +00:00
|
|
|
alias = input("alias: ")
|
|
|
|
hostname = input("hostname: ")
|
|
|
|
port = int(input("port: "))
|
|
|
|
tls = bool_input("tls?")
|
|
|
|
password = input("password?: ")
|
|
|
|
nickname = input("nickname: ")
|
|
|
|
username = input("username: ")
|
|
|
|
realname = input("realname: ")
|
|
|
|
bindhost = input("bindhost?: ")
|
2018-11-13 11:19:43 +00:00
|
|
|
|
2019-10-29 18:00:38 +00:00
|
|
|
return irc.IRCConnectionParameters(-1, alias, hostname, port, password, tls,
|
2018-11-13 11:13:04 +00:00
|
|
|
bindhost, nickname, username, realname)
|