mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 23:20:09 +08:00
Adjust name
This commit is contained in:
parent
a7e9b151e4
commit
e7a691dc4c
@ -370,7 +370,7 @@ internal abstract class QQAndroidBotBase constructor(
|
|||||||
@MiraiExperimentalAPI
|
@MiraiExperimentalAPI
|
||||||
override suspend fun _lowLevelSendLongMessage(groupCode: Long, message: Message) {
|
override suspend fun _lowLevelSendLongMessage(groupCode: Long, message: Message) {
|
||||||
val chain = message.asMessageChain()
|
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 group = getGroup(groupCode)
|
||||||
|
|
||||||
val source = MessageSourceFromSendFriend(
|
val source = MessageSourceFromSendFriend(
|
||||||
@ -385,7 +385,7 @@ internal abstract class QQAndroidBotBase constructor(
|
|||||||
)
|
)
|
||||||
|
|
||||||
// TODO: 2020/3/26 util 方法来添加单例元素
|
// TODO: 2020/3/26 util 方法来添加单例元素
|
||||||
val toSend = buildMessageChain(chain) {
|
val toSend = buildMessageChain(chain.size) {
|
||||||
source.originalMessage.forEach {
|
source.originalMessage.forEach {
|
||||||
if (it !is MessageSource) {
|
if (it !is MessageSource) {
|
||||||
add(it)
|
add(it)
|
||||||
@ -398,7 +398,7 @@ internal abstract class QQAndroidBotBase constructor(
|
|||||||
val data = toSend.calculateValidationDataForGroup(group)
|
val data = toSend.calculateValidationDataForGroup(group)
|
||||||
|
|
||||||
val response =
|
val response =
|
||||||
MultiMsg.ApplyUp.createForLongMessage(
|
MultiMsg.ApplyUp.createForGroupLongMessage(
|
||||||
client = this@QQAndroidBotBase.client,
|
client = this@QQAndroidBotBase.client,
|
||||||
messageData = data,
|
messageData = data,
|
||||||
dstUin = Group.calculateGroupUinByGroupCode(groupCode)
|
dstUin = Group.calculateGroupUinByGroupCode(groupCode)
|
||||||
@ -446,7 +446,7 @@ internal abstract class QQAndroidBotBase constructor(
|
|||||||
|
|
||||||
group.sendMessage(
|
group.sendMessage(
|
||||||
RichMessage.longMessage(
|
RichMessage.longMessage(
|
||||||
brief = toSend.joinToString {
|
brief = toSend.joinToString(limit = 30) {
|
||||||
when (it) {
|
when (it) {
|
||||||
is PlainText -> it.stringValue
|
is PlainText -> it.stringValue
|
||||||
is At -> it.toString()
|
is At -> it.toString()
|
||||||
@ -457,8 +457,6 @@ internal abstract class QQAndroidBotBase constructor(
|
|||||||
timeSeconds = source.time
|
timeSeconds = source.time
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
println(response._miraiContentToString())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ internal class MultiMsg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// captured from group
|
// captured from group
|
||||||
fun createForLongMessage(
|
fun createForGroupLongMessage(
|
||||||
client: QQAndroidClient,
|
client: QQAndroidClient,
|
||||||
messageData: MessageValidationData,
|
messageData: MessageValidationData,
|
||||||
dstUin: Long // group uin
|
dstUin: Long // group uin
|
||||||
|
Loading…
Reference in New Issue
Block a user