Skip to main content

帮助QBot新手开发者快速构建简单的QQ机器人

Project description

easyMirai

介绍本项目的注意事项&主体结构

注意本项目基于开源软件 Mirai 进行二次开发

本项目地址: easyMirai

目录

  1. 案例
  2. 调用
  3. 声明

案例

这是一个简单的调用例子,实现了复读机的功能

from easyMirai import http as em

if __name__ == '__main__':
    mirai = em.Mirai("YouHost", "YouPort", "YouKey", "YouQid")
    print(mirai.begin())
    while True:
        mirai.delay()
        if mirai.getCountMessage()['data'] != 0:
            message = mirai.getFetchLatestMessageFormat()
            if message['From'] == "FriendMessage":
                msg = {'type': 'Plain', "text": message['Plain'][0]}
                mirai.sendFriendMessage(msg, message['Sender'])

更多案例请查阅 Example 目录,我们将持续更新相关案例,以方便调用!

⬆ back to top

调用

关于调用问题一定要实例化后进行对于数据的操作!

# bad
if mirai.getFetchLatestMessageFormat() == "text":
    ...

# good
message = mirai.getFetchLatestMessageFormat()
if message == "text":
    ...

⬆ back to top

声明

本项目基于开源软件 Mirai 进行二次开发

不得扭曲或隐藏免费且开源的事实

本项目使用AGPLv3

此项目创建于2022.05.15,如果出现开发程序上的各种问题欢迎在issues发布!

⬆ back to top

easyMirai@ExMikuPro

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

easyMirai-1.18.39.tar.gz (23.1 kB view hashes)

Uploaded Source

Built Distribution

easyMirai-1.18.39-py2.py3-none-any.whl (20.6 kB view hashes)

Uploaded Python 2 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