# Telegram Bot Pattern ## 언제 쓰는가 - 사용자 입력 → 서버 처리 → 응답 필요 ## 핵심 구조 - polling or webhook - command handler 분리 ## 코드 예시 (Node.js) ```js const bot = new TelegramBot(TOKEN, { polling: true }); bot.onText(/\/start/, (msg) => { bot.sendMessage(msg.chat.id, "start"); }); ``` ## 주의사항 - 토큰 .env로 관리 - rate limit 고려 ## 재사용 - 핸들러만 추가해서 확장