mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-05 23:50:08 +08:00
Optimized IMirai.getUin()
This commit is contained in:
parent
98bca6ae44
commit
fc8fd70014
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user