Commit c7ab173a authored by Him188's avatar Him188

Add bug report hints

parent d7ab2c1b
......@@ -27,11 +27,13 @@ import net.mamoe.mirai.qqandroid.QQAndroidBot
import net.mamoe.mirai.qqandroid.contact.GroupImpl
import net.mamoe.mirai.qqandroid.contact.MemberImpl
import net.mamoe.mirai.qqandroid.contact.checkIsMemberImpl
import net.mamoe.mirai.qqandroid.message.contextualBugReportException
import net.mamoe.mirai.qqandroid.network.Packet
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.OnlinePushTrans
import net.mamoe.mirai.qqandroid.network.protocol.packet.IncomingPacketFactory
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import net.mamoe.mirai.qqandroid.network.protocol.packet.buildResponseUniPacket
import net.mamoe.mirai.qqandroid.utils._miraiContentToString
import net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.qqandroid.utils.read
......@@ -131,6 +133,14 @@ internal object OnlinePushPbPushTransMsg :
}
}
}
else -> {
throw contextualBugReportException(
"解析 OnlinePush.PbPushTransMsg, msgType=${content.msgType}",
content._miraiContentToString(),
null,
"并描述此时机器人是否被踢出, 或是否有成员列表变更等动作."
)
}
}
}
return null
......
......@@ -390,6 +390,7 @@ internal object Transformers528 : Map<Long, Lambda528> by mapOf(
},
// bot 在其他客户端被踢或主动退出而同步情况
0xD4L to lambda528 { bot ->
// this.soutv("0x210")
@Serializable
data class SubD4(
// ok
......
......@@ -149,6 +149,12 @@ private fun Any.canBeIgnored(): Boolean {
is ByteArray -> this.isEmpty()
is Array<*> -> this.isEmpty()
is Number -> this == 0
is Int -> this == 0
is Float -> this == 0
is Double -> this == 0
is Byte -> this == 0
is Short -> this == 0
is Long -> this == 0
else -> false
}
}
......
......@@ -12,6 +12,8 @@
package net.mamoe.mirai.contact
import net.mamoe.mirai.message.data.Message
import net.mamoe.mirai.utils.asHumanReadable
import kotlin.time.seconds
/**
* 发送消息时消息过长抛出的异常.
......@@ -38,6 +40,6 @@ class MessageTooLargeException(
*/
class BotIsBeingMutedException(
val target: Group
) : RuntimeException("bot is being muted, remaining ${target.botMuteRemaining} seconds")
) : RuntimeException("bot is being muted, remaining ${target.botMuteRemaining.seconds.asHumanReadable} seconds")
inline val BotIsBeingMutedException.botMuteRemaining: Int get() = target.botMuteRemaining
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment