mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-21 07:29:13 +08:00
plugin supporting
This commit is contained in:
parent
4f82703703
commit
8ada62d748
4
mirai-console/README.MD
Normal file
4
mirai-console/README.MD
Normal file
@ -0,0 +1,4 @@
|
||||
### Mirai Console
|
||||
#### Mirai Console allows you to run Mirai in command lines.
|
||||
#### More Importantly, Mirai Console support <b>Plugins</b>
|
||||
|
@ -1,5 +1,4 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user