allow connecting to nonexistant servers
This commit is contained in:
parent
3ba295d33e
commit
1479da33be
7
bot.py
7
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))
|
||||
|
|
Loading…
Reference in New Issue