转发消息构建问题
-
本意是想通过合并转发解决一次性往群里发送taid 图片导致的刷屏问题的,但是不知道是我转发消息的构建有问题还是腾讯的判断,只要一发送转发的消息机器人就被风控
这是第一次
这是第二次
下面是代码object MessageForwardHandler: AronaEventHandler<GroupTempMessageEvent> { override suspend fun handle(event: GroupTempMessageEvent) { var result = event.message if (result.contentToString() != "/转发") return val builder = ForwardMessageBuilder(event.subject) var targetEvent: GroupTempMessageEvent = event event.subject.sendMessage("请输入要整合的内容,输入\"停止\"结束整合") var count = 0 while (result.contentToString() != "停止") { builder.add(targetEvent) try { result = targetEvent.nextMessage(5000) { it.subject.sendMessage("第${++count}条消息") targetEvent = it true } } catch (_: Exception) { val chainBuilder = MessageChainBuilder() chainBuilder.add("停止") result = chainBuilder.build() event.subject.sendMessage("超时了,停止整合") } } event.subject.sendMessage(builder.build()) } }