mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 23:20:09 +08:00
Query self profile when missing nickname; Fix #1023
This commit is contained in:
parent
ce06ce85f0
commit
f12f78a55f
@ -292,13 +292,12 @@ internal abstract class AbstractBot<N : BotNetworkHandler> constructor(
|
|||||||
|
|
||||||
// https://github.com/mamoe/mirai/issues/1019
|
// https://github.com/mamoe/mirai/issues/1019
|
||||||
kotlin.runCatching {
|
kotlin.runCatching {
|
||||||
nick
|
bot.nick
|
||||||
}.onFailure {
|
}.onFailure {
|
||||||
throw contextualBugReportException(
|
bot.asQQAndroidBot().nick = MiraiImpl.queryProfile(bot, bot.id).nickname
|
||||||
context = "Bot login",
|
if (bot.nick.isBlank()) {
|
||||||
forDebug = it.toString(),
|
logger.warning { "Unable to fetch nickname of bot." }
|
||||||
e = it,
|
}
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info { "Login successful" }
|
logger.info { "Login successful" }
|
||||||
|
Loading…
Reference in New Issue
Block a user