Skip to main content

A Python SDK for QQ Bot.

Project description

cyan

Pipeline Status Python Version PyPI - License PyPI


简介

Cyan 是一个简单易用的 QQ 机器人 Python SDK,基于 Python 的类型注解和异步特性。

项目状态

项目目前处于测试阶段,这意味着 SDK 所提供的操作不稳定,不建议用于生产环境。

仓库

HuajiTech GitLab(主仓库):https://gitlab.huajitech.net/huajitech/cyan

GitHub:https://github.com/huajitech/cyan

特性

  • 异步操作:使用 httpxwebsockets 异步框架及 Python 的异步特性
  • 化繁为简:简化 API 繁琐的操作,使用户容易上手
  • 类型注释:SDK 100% 使用类型注解,通过 Pyright严格检查,用户可使用支持类型检查的 IDE 减少 Bug 出现的可能性
  • 支持扩展:SDK 开放与 API 交互的函数,用户可通过提供的函数与 API 交互,实现 SDK 未实现的功能

示例

from cyan import Session, Ticket
from cyan.event.events import ChannelMessageReceivedEvent
from cyan.model import Message

session = Session(
    "https://sandbox.api.sgroup.qq.com/",
    Ticket("{app_id}", "{token}")
)


@session.on(ChannelMessageReceivedEvent)
async def message_received(data: Message):
    await data.reply("收到消息:\n", data)

session.run()

更多

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

cyansdk-0.1.0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cyansdk-0.1.0-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file cyansdk-0.1.0.tar.gz.

File metadata

  • Download URL: cyansdk-0.1.0.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.10.0 Linux/5.11.0-49-generic

File hashes

Hashes for cyansdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c865ee0a9c9e0e228c4faca4ec609efa7f5945a3a692b31ef44049c35caed9e3
MD5 9e1ec9ed1ba33b61cfc21b7cc47bb3c0
BLAKE2b-256 127691fbb2484236c5a278e70be355572bda98ef363413a7fcdeb3e409594ea8

See more details on using hashes here.

File details

Details for the file cyansdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cyansdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.10.0 Linux/5.11.0-49-generic

File hashes

Hashes for cyansdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7410923877d1d128e1181af98f30fac8c0cd078dfe61712a6d28874fd4947edd
MD5 a4336c1c6080f1c58ab3c0ad32b60766
BLAKE2b-256 d7535a270cdfd80b9c5ad6b9c9ec02e0c0c9c6f794b2db5acfd61a8311c1bf33

See more details on using hashes here.

Supported by

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