Skip to content

Feature/line support#21

Merged
KULEEEE merged 4 commits into
mainfrom
feature/lineSupport
Feb 12, 2026
Merged

Feature/line support#21
KULEEEE merged 4 commits into
mainfrom
feature/lineSupport

Conversation

@KULEEEE
Copy link
Copy Markdown
Collaborator

@KULEEEE KULEEEE commented Feb 12, 2026

Summary

Discord 전용이었던 봇에 LINE 메신저 플랫폼 지원을 추가. Platform Adapter 패턴으로 기존 코드를 대규모 리팩토링 없이 확장.

Architecture

기존: Discord Message → Command → SessionManager → AI CLI

Discord 응답

변경: Discord / LINE Message

PlatformAdapter (추상화 레이어)

Cross-Platform Command (공통 비즈니스 로직)

SessionManager → AI CLI

PlatformAdapter → Discord 응답 / LINE Push Message

Key Changes

  • src/platform/ — 플랫폼 추상화 레이어 신규 생성
    • PlatformAdapter 인터페이스: reply(), replyRich(), askQuestion(), showTyping()
    • DiscordAdapter: 기존 Discord 유틸(버튼, Embed, 타이핑)을 어댑터로 래핑
    • LineAdapter: LINE Flex Message, Quick Reply, Push Message API 구현
  • src/commands/cross/ — 크로스 플랫폼 커맨드 5개 추출 (ask, session, exec, status, help)
    • 기존 Discord 커맨드는 thin wrapper로 변경
  • src/lineBot.ts — LINE 웹훅 서버 (HTTP + 서명 검증 + 커맨드 라우팅)
  • src/sessions/*.tssendMessage() 시그니처를 PlatformMessage + PlatformAdapter로 변경
  • src/config.ts — LINE 환경 변수 추가
  • src/utils/security.tsisAllowedLineUser() 추가

Platform Modes

Discord 설정 LINE 설정 동작
O X Discord만 실행 (기존 동작 유지)
X O LINE만 실행
O O 동시 실행

LINE 동작 방식

  • 수신: LINE 서버 → 웹훅 POST → 봇 (localhost:3000)
  • 즉시 replyToken으로 "처리 중..." 응답 → AI 결과는 pushMessage API로 전송
  • 인터랙티브 질문: LINE Quick Reply로 선택지 표시 → 응답 대기 큐로 처리
  • 웹훅 서명 HMAC-SHA256 검증

Comment thread src/lineBot.ts Fixed
@KULEEEE KULEEEE merged commit 5baea1c into main Feb 12, 2026
3 checks passed
@OSgoodYZ OSgoodYZ deleted the feature/lineSupport branch February 13, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants