Nodes/comfyui_LLM_party/Feishu Bot Read Group History🐶
ComfyUI Node

Feishu Bot Read Group History🐶

Poll a chat for new messages and know what type each one is

By heshengtao·Created 2 years ago·Updated 7 days ago· 2,321
Feishu Bot Read Group History🐶
    • response
    • log_info
    • message_id
    • output_is_text
    • output_is_audio
    • output_is_image
    • show_help
    app_id
    app_secret
    chat_id
    modeauto
    time_diff_sec60

    This is the listening half of building a Feishu bot in this pack - the node that answers "what did people just say in this chat." Feed it a chat, get back the recent activity plus, usefully, a set of booleans telling you what kind of content actually came in, so the rest of your workflow can branch without having to sniff the response itself.

    What it does

    app_id/app_secret authenticate against Feishu's API the same way the rest of this pack's bot nodes do - a registered app, not a webhook token. chat_id picks which group's history you're reading. mode controls how "recent" is defined: auto (the default) is built for a workflow that runs repeatedly and wants each run to pick up only what's new since last time. fixed_time_diff is the simpler alternative - instead of tracking state between runs, it just looks back a fixed window, set by time_diff_sec (default 60 seconds), every time it's called. fixed_time_diff is the one to reach for if you'd rather reason about a plain, stateless "give me the last N seconds" query than trust an auto-tracking mechanism you can't directly inspect.

    The outputs are where this node earns its category as more than a raw API wrapper: alongside response (the message content) and message_id (so you can pass a specific message on to a download node), it returns output_is_text, output_is_audio, and output_is_image - three booleans that tell a downstream branch exactly what showed up, without your workflow needing its own logic to inspect the raw response and guess. If output_is_audio comes back true, route message_id straight into this pack's FeishuDownloadAudio node next; same pattern for image. log_info and show_help round out the outputs - diagnostic and usage-reference text respectively, a pattern this pack repeats across its Feishu and Gitee nodes.

    Where it fits

    Pair this at the start of a bot workflow, with FeishuDownloadAudio/FeishuDownloadImage handling whichever attachment type the booleans indicate, your LLM logic doing the actual thinking, and FeishuSendMsg sending the reply. This node is specifically what makes "the same workflow needs to handle a text question, a voice message, or a shared image, and branch differently for each" tractable without hand-rolled type detection.

    Installing it

    Standard pack install:

    • ComfyUI Manager: search "comfyui_LLM_party", install, restart.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/heshengtao/comfyui_LLM_party, then pip install -r requirements.txt from inside the pack folder using ComfyUI's Python, then restart.

    You'll also need a registered Feishu app with permission to read the target chat's message history - that's a Feishu Open Platform console step, separate from installing this node, and app_id/app_secret come from there.

    Common issues & troubleshooting

    Getting nothing back, or the same messages repeatedly. If you're on mode: auto and running this node on a schedule, make sure whatever's tracking "since last time" state is actually persisting between runs the way you expect - if that state resets (a workflow reload, a changed chat_id), you'll either get an empty response or, in the other direction, the same history again. fixed_time_diff sidesteps this entirely if you don't need exactly-once delivery and would rather just poll a fixed window.

    Auth failures. Same story as this pack's other Feishu bot nodes - check app_id/app_secret are correct and that the app has been granted permission to read messages in the target chat, not just been added to it.

    Empty chat_id or wrong chat. chat_id has to be Feishu's own chat identifier for the specific group, not a display name - if you're not sure where to get it, it typically comes from Feishu's own API/console tooling or from a message event payload if your app is also receiving webhooks.

    Category大模型派对(llm_party)/APP链接(app link)

    Inputs (5)

    NameTypeDefaultDescription
    app_idSTRING
    app_secretSTRING
    chat_idSTRING
    modeCOMBOauto2 options: auto, fixed_time_diff
    time_diff_secINT60

    Outputs (7)

    NameTypeDescription
    responseSTRING
    log_infoSTRING
    message_idSTRING
    output_is_textBOOLEAN
    output_is_audioBOOLEAN
    output_is_imageBOOLEAN
    show_helpSTRING