LangBot icon indicating copy to clipboard operation
LangBot copied to clipboard

[Bug]: 企业微信图文消息集合只能发送第一个消息后续的消息报错MSG_ID重复

Open kotoSky opened this issue 3 months ago • 3 comments

运行环境

v4.3.3、Windows11 python3.10.18、远程主机docker

异常情况

消息集合:[Plain('xxx'), Image(url='xxx.jpg'), Plain('xxx'), Image(url='xxx.jpg')] 代码: `

class DefaultEventListener(EventListener):

async def initialize(self):
    await super().initialize()

     # 匹配图片 URL 的正则表达式
    self.image_pattern = re.compile(r'!\[.*?\]\((https?://\S+)\)')
    
    "Fill with your code here"
    @self.handler(events.NormalMessageResponded)
    async def handler(event_context: context.EventContext):
        print("Hello LangBot Plugin!")
        print(event_context.event.launcher_type)
        print(event_context.event.launcher_id)
        bot_id = await event_context.get_bot_uuid()
        print(bot_id)

        optimized_message = await self.convert_message(event_context.event.response_text)

        print(optimized_message)

        await event_context.reply(
            MessageChain(optimized_message)
        )
        await self.plugin.send_message(
            bot_uuid=bot_id,
            target_type=event_context.event.launcher_type,
            target_id=event_context.event.launcher_id,
            message_chain=MessageChain(optimized_message),
        )`

复现步骤

No response

启用的插件

No response

问题

使用event_context.reply只能发送第一条消息,文本可以正常发送 图片是空白的消息, 第一条后的消息报错提示msg_id重复 使用plugin.send_message不生效 默认返回未处理文本给企微

kotoSky avatar Sep 25 '25 02:09 kotoSky

企业微信自建应用吗?

wangcham avatar Sep 25 '25 12:09 wangcham

企业微信自建应用吗?

是的 自建应用

kotoSky avatar Sep 25 '25 14:09 kotoSky

我在qq机器人这边也遇到了,好像是平台限制,同一个msg_id只能回复一条消息

PengfeiMiaoTD avatar Nov 06 '25 07:11 PengfeiMiaoTD