Tips~ If you are willing to join to develop this project, send email to me(
[email protected]
) ( ̄▽ ̄)"
please note:
-
MiraiCP is a C++ community SDK of Mirai which use
JNI
technique to connect the mirai-console or mirai-core. -
This project just using for studying only, and cannot use for commerce(open source according to AGPLv3 license agreement).
-
This project does not contain any malicious code designed to destroy user computer data and obtain user privacy, does not contain any tracking or monitoring user computer function code, does not collect any user personal information, and does not disclose user privacy.
-
This project does not provide any specific function implementation, only the encapsulating package of the project mirai-console and mirai-core (refer mirai).
-
Any unit or individual who believes that this project may be suspected of infringement should promptly provide feedback or issue. This project will promptly delete the illegal content and other related treatments.
Supporting events
You can see all this content inConfig.kt
Event description | method name |
---|---|
Group Message Event | GroupMessageEvent |
Friend Message Event | PrivateMessageEvent |
New Friend Request | NewFriendRequestEvent |
New Group Invite | GroupInviteEvent |
New group member join | MemberJoinEvent |
group member leave | MemberLeaveEvent |
Message recall | RecallEvent |
Timed out event(when the time of a registered time task out) | SchedulingEvent |
Example code example.md
Design flow chart of this project intro.md
The qq face that mirai supporting faces.md
mirai need openjdk instead of Oracle jdk as the runtime environment, such as download the openjdk15/openjdk11.
verison rule of MiraiCP: since v2.2.0 (2021/1/31), the first two characters of the version represent the version of Mirai used, and the last character represents the iterative version of this SDK update
-
因为JNIEnv是局部变量,不了解jni请勿在SDK中使用多线程,如果要使用多线程的话,要保存全局
JavaVM
变量然后在多线程开头使用genv = JavaVM.GetEnv()
覆盖全局Env,否则mirai部分可能无法成功调用,目前已添加定时计划的实现代码详见 -
Till now, this project is certainly can use under windowse environment, other enviornments are not tested, and theoretically, this project can be used in linux enviornment(just generate .so file in C++ IDE instead of .dll file).
-
If the C++ IDE report a error about the
jni.h
is missing, addcpp/include
dir into the library folder settings of C++ IDE(such asProject->Properties->C++->General
),cpp/include folder inculdes some dependent libraries of the project.
There are two ways to use this project(choose one in your opinion):
Show
- download the official plugin loader(mcl), url -> my backup or official url
- download the MiraiCP-Plugin.7z of the release and unzip
- copy the
.jar
file in the root of the package - open the .sln file in the
cpp
folder to open the C++ project - write your own code in
procession.cpp
- generate the .dll file
- copy the .dll file
- open the mcl folder(download in step 1)
- paste the
.jar
(in the step 2) into theplugin
folder in the mcl - run the mcl once, ignoring the repoting error in mcl and do not sign in(to generate the data folder in mcl).
- open the
data/miraiCP
path(the name may change) and paste the .dll file(in the step 6) ORpaste the .dll file in any path and create a file namedmiraicp.txt
indata/miraiCP
folder with the path of your .dll file path - run the mcl
Show
- download MiraiCP-Loader.7z in the release of this project
- open the .sln file in
cpp
folder to open the C++ project - in
procession.cpp
file write your code - generate .dll file
- copy the
.dll
file incpp/x64/Release/
orcpp/x64/Debug
- change the code in
run.bat
in format [qq number, password, path of .dll(in step 5 and absolute path or relative path can be used),1 or 0(optional, represent the loader will check of new version or not)], such asjava -jar MiraiCP-Loader.jar 111 aaa D:\temp\mirai-demo.dll 1
- run the run.bat
If there are other problems, you are welcome to submit issue or pullrequest in this project.
- download new release
- copy the new
.mirai.jar
plugin file or.jar
loader file over the older one - Copy all the individual files in the
cpp
folder from the new release (json and include folders are not required), mainlypch.h
(precompiled header file),pch.cpp
(dll entry point),tools.h
(various events and object class declarations),tools.cpp
(implementation of declarations in tools.h), andconstants.h
(constant table) overwrite the older ones.
see the milestones of this project
Copyright (C) 2020-2021 Eritque arcus and contributors.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or any later version(in your opinion).
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.