Skip to main content

A framework for OICQ(QQ, made by Tencent) headless client "Mirai".

Project description

Mirai Framework Core for Python

Derived from Python-Mirai. If you decided to Star this project, please also Star the original project.

A Flask like Python wrapper of Mirai-HTTP-API

See full documentation here

Synced with mirai core 0.37.4

Installation

Install from PyPI

pip install python-mirai-core

Install from github

pip install git+git:://github.com/NatriumLab/python-mirai-core

TL; DR

See code completion generated by PyCharm or VSCode.

Fundamentals:

Bot and Updater are two object to interact with mirai-http-api.

Bot contains all outbound actions (such as send_group_message), all methods are well documented, and internal methods starts with _

Updater handles all inbound updates (such as receiving events or messages)

A list of available event is under mirai_core.models.events.EventTypes, and each event entity is under mirai_core.models.events, and shares the same name as EventTypes.

A list of available message components (to construct MessageChain) is under mirai_core.models.message.components.

Features

  • Updater handshake with mirai-console automatically when console is restarted or session is expired

  • Similar logic to python-telegram-bot or aiogram

  • Supports multiple listener for single event, use return True to block further calling for this event only

  • Supports Websocket (enabled by default)

  • Supports xml/json/app message

Example

Basic example: see demo folder.

Comprehensive example: see UMR

Thanks

Thanks mamoe brings us mirai, a tremendous work that enables boundless possibilities for QQ Bots.

License

GNU AGPLv3

Same as mirai

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

python-mirai-core-0.6.12.tar.gz (18.8 kB view details)

Uploaded Source

File details

Details for the file python-mirai-core-0.6.12.tar.gz.

File metadata

  • Download URL: python-mirai-core-0.6.12.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for python-mirai-core-0.6.12.tar.gz
Algorithm Hash digest
SHA256 c2089ec6b421b4c08c6050ef9bc35f14f19c4f95853e60206527a20a045b0f2a
MD5 2d0b86cfa77fb45b4f09f8972a58d353
BLAKE2b-256 9e3e3cd7dd2d10e1e49d354836532d0e3bc6ad0a5b84718b52c99584e887cd3f

See more details on using hashes here.

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