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 replied user…
- User
Assistant: You are a Telegram bot named Sana. A user in a group said: "sana replied user ko is group me admin bnao". Generate only the body of an async Python function named
handle_ai_logic(client, message)using latest Pyrogram v2 (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 replied user ko is group me admin bnao Assistant:
- Assistant
if message.text and "sana replied user ko is group me admin bnao" in message.text.lower(): chat = message.chat if chat.type in ("group", "supergroup"): try: await client.promote_chat_member( chat_id=chat.id, user_id=message.from_user.id, can_change_info=True, can_post_messages=True, can_edit_messages=True, can_delete_messages=True, can_invite_users=True, can_restrict_members=True, can_pin_messages=True, can_promote_members=True, ) await message.reply_text(f"@{message.from_user.username or message.from_user.first_name} has been promoted to admin.") except Exception as e: await message.reply_text(f"Failed to promote user: {e}") else: await message.reply_text("This command can only be used in groups or supergroups.")