Skip to content

tesilio/lassistant

Repository files navigation

Lassistant

AWS Lambda 기반 Serverless 텔레그램 봇


설치

yarn install

텔레그램 봇 생성

  1. BotFather와 대화시작
  2. 새로운 봇 생성
    • /newbot
  3. 봇 이름 입력
    • 나중에 변경 할 수 있다.
  4. 봇 계정명(username) 입력
    • 변경 할 수 없다.
    • 반드시 Bot이나 bot으로 끝나야 한다.
    • 예) TestBot 혹은 test_bot
  5. token을 저장해둔다.
  6. 1:1 대화 시작
    • t.me/<봇 계정명>

웹훅 설정

# <token> 부분을 봇 등록 시 발급받은 토큰으로 대치한다.

# 웹훅 URL 등록
curl -F "url=https://test.execute-api.ap-northeast-2.amazonaws.com/bot/" https://api.telegram.org/bot<token>/setWebhook

# 등록되어 있는 모든 웹훅 URL 삭제
curl https://api.telegram.org/bot<token>/setWebhook

# 혹은
node setWebhook

Function invoke

yarn run sls invoke local --function dailyNews -s production

Serverless offline

yarn run sls offline -s dev

About

Telegram Bot with Serverless

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published