Antes de começar
- Uma conta Telegram.
- Alter instalado e em execução no seu Mac.
- O aplicativo Telegram ou Telegram Web.
- @BotFather em Telegram
- Telegram Bots — Features and BotFather
- Telegram Bot API tutorial
- Bot FAQ — groups and privacy
Passo 1 — Crie um bot com BotFather
Open BotFather
Run /newbot
/newbot. BotFather asks for a display name (shown in contacts) and a username (must end in bot, for example MyAlterHelperBot).

Copy the HTTP API token
123456789:ABCdefGHIjklMNOpqrsTUVwxyz). Copy the full string.Telegram documents this flow in the Bot tutorial — Obtain your bot token.
Configurações opcionais do BotFather
Etapa 2 — Inicie um bate-papo com seu bot
Open the bot
t.me/YourBotName) or search for your bot’s username in Telegram. The success message in Step 1 includes this link.Tap Start
/start so Telegram opens a conversation. You need an active chat before testing Alter.Passo 3 — Opcional: use o bot em grupo
Alter pode receber mensagens de bate-papos em grupo e também de bate-papos privados.Add the bot to a group
Check Group Privacy (if messages are missing)
/mybots → your bot → Bot Settings → Group Privacy → Turn off.See Bot FAQ — privacy mode.Restrict access if needed
Acesso seguro — listas de permissões e IDs
Restrinja quem pode usar seu gateway Telegram com IDs de utilizador ou chat Telegram permitidos em Definições → Integrations → Gateways. Alter verifica cada mensagem recebida e toque no botão embutido nessa lista antes de executar uma ação.@usernames (case-insensitive). Leave the field empty to allow anyone who can message the bot. Enter * to allow everyone explicitly. Messages from users or chats not on the list are silently ignored — Alter does not reply with an error.ID do usuário x ID do bate-papo
Telegram usa IDs numéricos para pessoas e conversas:@username (por exemplo @sam) se a pessoa tiver um nome de usuário público.
Como encontrar seu ID de usuário Telegram
Use an ID bot (easiest)
@) into IDs de utilizador ou chat Telegram permitidos.Forward a message (groups or other chats)
Como encontrar um ID de bate-papo
Private chat with your bot
getUpdates method with your bot token and look for "chat": {"id": …} and "from": {"id": …} in the JSON. See Telegram Bot API — Chat and User.Group or supergroup
Bot API getUpdates (no extra bots)
TOKEN with your token):https://api.telegram.org/botTOKEN/getUpdatesSend a test message in the chat you want to identify, refresh the page, and read message.chat.id (chat ID) and message.from.id (sender user ID) from the latest entry.Configure a lista de permissões em Alter
Collect IDs
@usernames for everyone (or every group) that should be able to use the bot.Paste into Gateways settings
123456789, -1001234567890, @sam).Save and test
Melhores práticas de segurança
- Treat the bot token like a password. Armazene-o apenas em Alter (Keychain). Se vazar, revogue-o em @BotFather com
/revokee cole o novo token em Alter. - Use an allowlist for personal bots. Uma lista de permissões vazia significa que qualquer pessoa que descobrir seu bot poderá enviar mensagens enquanto Alter estiver em execução.
- Prefer numeric IDs over
@username. Os nomes de usuário podem ser alterados; IDs numéricos são estáveis. - Limit group exposure. Ative Group Privacy em BotFather, a menos que o bot precise ler todas as mensagens do grupo. Adicione apenas grupos confiáveis e coloque o ID do chat em grupo na lista de permissões se o bot estiver em vários grupos.
- Be cautious with third-party ID bots. Eles podem ver mensagens encaminhadas e metadados de grupo. Remova-os de grupos confidenciais quando não precisar mais deles.
Conecte-se em Alter
Open Gateways settings
Add a Telegram gateway
Fill in Connection fields
Choose Ação predefinida
Enable and save
Teste o bot
Confirm Alter is running
Send /help
/help. The bot should list commands.Send a message
Try buttons and /stop
/help and use the New chat, Choose action, or Past chats buttons. While Alter is responding in a group, tap Stop or send /stop to cancel the current turn.Try attachments
Try voice messages
