From 117438be76a92fb408ac06b04c226ed8186c211c Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Sat, 1 Feb 2025 18:43:56 -0500 Subject: [PATCH] refactor(fun): simplify if statement --- fun.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fun.py b/fun.py index 1cf25e4..c55d841 100644 --- a/fun.py +++ b/fun.py @@ -4,6 +4,7 @@ import commands async def on_message(message): - if "gn" in commands.tokenize(message.content, remove_prefix=False): - if random.random() < 0.01: - await message.add_reaction(random.choice(["💤", "😪", "😴", "🛌"])) + if random.random() < 0.01 and "gn" in commands.tokenize( + message.content, remove_prefix=False + ): + await message.add_reaction(random.choice(["💤", "😪", "😴", "🛌"]))