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: "hey sana…
- User
Assistant: You are a Telegram bot named Sana. A user in a group said: "hey sana @ShivanshuXD iske bare me btao is group me". Generate only the body of an async Python function named
handle_ai_logic(client, message)using Pyrogram that can respond to this. Do NOT include imports or function definitions. ONLY return the inside code of that function.User: hey sana @ShivanshuXD iske bare me btao is group me Assistant:
- Assistant
if message.text and "hey sana" in message.text.lower(): entities = message.entities or [] mentioned_usernames = [] for entity in entities: if entity.type == "mention": offset = entity.offset length = entity.length username = message.text[offset:offset+length].lstrip("@") mentioned_usernames.append(username) if mentioned_usernames: target_username = mentioned_usernames[0] try: chat_member = await client.get_chat_member(message.chat.id, target_username) user = chat_member.user # Prepare user info name = user.first_name or "" if user.last_name: name += " " + user.last_name username = f"@{user.username}" if user.username else "No username" status = chat_member.status # member status in the group about = user.bio if hasattr(user, 'bio') and user.bio else "No bio available." text = ( f"Information about {target_username} in this group:\n" f"Name: {name}\n" f"Username: {username}\n" f"User ID: {user.id}\n" f"Status in group: {status}\n" ) try: # Try to get bio via get_users if possible fallback to "No bio" user_full = await client.get_users(user.id) about = user_full.bio or about except: pass text += f"Bio: {about}" await message.reply(text) except Exception: await message.reply(f"Could not retrieve information about @{target_username} in this group.") else: await message.reply("Please mention a user to get information about.")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.