TheHamkerCat пре 5 година
родитељ
комит
4ac1a57747
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      wbb/modules/couple.py

+ 3 - 1
wbb/modules/couple.py

@@ -29,7 +29,6 @@ tomorrow = str(dt_tom())
 @app.on_message(filters.command("detect_gay") & ~filters.edited)
 @capture_err
 async def couple(_, message):
-    print(1)
     if message.chat.type == "private":
         await message.reply_text("This command only works in groups.")
         return
@@ -41,6 +40,9 @@ async def couple(_, message):
             async for i in app.iter_chat_members(message.chat.id):
                 if not i.user.is_bot:
                     list_of_users.append(i.user.id)
+            if len(list_of_users) < 2:
+                await message.reply_text("Not enough users")
+                return
             c1_id = random.choice(list_of_users)
             c2_id = random.choice(list_of_users)
             while c1_id == c2_id: