<p align="center">
<strong>BUILD BOTS THAT FIT EVERY CHAT PLATFORM</strong>
</p>

<p align="center">
<a href="https://pkg.go.dev/github.com/pardnchiu/go-bot"><img src="https://img.shields.io/badge/GO-REFERENCE-blue?include_prereleases&style=for-the-badge" alt="Go Reference"></a>
<a href="https://github.com/pardnchiu/go-bot/releases"><img src="https://img.shields.io/github/v/tag/pardnchiu/go-bot?include_prereleases&style=for-the-badge" alt="Release"></a>
<a href="https://github.com/pardnchiu/go-bot/blob/master/LICENSE"><img src="https://img.shields.io/github/license/pardnchiu/go-bot?include_prereleases&style=for-the-badge" alt="License"></a>
<a href="https://app.codecov.io/github/pardnchiu/go-bot/tree/master"><img src="https://img.shields.io/codecov/c/github/pardnchiu/go-bot/master?include_prereleases&style=for-the-badge" alt="Coverage"></a>
</p>

***

> Telegram, Discord, LINE 어댑터와 하나의 reply handler, 네이티브 인터랙션을 갖춘 Go 멀티 플랫폼 챗봇 라이브러리

> [!NOTE]
> go-bot은 주로 [Agenvoy](https://agenvoy.com/ko/)(Go로 작성되어 24시간 내내 동작하는 로컬 AI 에이전트)를 위해 만들어졌습니다. Agenvoy가 사용자와 대화할 때 사용하는 Telegram, Discord, LINE 채널 계층을 제공합니다.

## 목차

- [기능](#기능)
- [아키텍처](#아키텍처)
- [라이선스](#라이선스)
- [작성자](#작성자)

## 기능

> `go get github.com/pardnchiu/go-bot`

- **동기식 reply 계약** — 플랫폼마다 `Reply` handler를 하나 등록합니다. 비어 있지 않은 반환값은 트리거가 된 메시지에 대한 답장으로 전송되며, handler의 panic은 라이브러리가 recover하므로 연결이 끊기지 않습니다.
- **플랫폼 네이티브 전송 방식** — Telegram long polling과 Discord Gateway는 아웃바운드로 연결되어 NAT 뒤에서도 동작하고, LINE은 서명을 검증하는 webhook 서버를 내장합니다. 모두 같은 `New`/`Start`/`Close` 라이프사이클을 따릅니다.
- **인터랙션은 하나의 handler로 돌아옴** — Telegram inline keyboard와 ForceReply, Discord select menu와 버튼에서 모달을 여는 흐름은 사용자의 선택과 답변을 `Input`으로 같은 handler에 전달합니다.
- **디바운스된 "생각 중" 상태** — `SendStatus`는 원본 메시지에 리액션을 달고 하나의 상태 메시지를 최대 1초에 한 번만 수정합니다. `FinishStatus`는 리액션과 메시지를 모두 지워 플랫폼 레이트 리밋을 넘지 않도록 합니다.
- **상한이 있는 미디어 저장** — 첨부 파일 다운로드는 플랫폼별 20/25/50 MiB 상한을 적용하고 UUID 파일명으로 원자적으로 기록하며, 업로드는 디스크에서 바로 스트리밍합니다.

## 아키텍처

```mermaid
graph TB
    App[Application] --> TG[core/telegram]
    App --> DC[core/discord]
    App --> LN[core/line]
    TG -->|long polling| TelegramAPI[Telegram Bot API]
    DC -->|WebSocket Gateway| DiscordAPI[Discord API]
    LineAPI[LINE Platform] -->|HTTPS webhook| LN
    TG --> Handler[ReplyHandler]
    DC --> Handler
    LN --> Handler
```

## 라이선스

이 프로젝트는 [MIT LICENSE](https://github.com/pardnchiu/go-bot/blob/master/LICENSE)에 따라 라이선스가 부여됩니다.

## 작성자

아이디어가 있다면 [issue를 열어](https://github.com/pardnchiu/go-bot/issues/new) 공유해 주세요.

<a href="https://github.com/pardnchiu/go-bot/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=pardnchiu/go-bot&cache_bust=2026-10-06" alt="go-bot contributors" />
</a>

***

©️ 2026 [邱敬幃 Pardn Chiu](https://www.linkedin.com/in/pardnchiu)
