帮助QBot新手开发者快速构建简单的QQ机器人
Project description
easyMirai
介绍本项目的注意事项&主体结构
注意本项目基于开源软件 Mirai 进行二次开发
本项目地址: easyMirai
目录
案例
这是一个简单的调用例子,实现了复读机的功能
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 目录,我们将持续更新相关案例,以方便调用!
调用
关于调用问题一定要实例化后进行对于数据的操作!
# bad
if mirai.getFetchLatestMessageFormat() == "text":
...
# good
message = mirai.getFetchLatestMessageFormat()
if message == "text":
...
声明
本项目基于开源软件 Mirai 进行二次开发
不得扭曲或隐藏免费且开源的事实
本项目使用AGPLv3
此项目创建于2022.05.15,如果出现开发程序上的各种问题欢迎在issues发布!
easyMirai@ExMikuPro
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for easyMirai-1.18.39-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8622c0af7155154fc5313c2c9aa580217d6538e2a92abf15798c2e92b8207b7 |
|
MD5 | 63bccf69fddb941d1332251bed31a3a9 |
|
BLAKE2b-256 | 65650c8128c892e3e684ef3f729bbb2df1cc79376d4c0b76132156264e3ad536 |