TheHamkerCat %!s(int64=5) %!d(string=hai) anos
pai
achega
4ac1a57747
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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: