Skip to main content

QQ 频道 API 的 Python Wrapper

Project description

QQ.py

GitHub issues GitHub pull requests PyPI - License PyPI - Status PyPI Documentation Status

✨ 用 Python 编写的用于 QQ频道机器人 的现代化、易于使用、功能丰富且异步的 API。 ✨

主要特点

  • 使用 asyncawait 的现代 Pythonic API。
  • 优化速度和内存。

安装

需要 Python 3.8或以上的版本

要安装库,你只需运行以下命令:

pip3 install -U qq.py

快速示例

from qq import *


class MyClient(Client):
    async def on_ready(self):
        print('使用', self.user, '登陆')

    async def on_message(self, message):
        # 不要回复自己
        if message.author == self.user:
            return

        if 'ping' in message.content:
            await message.channel.send('pong')


if __name__ == '__main__':
    client = MyClient(app_id='', token='')
    client.run()

当完成初始化输出当前机器人用户对象,收到带有 ping 的信息事件时发送 pong

链接

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qq.py-0.2.0.tar.gz (76.9 kB view hashes)

Uploaded Source

Built Distribution

qq.py-0.2.0-py3-none-any.whl (90.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page