plugin supporting

This commit is contained in:
jiahua.liu 2020-01-18 18:44:03 +08:00
parent d67a858548
commit 6e33ddf296
4 changed files with 47 additions and 30 deletions

View File

@ -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
}

View 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)
}
}
}
}
}
}
}

View File

@ -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);
}
}

View File

@ -1,10 +0,0 @@
package net.mamoe.mirai;
/**
* @author NaturalHG
*/
public final class MiraiMain {
public static void main(String[] args) {
}
}