{"library":"qq-botpy","title":"Tencent QQ Channel Python SDK","description":"qq-botpy is the official Python SDK for creating bots on Tencent's QQ Channels, providing an easy-to-use and efficient framework for developers. It abstracts the complexities of the QQ Open Platform API, enabling quick development of features like message handling and event listening. The library is actively maintained, with frequent updates; the current stable version is 1.2.1.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install qq-botpy"],"cli":null},"imports":["import botpy\nfrom botpy.types.message import Message","import botpy"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport botpy\nfrom botpy.types.message import Message\n\n# Get credentials from environment variables or provide defaults\nAPP_ID = os.environ.get(\"QQ_BOT_APP_ID\", \"YOUR_APP_ID\")\nAPP_SECRET = os.environ.get(\"QQ_BOT_APP_SECRET\", \"YOUR_APP_SECRET\")\n\nclass MyClient(botpy.Client):\n    async def on_ready(self):\n        \"\"\"Event triggered when the bot is ready.\"\"\"\n        print(f\"robot 「{self.robot.name}」 on_ready!\")\n\n    async def on_at_message_create(self, message: Message):\n        \"\"\"Event triggered when the bot receives an @ message.\"\"\"\n        # Remove the bot's mention from the message content\n        user_message_content = message.content.replace(f\"<@{self.robot.id}>\", \"\").strip()\n        \n        if user_message_content:\n            response_content = f\"Hello, {message.author.username}! You said: {user_message_content}\"\n        else:\n            response_content = f\"Hello, {message.author.username}! How can I help you?\"\n\n        await message.reply(content=response_content)\n\nif __name__ == \"__main__\":\n    # Define the intents (events the bot should listen to)\n    intents = botpy.Intents(public_guild_messages=True)\n    \n    # Create and run the client\n    client = MyClient(intents=intents)\n    client.run(appid=APP_ID, secret=APP_SECRET)","lang":"python","description":"This quickstart demonstrates how to create a basic QQ Channel bot that responds to @-mentions. It requires your QQ bot's AppID and AppSecret, which should be set as environment variables `QQ_BOT_APP_ID` and `QQ_BOT_APP_SECRET` for security, or replaced directly with your credentials. The bot will print a 'ready' message and reply to any public guild message where it is @-mentioned.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"1.2.1","pypi_latest":"1.2.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":4.2,"avg_import_s":0.79,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"qq-botpy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.61,"mem_mb":15.3,"disk_size":"30.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"qq-botpy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5,"import_time_s":0.43,"mem_mb":15.3,"disk_size":"33M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"qq-botpy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.92,"mem_mb":16.5,"disk_size":"33.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"qq-botpy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.9,"import_time_s":0.84,"mem_mb":16.5,"disk_size":"37M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"qq-botpy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.96,"mem_mb":16.8,"disk_size":"25.4M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"qq-botpy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.1,"import_time_s":0.97,"mem_mb":16.8,"disk_size":"29M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"qq-botpy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1,"mem_mb":17,"disk_size":"24.8M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"qq-botpy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.3,"import_time_s":0.98,"mem_mb":17,"disk_size":"28M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"qq-botpy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.57,"mem_mb":14.8,"disk_size":"30.8M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"qq-botpy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.6,"import_time_s":0.58,"mem_mb":14.8,"disk_size":"34M"}]}}