commit 3ba295d33ea6a28b9981b2046e6c4062cc96353c
parent 02a16fc38fabea52a04dd666b41177aae58d2b05
Author: xfnw <xfnw@ttm.sh>
Date: Tue, 29 Dec 2020 10:54:13 -0500
connect to new servers without restarting
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bot.py b/bot.py
@@ -52,10 +52,10 @@ class Server(BaseServer):
if nick.lower() in self.users and self.users[nick.lower()].account in ADMINS:
if text[:len(self.nickname)+2].lower() == f'{self.nickname}: '.lower():
args = text[len(self.nickname)+2:].split(' ')
- if args[0] == 'connect' and len(args) > 1:
+ if args[0] == 'connect' and len(args) > 4:
if args[1] in self.bot.servers:
- asyncio.create_task(self.bot.disconnected(self.bot.servers[args[1]]))
- asyncio.create_task(self.send(build("PRIVMSG",[self.chan,"Connecting to {}...".format(args[1])])))
+ await self.bot.add_server(args[1],ConnectionParams(NICKNAME,args[2],args[3],bool(args[4])))
+ await self.send(build("PRIVMSG",[self.chan,"Connected to {} :3".format(args[1])]))
else:
asyncio.create_task(self.send(build("PRIVMSG",[self.chan,"Error: that is not a server"])))
return