mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-31 11:50:09 +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(
|
override fun constructMessageSource(
|
||||||
botId: Long,
|
botId: Long,
|
||||||
kind: MessageSourceKind,
|
kind: MessageSourceKind,
|
||||||
|
Loading…
Reference in New Issue
Block a user