Skip to main content

A Python SDK with async I/O based on mirai-api-http.

Project description

miraicle

PyPI - Python Version PyPI PyPI - License

一个基于 mirai-api-http 的轻量级 Python SDK

安装

pip install miraicle

示例

import miraicle


@miraicle.Mirai.receiver('GroupMessage')
def hello_to_group(bot: miraicle.Mirai, msg: miraicle.GroupMessage):
    bot.send_group_msg(group=msg.group, msg='Hello world!')


@miraicle.Mirai.receiver('FriendMessage')
def hello_to_friend(bot: miraicle.Mirai, msg: miraicle.FriendMessage):
    bot.send_friend_msg(qq=msg.sender, msg='Hello world!')


qq = 123456789              # 你登陆的机器人 QQ 号
verify_key = 'miraicle'     # 你在 setting.yml 中设置的 verifyKey
port = 8080                 # 你在 setting.yml 中设置的 port (http)

bot = miraicle.Mirai(qq=qq, verify_key=verify_key, port=port)
bot.run()

如果你想获得更多信息,可以查阅 miraicle 的 文档

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

miraicle-0.3.5.tar.gz (15.3 kB view details)

Uploaded Source

File details

Details for the file miraicle-0.3.5.tar.gz.

File metadata

  • Download URL: miraicle-0.3.5.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.8

File hashes

Hashes for miraicle-0.3.5.tar.gz
Algorithm Hash digest
SHA256 fdd90fef71f9ee7581a54f89e48443ff6d5d3cd06e6b29005de7065e0c340412
MD5 79b2c30a1f93c372c26653339fd4dfc8
BLAKE2b-256 5206e04165e4162f3e73ab27f03e564009fe15d83360de1e2c8c3e709eaaeca1

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