Dituon / petpet

根据模板生成图像
http://d2n.moe/petpet/
GNU Affero General Public License v3.0
310 stars 81 forks source link

[建议]支持使用图片等形式发送keylist #104

Closed sitherx closed 10 months ago

sitherx commented 11 months ago

因petdata越来越多导致发送pet返回keylist时报错,提示消息过长无法发送 建议支持使用图片或分多条消息合并转发等方式发送keylist,防止(在可见的将来)petdata过多发不了keylist的情况

不会提pr所以做的petdata没发上来这是可以说的吗

另报错如下: 2023-12-08 14:20:46 W/Bot.xxxxxxx: An exception occurred when processing event. Subscriber scope: ''. Broadcaster scope: 'Bot 3121782370.EventDispatcher' net.mamoe.mirai.contact.MessageTooLargeException: message(Petpet KeyList:

gluing ( 打胶 ) need ( 需要 ) scratch_head ( 挠头 ) yamero ( yamero 那种事情 ) center_symmet...) is too large. Allow up to 50 images or 5000 chars at net.mamoe.mirai.internal.message.protocol.outgoing.OutgoingMessagePipelineContext.verifyLength(OutgoingMessagePipeline.kt:99) at net.mamoe.mirai.internal.message.protocol.impl.ForwardMessageProtocol$ForwardMessageUploader.process(ForwardMessageProtocol.kt:45) at net.mamoe.mirai.internal.message.protocol.outgoing.OutgoingMessageProcessorAdapter.process(OutgoingMessagePipelineProcessor.kt:26) at net.mamoe.mirai.internal.message.protocol.outgoing.OutgoingMessageProcessorAdapter.process(OutgoingMessagePipelineProcessor.kt:20) at net.mamoe.mirai.internal.pipeline.AbstractProcessorPipeline.process$suspendImpl(ProcessorPipeline.kt:287) at net.mamoe.mirai.internal.pipeline.AbstractProcessorPipeline.process(ProcessorPipeline.kt) at net.mamoe.mirai.internal.pipeline.AbstractProcessorPipeline.process$suspendImpl(ProcessorPipeline.kt:275) at net.mamoe.mirai.internal.pipeline.AbstractProcessorPipeline.process(ProcessorPipeline.kt) at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacadeImpl.preprocessAndSendOutgoingImpl(MessageProtocolFacade.kt:361) at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacadeImpl.preprocessAndSendOutgoing(MessageProtocolFacade.kt:348) at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacade$INSTANCE.preprocessAndSendOutgoing(MessageProtocolFacade.kt) at net.mamoe.mirai.internal.contact.AbstractUserKt.sendMessageImpl(AbstractUser.kt:263) at net.mamoe.mirai.internal.contact.CommonGroupImpl.sendMessage$suspendImpl(GroupImpl.kt:221) at net.mamoe.mirai.internal.contact.CommonGroupImpl.sendMessage(GroupImpl.kt) at net.mamoe.mirai.contact.Group$sendMessage$1.invoke(Group.kt) at net.mamoe.mirai.contact.Group$sendMessage$1.invoke(Group.kt) at kotlin.coroutines.intrinsics.IntrinsicsKtIntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKtIntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:205) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115) at me.him188.kotlin.jvm.blocking.bridge.internal.RunSuspendKt.$runSuspend$(RunSuspend.kt:18) at net.mamoe.mirai.contact.Group.sendMessage(Group.kt) at petpet-6.1.mirai2.jar//moe.dituon.petpet.mirai.MiraiPetpet.sendKeyList(MiraiPetpet.java:458) at petpet-6.1.mirai2.jar//moe.dituon.petpet.mirai.MiraiPetpet.responseMessage(MiraiPetpet.java:190) at petpet-6.1.mirai2.jar//moe.dituon.petpet.mirai.MiraiPetpet.onGroupMessage(MiraiPetpet.java:158) at net.mamoe.mirai.event.EventChannel$subscribeAlways$2$1.invoke(EventChannel.kt:605) at net.mamoe.mirai.event.EventChannel$subscribeAlways$2$1.invoke(EventChannel.kt:605) at kotlinx.coroutines.InterruptibleKt.runInterruptibleInExpectedContext(Interruptible.kt:51) at kotlinx.coroutines.InterruptibleKt.access$runInterruptibleInExpectedContext(Interruptible.kt:1) at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invokeSuspend(Interruptible.kt:43) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Dituon commented 10 months ago

详见插件的 keyListFormat 配置项 https://github.com/Dituon/petpet?tab=readme-ov-file#%E9%85%8D%E7%BD%AE%E9%A1%B9%E8%AF%B4%E6%98%8E