/Extension/Line Bot
app icon

Line Bot

Verified by Dify
No ratings yet
6k
K
kevintsai/linebot

Line Bot

Line Bot Plugin Integration Guide

Author: @kevintsai1202 (https://github.com/kevintsai1202/difyplugin.git)
Version: 0.0.6
Type: extension

What's Changed

0.0.6

  1. Security: Upgrade dify_plugin to 0.7.4 and Werkzeug to >=3.1.6 (fixes GHSA-29vq-49wr-vm6x / CVE-2026-27199, GHSA-87hc-h4r5-73f7 / CVE-2026-21860 and related safe_join issues).
  2. Manifest: fix meta.version semantics, add repo field, correct storage size. (Requires Dify 1.11.0 or newer; is intentionally not set because Dify Cloud hides debugging plugins that declare it.)
  3. Image messages no longer need a Dify API Key. The plugin caches the image briefly and serves it to Dify from its own signed endpoint (, 10-minute expiry), which works on Dify Cloud where SDK-uploaded files are rejected by the file-ownership check. If a Dify API Key is set, the image is instead uploaded into Dify through the App API as the same end-user Dify runs the app with, so it appears in Dify's file storage. Temporary files are no longer written to /tmp.
  4. Reliability: reply automatically falls back to push when the reply token has expired (long Dify responses); Dify calls time out after 110s with a friendly message instead of silently failing; webhook events are de-duplicated by webhookEventId; long answers are split at the 5000-char LINE limit and capped at 5 messages.
  5. UX: "typing" loading animation while Dify is working; optional welcome message on follow; LINE display name passed to Dify as an input variable (default ).
  6. Debug Mode setting: when on, error details are sent back to the LINE user for troubleshooting.
  7. Refactor: logic split into (line_client, dify_service, formatting, storage) with unit tests under ; dependency removed in favour of direct Messaging API calls.

0.0.5

  1. Fix/New Feature: When group_id (LINE group chat), room_id (chat room) exist, Session uses group_id or room_id to save conversation_id. The effect is that group chats on Dify will maintain the same conversation. thanks to [@ryantsai](https://github.com/ryantsai]
  2. New Feature: When the message contains markdown, send to LINE as FlexMessage. Can be adjusted in Plugin parameters, default is off. thanks to [@ryantsai](https://github.com/ryantsai]
  3. New Feature: Image upload uses Dify API URL parameterization, supports community edition scenarios. thanks to [@ryantsai](https://github.com/ryantsai]

0.0.4

  1. Add the /clearconversationhistory command, thanks to [@ryantsai](https://github.com/ryantsai]
    When a user enters it on LINE, it will clear the session storage, and the next message sent to Dify will start a brand-new, clean session.
  2. Image message handling, thanks to [@ryantsai](https://github.com/ryantsai]
    Generate responses based on the uploaded images.
  3. Message Handling Enhancement, thanks to [@ryantsai](https://github.com/ryantsai]
    Added support for Markdown image URLs.
  4. Handle image content in responses[@ryantsai](https://github.com/ryantsai]
    Ensure that generated images are properly displayed on LINE.
  5. Identifier Retrieval Support, thanks to [@jimcchi](https://github.com/jimcchi]
    Capture user_id, room_id, and group_id from incoming messages.

Plugin Overview

The Line Bot plugin integrates the Dify chat workflow application with the Line Official Account Messaging API. It enables users to interact with AI through a Line Official Account. The plugin only processes message reception and responses; it does not store any user information.

Setup Steps

Follow these steps to install and configure the Line Bot plugin:

  1. Create a Provider and Messaging API Channel
    Go to the LINE Developers website。
  1. Copy the Channel Secret and Channel Access Token of the Messaging API
  • Navigate to the Basic settings page.
  • Copy the Channel Secret (if it hasn’t been generated yet, click "Issue" to create one).
- Navigate to the Messaging API page. - Enable Use Webhook. - Copy the Channel Access Token (if it hasn’t been generated yet, click "Issue" to create one).
  1. Set Up the Dify Line Bot Endpoint
  • Set an Endpoint Name.
  • Paste the Channel Secret and Channel Access Token.
  • (Optional) Dify API Key and API URL: leave empty in most cases; images are served to Dify by the plugin itself. Fill them only if you want uploaded images stored inside Dify (the key must belong to the same App selected above).
  • Set the image variable, and ensure that the workflow also configures the same file variable.
  • Select a Chat Workflow.
  • (Optional) Welcome Message, Debug Mode, and whether to pass the LINE display name to Dify (variable name defaults to ; add it as an input variable in your Chatflow to use it).
  1. Save and Copy the Line Bot Webhook URL
  1. Set the Webhook URL and Verify
  • Return to the Messaging API page on the LINE Developers platform.
  • Paste the Webhook URL obtained in the previous step.
  • Verify the Line Bot.
6. Use Line to add the Line Official Account and start chatting with AI.
/clearconversationhistory
Describe the image
Generation image
Sample ChatFlow on Dify using gpt-image-1 for generation(DSL file can be imported into Dify)

LinebotImageChatSample.zip

FlexMessage

Development notes

  • Run unit tests with .
  • Remote debugging on Windows: start with (or set the variable in .env); without it gevent's thread-pool resolver can crash the process with an access violation after several HTTPS requests. Linux runtimes are unaffected.
CATEGORY
Extension
VERSION
0.0.6
kevintsai·Updated 5 days ago
REPOSITORY
https://github.com/kevintsai1202/difyplugin
REQUIREMENTS
App invocation
Endpoint registration
Maximum memory
256MB
Maximum storage
10MB
Access domain

Some outbound calls build their address at runtime, so the list may be incomplete.

Detected
Detected
Detected
Security
Security Rating

Last checked 09/12/2026 03:39 AM · version 0.0.6

Give a rate
SHARE WITH