Skip to content

feat: Add LINE Official Account channel support #146

@ex-takashima

Description

@ex-takashima

Summary

Add LINE Official Account (LINE Messaging API) as a new messaging channel for PicoClaw.

Motivation

LINE is one of the most popular messaging platforms in Japan and Southeast Asia, with over 200 million monthly active users. Adding LINE support would make PicoClaw accessible to a large user base, especially in Japan where LINE is the dominant messaging platform.

Proposed Implementation

  • Use HTTP Webhook to receive messages (similar to MaixCam's listener pattern)
  • HMAC-SHA256 signature verification for webhook security
  • Reply Token (free) with Push API fallback for sending messages
  • Support text, image, and audio messages
  • Group chat support with @mention-only response
  • Quote original message in replies using LINE's quoteToken
  • Loading animation while processing
  • No external SDK required (standard library only)

Configuration

{
  "channels": {
    "line": {
      "enabled": true,
      "channel_secret": "YOUR_CHANNEL_SECRET",
      "channel_access_token": "YOUR_CHANNEL_ACCESS_TOKEN",
      "webhook_host": "0.0.0.0",
      "webhook_port": 18791,
      "webhook_path": "/webhook/line",
      "allow_from": []
    }
  }
}

Files to Change

  • pkg/channels/line.go — New LINE channel implementation
  • pkg/config/config.go — Add LINEConfig struct
  • pkg/channels/manager.go — Register LINE channel in initChannels()
  • config/config.example.json — Add LINE config section
  • .env.example — Add LINE environment variables

Notes

  • LINE Webhook requires HTTPS. A reverse proxy (nginx, Caddy) or tunnel service (ngrok, Cloudflare Tunnel) is needed for deployment.
  • No new Go dependencies required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions