commit 66299849138fd08413154a80449df93a96595eda
parent 1e3dc7f675f7a9084146f5bf15eec9ca51cf71eb
Author: xfnw <xfnw@ttm.sh>
Date: Mon, 18 Jan 2021 21:28:20 -0500
randomize network order so one network does not get priority
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bot.py b/bot.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-import asyncio
+import asyncio, random
from irctokens import build, Line
from ircrobots import Bot as BaseBot
@@ -56,10 +56,10 @@ class Server(BaseServer):
await self.bot.add_server(args[1],ConnectionParams(NICKNAME,args[2],args[3],bool(int(args[4]))))
await self.send(build("PRIVMSG",[self.chan,"Connected to {} :3".format(args[1])]))
return
- for i in self.bot.servers:
+ for i in random.sample(list(self.bot.servers),len(self.bot.servers)):
asyncio.create_task(self.bot.servers[i].ac(self.name,args))
return
- for i in self.bot.servers:
+ for i in random.sample(list(self.bot.servers),len(self.bot.servers)):
asyncio.create_task(self.bot.servers[i].bc(self.name,nick,text))
#await self.send(build("PRIVMSG ##xfnw :ine and boat ",[text]))
if line.command == "INVITE":