Optimized IMirai.getUin()

This commit is contained in:
Karlatemp 2021-08-20 01:15:16 +08:00
parent 98bca6ae44
commit fc8fd70014
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8

View File

@ -861,6 +861,15 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
}
}
override fun getUin(contactOrBot: ContactOrBot): Long {
return when (contactOrBot) {
is Group -> contactOrBot.uin
is User -> contactOrBot.uin
is Bot -> contactOrBot.uin
else -> contactOrBot.id
}
}
override fun constructMessageSource(
botId: Long,
kind: MessageSourceKind,