commit 1479da33bee81a41dded633c31b3f43d4ad8e101
parent 3ba295d33ea6a28b9981b2046e6c4062cc96353c
Author: xfnw <xfnw@ttm.sh>
Date: Wed, 30 Dec 2020 11:42:04 -0500
allow connecting to nonexistant servers
Diffstat:
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/bot.py b/bot.py
@@ -53,11 +53,8 @@ class Server(BaseServer):
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) > 4:
- if args[1] in self.bot.servers:
- 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"])))
+ 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])]))
return
for i in self.bot.servers:
asyncio.create_task(self.bot.servers[i].ac(self.name,args))