mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-22 13:46:13 +08:00
plugin supporting
This commit is contained in:
parent
d67a858548
commit
6e33ddf296
@ -3,6 +3,7 @@ apply plugin: "java"
|
||||
|
||||
dependencies {
|
||||
api project(':mirai-core')
|
||||
api project(':mirai-core-timpc')
|
||||
runtimeOnly files('../mirai-core/build/classes/kotlin/jvm/main')
|
||||
// classpath is not set correctly by IDE
|
||||
}
|
||||
|
46
mirai-console/src/main/kotlin/MiraiConsole.kt
Normal file
46
mirai-console/src/main/kotlin/MiraiConsole.kt
Normal file
@ -0,0 +1,46 @@
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import net.mamoe.mirai.Bot
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun main() {
|
||||
|
||||
println("loading Mirai in console environments")
|
||||
println("正在控制台环境中启动Mirai ")
|
||||
println()
|
||||
println("Mirai-console is still in testing stage, some feature is not available")
|
||||
println("Mirai-console 还处于测试阶段, 部分功能不可用")
|
||||
println()
|
||||
println("Mirai-console now running on " + System.getProperty("user.dir"))
|
||||
println("Mirai-console 正在 " + System.getProperty("user.dir") + " 运行")
|
||||
println()
|
||||
println("\"login qqnumber qqpassword \" to login a bot")
|
||||
println("\"login qq号 qq密码 \" 来登陆一个BOT")
|
||||
|
||||
thread {
|
||||
loop@ while (true) {
|
||||
var command = readLine()
|
||||
if (command != null) {
|
||||
var commandArgs = command.split(" ")
|
||||
when (commandArgs[0]) {
|
||||
"login" -> {
|
||||
if (commandArgs.size < 3) {
|
||||
println("\"login qqnumber qqpassword \" to login a bot")
|
||||
println("\"login qq号 qq密码 \" 来登陆一个BOT")
|
||||
continue@loop
|
||||
}
|
||||
val qqNumber = commandArgs[1].toLong()
|
||||
val qqPassword = commandArgs[2]
|
||||
println("login...")
|
||||
GlobalScope.launch {
|
||||
Bot(qqNumber, qqPassword)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,20 +0,0 @@
|
||||
package net.mamoe.mirai;
|
||||
|
||||
public class MiraiConsole {
|
||||
|
||||
|
||||
public static void main(String[] args){
|
||||
System.out.println(">>> starting Mirai");
|
||||
// MiraiAPI.startMirai(args);
|
||||
}
|
||||
|
||||
public static void processCommand(String command){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void log(Object o){
|
||||
System.out.println(o);
|
||||
}
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package net.mamoe.mirai;
|
||||
|
||||
|
||||
/**
|
||||
* @author NaturalHG
|
||||
*/
|
||||
public final class MiraiMain {
|
||||
public static void main(String[] args) {
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user