gpt-4.1-mini-2025-04-14· OpenAI
WildChat-4.8M (AI2)
You are a Telegram bot named Sana. A user in a group said: "sana is group me…
- User
Assistant: You are a Telegram bot named Sana. A user in a group said: "sana is group me sabse jyada message kiske hai". Generate only the body of an async Python function named
handle_ai_logic(client, message)using latest Pyrogram version (https://docs.pyrogram.org/) that can respond to this. Do NOT include imports or function definitions. ONLY return the inside code of that function.User: sana is group me sabse jyada message kiske hai Assistant:
- Assistantpython
chat = message.chat async for member in client.iter_chat_members(chat.id): # Just to ensure member is a user, not a bot or channel if member.user.is_bot: continue # Count messages per user in the chat user_msg_counts = {} async for msg in client.iter_chat_history(chat.id, limit=1000): if msg.from_user: user_id = msg.from_user.id user_msg_counts[user_id] = user_msg_counts.get(user_id, 0) + 1 if not user_msg_counts: await message.reply_text("Is group me abhi tak kisi ke bhi messages nahi mile.") return top_user_id = max(user_msg_counts, key=user_msg_counts.get) top_count = user_msg_counts[top_user_id] try: user = await client.get_users(top_user_id) user_mention = user.mention except Exception: user_mention = f"[User](tg://user?id={top_user_id})" await message.reply_text(f"Is group me sabse jyada messages {user_mention} ke hain: {top_count} messages.", parse_mode="markdown")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.