帮助QBot开发新手者快速构建简单的QQ机器人
Project description
easyMirai
介绍本项目的注意事项&主体结构
注意本项目基于开源软件 Mirai 进行二次开发
本项目地址: easyMirai
目录
案例
这是一个简单的调用例子,实现了复读机的功能
from easyMirai import haip 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.15.39.tar.gz
(8.0 kB
view hashes)
Built Distribution
Close
Hashes for easyMirai-1.15.39-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f27cc0a244464e61c3623de83142c911655df110d95230f81969c9fa4d5969 |
|
MD5 | 6db6372efcf6447178541a1c3244f966 |
|
BLAKE2b-256 | 8296175de8a48b887cd0cf66553b765856f6f07d74922cb357fa501ee3d98bb6 |