seed random once on init

This commit is contained in:
xeals 2023-04-15 11:44:59 +10:00
parent 25a347cd88
commit e9b6ec4b5d
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C

2
bot.py
View File

@ -49,6 +49,7 @@ class BotClient(discord.Client):
):
super().__init__(intents=intents)
self._leaguefacts = leaguefacts or []
random.seed()
async def on_ready(self):
_log.info(f"ready as {self.user}")
@ -84,7 +85,6 @@ class BotClient(discord.Client):
def _select_leaguefact(self) -> Optional[str]:
if not self._leaguefacts:
return None
random.seed()
return random.choice(self._leaguefacts)