Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
4dc6c3bf
Commit
4dc6c3bf
authored
Jan 19, 2020
by
Him188
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
fbf5f63c
6608df40
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
4 deletions
+64
-4
README.md
README.md
+4
-0
mirai-console/README.MD
mirai-console/README.MD
+52
-0
mirai-console/src/main/kotlin/MiraiConsole.kt
mirai-console/src/main/kotlin/MiraiConsole.kt
+8
-4
mirai-plugins/image-sender/artifact/mirai-plugin-image-sender.jar
...ugins/image-sender/artifact/mirai-plugin-image-sender.jar
+0
-0
No files found.
README.md
View file @
4dc6c3bf
...
...
@@ -28,6 +28,10 @@
您的 star 是对我们最大的鼓励(点击项目右上角);
## Use directly
**直接使用Mirai(终端环境/网页面板).**
[
Mirai-Console
](
https://github.com/mamoe/mirai/tree/master/mirai-console
)
插件支持, 在终端中启动Mirai并获得机器人服务
## Use as a library
**把 Mirai 作为库内置于您的项目中使用.**
Mirai 只上传在
`jcenter`
, 因此请确保在
`build.gradle`
添加
`jcenter()`
仓库
...
...
mirai-console/README.MD
0 → 100644
View file @
4dc6c3bf
# Mirai Console
#### Mirai Console allows you to run Mirai in command lines/terminal.
#### 你可以终端中或命令行环境下运行在Mirai
<br>
#### More Importantly, Mirai Console support <b>Plugins</b>, tells the bot what to do
#### Mirai Console 支持插件系统, 你可以自己开发或使用公开的插件来逻辑化机器人, 如群管
<br>
#### download 下载
#### how to get/write plugins 如何获取/写插件
<br>
<br>
### how to use(如何使用)
#### how to run Mirai Console
<ul>
<li>
download mirai-console.jar
</li>
<li>
open command line/terminal
</li>
<li>
create a folder and put mirai-console.jar in
</li>
<li>
cd that folder
</li>
<li>
"java -jar mirai-console.jar"
</li>
</ul>
<ul>
<li>
下载mirai-console.jar
</li>
<li>
打开终端
</li>
<li>
在任何地方创建一个文件夹, 并放入mirai-console.jar
</li>
<li>
在终端中打开该文件夹"cd"
</li>
<li>
输入"java -jar mirai-console.jar"
</li>
</ul>
#### how to add plugins
<ul>
<li>
After first time of running mirai console
</li>
<li>
/plugins/folder will be created next to mirai-console.jar
</li>
<li>
put plugin(.jar) into /plugins/
</li>
<li>
restart mirai console
</li>
<li>
checking logger and check if the plugin is loaded successfully
</li>
<li>
if the plugin has it own Config file, it normally appears in /plugins/{pluginName}/
</li>
</ul>
<ul>
<li>
在首次运行mirai console后
</li>
<li>
mirai-console.jar 的同级会出现/plugins/文件夹
</li>
<li>
将插件(.jar)放入/plugins/文件夹
</li>
<li>
重启mirai console
</li>
<li>
在开启后检查日志, 是否成功加载
</li>
<li>
如该插件有配置文件, 配置文件一般会创建在/plugins/插件名字/ 文件夹下
</li>
</ul>
mirai-console/src/main/kotlin/MiraiConsole.kt
View file @
4dc6c3bf
import
kotlinx.coroutines.GlobalScope
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.runBlocking
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.alsoLogin
import
net.mamoe.mirai.plugin.PluginManager
...
...
@@ -40,8 +39,13 @@ tailrec fun processNextCommandLine() {
val
qqNumber
=
commandArgs
[
1
].
toLong
()
val
qqPassword
=
commandArgs
[
2
]
println
(
"login..."
)
GlobalScope
.
launch
{
Bot
(
qqNumber
,
qqPassword
).
alsoLogin
()
runBlocking
{
try
{
Bot
(
qqNumber
,
qqPassword
).
alsoLogin
()
}
catch
(
e
:
Exception
)
{
println
(
"login failed"
)
}
}
}
}
...
...
mirai-plugins/image-sender/artifact/mirai-plugin-image-sender.jar
View file @
4dc6c3bf
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment