mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-20 16:39:22 +08:00
Fix inappropriate blocking method call
This commit is contained in:
parent
a85c8cac05
commit
08bdf82125
@ -130,37 +130,35 @@ object MiraiConsole {
|
||||
val qqPassword = it[1]
|
||||
logger("[Bot Login]", 0, "login...")
|
||||
try {
|
||||
runBlocking {
|
||||
frontEnd.prePushBot(qqNumber)
|
||||
val bot = Bot(qqNumber, qqPassword) {
|
||||
this.loginSolver = frontEnd.createLoginSolver()
|
||||
this.botLoggerSupplier = {
|
||||
SimpleLogger("BOT $qqNumber]") { _, message, e ->
|
||||
logger("[BOT $qqNumber]", qqNumber, message)
|
||||
if (e != null) {
|
||||
logger("[NETWORK ERROR]", qqNumber, e.toString())//因为在一页 所以可以不打QQ
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
this.networkLoggerSupplier = {
|
||||
SimpleLogger("BOT $qqNumber") { _, message, e ->
|
||||
logger("[NETWORK]", qqNumber, message)//因为在一页 所以可以不打QQ
|
||||
if (e != null) {
|
||||
logger("[NETWORK ERROR]", qqNumber, e.toString())//因为在一页 所以可以不打QQ
|
||||
e.printStackTrace()
|
||||
}
|
||||
frontEnd.prePushBot(qqNumber)
|
||||
val bot = Bot(qqNumber, qqPassword) {
|
||||
this.loginSolver = frontEnd.createLoginSolver()
|
||||
this.botLoggerSupplier = {
|
||||
SimpleLogger("BOT $qqNumber]") { _, message, e ->
|
||||
logger("[BOT $qqNumber]", qqNumber, message)
|
||||
if (e != null) {
|
||||
logger("[NETWORK ERROR]", qqNumber, e.toString())//因为在一页 所以可以不打QQ
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
this.networkLoggerSupplier = {
|
||||
SimpleLogger("BOT $qqNumber") { _, message, e ->
|
||||
logger("[NETWORK]", qqNumber, message)//因为在一页 所以可以不打QQ
|
||||
if (e != null) {
|
||||
logger("[NETWORK ERROR]", qqNumber, e.toString())//因为在一页 所以可以不打QQ
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
bot.login()
|
||||
logger(
|
||||
"[Bot Login]",
|
||||
0,
|
||||
"$qqNumber login successes"
|
||||
)
|
||||
frontEnd.pushBot(bot)
|
||||
}
|
||||
bot.login()
|
||||
logger(
|
||||
"[Bot Login]",
|
||||
0,
|
||||
"$qqNumber login successes"
|
||||
)
|
||||
frontEnd.pushBot(bot)
|
||||
} catch (e: Exception) {
|
||||
logger(
|
||||
"[Bot Login]",
|
||||
|
Loading…
Reference in New Issue
Block a user