본문으로 건너뛰기
설정

Telegram

이 페이지는 에이전트가 영어 원문을 번역하고 검토했습니다. Zhehan은 영어와 중국어를 읽습니다. 교정을 도와주시면 감사하겠습니다. 교정 돕기 번역 문제 신고

SwB은 BotFather에서 만든 봇으로 Telegram과 통신합니다. SwB이 Telegram에 새 메시지를 직접 요청하므로 SwB 서버는 비공개 주소를 그대로 써도 됩니다.

시작하기 전에

Telegram 계정을 사용하세요. 그룹을 연결하려면 멤버를 추가할 수 있는 계정을 사용하세요. 소유자로 SwB에 로그인하세요.

설정 프롬프트 복사

Read the setup guide at https://swb.one/docs/setup/telegram.

Help me connect Telegram to SwB. SwB carries messages between my agents and channels.

If the SwB tools are missing, ask me to add SwB as a custom MCP server. Follow https://swb.one/docs/connect to add the client.

For Claude, give me the path `Customize > Connectors > Add > Custom > Web`. For ChatGPT, ask me to open `https://chatgpt.com/plugins`. Give me the path `+ > Add custom MCP server`. For Grok, give me the path `grok.com > Connectors > New Connector > Custom`. For other apps, ask me to open the MCP server settings. Wait for me to confirm.

Use a SwB client with owner access.

Call `connect(what="telegram")`. Do each step marked "you" yourself. Give me each step marked "person" one at a time with the exact click path and links. Wait for me to say done after each step.

Ask me to open https://t.me/BotFather and send `/newbot`. Ask me to choose the bot's name and username. BotFather replies with the token. Ask me to enter it only through the claim link from `connect`. Then ask me to start a chat with the bot and send one message.

For a group, ask me to open `setup.add_to_group_url` from `telegram_status`. Ask me to select the group. Ask me to send `/swb@<bot username>` there. To let the bot read all group messages, ask me to send `/setprivacy` to BotFather. Ask me to choose the bot and select **Disable**. Ask me to remove the bot from the group. Ask me to add it again.

Use `telegram_status` to get the chat IDs from `setup.seen_chats` and my user ID from the direct message. Add a space under `blocks.telegram.spaces` in `config/switchboard.yaml`. Put the chat IDs in `chats` and my user ID in `owner_ids`. Grant the test agent access in `blocks.telegram.agents`. If the file needs a manual edit, give me the YAML. Restart SwB after an edit.

Call `connect(what="telegram")` again to check the connection. When it reports `connected`, ask me to choose a test chat. Call `telegram_post` with the space label, chat ID and test text. Show me the result.

Subscribe to switchboard.message.created if this app supports MCP events. Otherwise, call wait or inbox to collect new messages.

If you keep your own memory, set up memory sync as described at https://swb.one/docs/memory.

이 프롬프트를 SwB 소유자 클라이언트에 붙여 넣으세요.

Telegram 봇 설정

BotFather 열기

Telegram에서 https://t.me/BotFather를 여세요. BotFather와 처음 대화한다면 Start를 누르세요.

봇 만들기

/newbot을 보내세요. 표시 이름으로 답하세요.

사용자 이름 정하기

bot으로 끝나는 사용자 이름으로 답하세요. BotFather가 토큰으로 답합니다.

토큰 저장

에이전트가 준 SwB 등록 링크를 여세요. 필드에 토큰을 붙여 넣으세요.

개인 채팅 시작

봇과의 개인 채팅에서 Start를 누르세요. SwB이 내 사용자 ID를 찾을 수 있도록 메시지를 하나 보내세요.

그룹에 봇 추가

에이전트가 준 그룹 링크를 여세요. 그룹을 선택하세요.

설정 명령 보내기

그룹에서 /swb@<bot username>을 보내세요. 그러면 SwB이 그룹 ID를 알게 됩니다.

그룹 메시지 모두 읽기

봇이 모든 메시지를 읽어야 하는 그룹이 있다면 BotFather에 /setprivacy를 보내세요. 내 봇을 고르세요. Disable을 선택하세요.

봇 다시 추가

각 그룹에서 봇을 내보내세요. 봇을 그룹에 다시 추가하세요.

에이전트가 하는 일

에이전트가 connect(what="telegram")를 호출합니다. 필요하면 telegram 블록을 켭니다. 블록이 켜지면 connect나 telegram_provision이 봇 토큰용 등록 링크를 돌려줍니다.

토큰을 저장하면 에이전트가 telegram_status를 호출합니다. 에이전트는 봇과 프라이버시 모드를 확인합니다. 그룹 초대 링크는 setup.add_to_group_url에 있습니다. 최근 채팅 ID는 setup.seen_chats에 있습니다.

에이전트는 config/switchboard.yaml의 blocks.telegram.spaces 아래에 공간을 설정합니다. 공간은 채팅 묶음을 SwB 프로젝트에 연결합니다. 그룹 ID는 chats에 설정하세요. 내 사용자 ID는 owner_ids에 설정하세요. 파일을 수정한 뒤 SwB을 다시 시작하세요.

자격 증명

토큰Telegram에서 표시되는 곳형식입력할 곳
봇 토큰/newbot 또는 /token 뒤의 BotFather 답장숫자, 콜론, 그 뒤에 영문자와 숫자SwB 등록 링크

연결 확인

에이전트에게 connect를 다시 호출하도록 요청하세요. 설정이 끝나면 connected가 나옵니다.

owner_ids에 등록한 Telegram 계정을 사용하세요. 개인 채팅에서 봇에게 /swb <target> hello를 보내세요. <target>은 targets에 나온 대상 이름으로 바꾸세요. 답장이 오는지 확인하세요.

문제 해결

그룹에서 봇이 명령만 읽는다면 BotFather에서 프라이버시 모드를 끄세요. 그다음 봇을 내보냈다가 다시 추가하세요.

웹훅은 Telegram이 메시지를 보내는 웹 주소입니다. 이전 웹훅이 남아 있다면 봇 소유자에게 Telegram의 deleteWebhook 메서드로 제거해 달라고 요청하세요.

이 페이지의 내용