Better cast

This commit is contained in:
Him188 2020-01-12 15:33:04 +08:00
parent eca68252a7
commit f238f7d092

View File

@ -73,8 +73,7 @@ internal object MemberJoinPacketHandler : KnownEventParserAndHandler<MemberJoinE
discardExact(1) // 01
val qq = bot.getQQ(readQQ())
val member = with(bot) {
this as? TIMPCBot ?: error("wrong Bot type passed")
val member = with(bot as? TIMPCBot ?: error("wrong Bot type passed")) {
group.Member(qq, MemberPermission.MEMBER)
}