Telegram:Bot
API Token
@BotFather
를 통하여 토큰을 획득할 수 있다.
- [입력] /newbot
- BotFather: Alright, a new bot. How are we going to call it? Please choose a name for your bot.
- [입력(한글가능)] DecanBot
- BotFather: Good. Now let's choose a username for your bot. It must end in
bot
. Like this, for example: TetrisBot or tetris_bot. - [입력(영문)] DecanBot
- BotFather: Done! Congratulations on your new bot. You will find it at telegram.me/DecanBot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.
Use this token to access the HTTP API:
----- TOKEN -----
For a description of the Bot API, see this page: https://core.telegram.org/bots/api
이후 ID를 추가하면 된다. (위의 경우 @DecanBot
)
Join Group
단순히 그룹에 추가하기 위해서 @BotFather
에게 /setjoingroups
명령을 보내야 한다.
Privacy mode
참고로 그룹에 가입시켜도 봇API를 통해 그룹의 메시지를 가져올수 없다. 메시지 접근권한을 갖기 위해 @BotFather
를 통해 /setprivacy
명령을 Disable
하면 된다.
Inline bots
URL 프리뷰 모드 끄기
You can set disable_web_page_preview
attribute to true when using sendMessage
method.
It will disable link previews for links in this message.
https://core.telegram.org/bots/api#sendmessage
봇의 명령 자동완성 추가
봇 파더한테 /setcommands
명령치면 된다.
다음과 같이 입력하라 한다:
OK. Send me a list of commands for your bot. Please use this format:
command1 - Description
command2 - Another description
Send /empty to keep the list empty.
명령 이름은 /
를 제외하고 입력해야 한다.
예를 들면:
가 아니라 다음과 같아야 한다:
Troubleshooting
그룹에 봇을 추가했는데 메시지에 접근할 수 없다고 뜰 때
영문 메시지는 Has no access to message
이다.
봇 파더한테 가서
See also
Favorite site
- [추천] Telegram Bot API
- [추천] Core.telegram: Bot Code Examples
- 텔레그램telegram 봇bot 사용법 소개 및 후기
- [추천] Telegram CLI - Python을 이용하여 Telegram Bot 만들기
- Telegram Bot API Token 생성하기
- 라즈베리파이 Telegram BOT 만들기 1부 - Telegram cli 설치 3