Adjust name

This commit is contained in:
Him188 2020-03-29 02:33:37 +08:00
parent a7e9b151e4
commit e7a691dc4c
2 changed files with 6 additions and 8 deletions

View File

@ -370,7 +370,7 @@ internal abstract class QQAndroidBotBase constructor(
@MiraiExperimentalAPI
override suspend fun _lowLevelSendLongMessage(groupCode: Long, message: Message) {
val chain = message.asMessageChain()
check(chain.toString().length <= 3000 && chain.count { it is Image } <= 10) { "message is too large" }
check(chain.toString().length <= 4500 && chain.count { it is Image } <= 50) { "message is too large" }
val group = getGroup(groupCode)
val source = MessageSourceFromSendFriend(
@ -385,7 +385,7 @@ internal abstract class QQAndroidBotBase constructor(
)
// TODO: 2020/3/26 util 方法来添加单例元素
val toSend = buildMessageChain(chain) {
val toSend = buildMessageChain(chain.size) {
source.originalMessage.forEach {
if (it !is MessageSource) {
add(it)
@ -398,7 +398,7 @@ internal abstract class QQAndroidBotBase constructor(
val data = toSend.calculateValidationDataForGroup(group)
val response =
MultiMsg.ApplyUp.createForLongMessage(
MultiMsg.ApplyUp.createForGroupLongMessage(
client = this@QQAndroidBotBase.client,
messageData = data,
dstUin = Group.calculateGroupUinByGroupCode(groupCode)
@ -446,7 +446,7 @@ internal abstract class QQAndroidBotBase constructor(
group.sendMessage(
RichMessage.longMessage(
brief = toSend.joinToString {
brief = toSend.joinToString(limit = 30) {
when (it) {
is PlainText -> it.stringValue
is At -> it.toString()
@ -457,8 +457,6 @@ internal abstract class QQAndroidBotBase constructor(
timeSeconds = source.time
)
)
println(response._miraiContentToString())
}
}

View File

@ -177,7 +177,7 @@ internal class MultiMsg {
}
// captured from group
fun createForLongMessage(
fun createForGroupLongMessage(
client: QQAndroidClient,
messageData: MessageValidationData,
dstUin: Long // group uin