Telegram and Discord bots
A bot puts your project in a chat you already use. You write to the lead from your phone, answer its questions with a button, and get a schedule's result there. The bot runs on your computer: harnsy reads its messages itself, with no public address and no open port.
What you need. harnsy Max; a Telegram or Discord account; your computer on and harnsy running. While harnsy is not running, the bot does not answer, and a message you write then is not delivered later.
One bot, one project. A bot serves one project; a project may have several bots. Through a project's bot you talk with that project's lead. To follow several projects in one place, put their bots into one Telegram group.
Add a Telegram bot
- In Telegram, open @BotFather and create a bot (the
/newbotcommand). Copy the token it gives you. Treat the token like a password. - In the dashboard on this machine: Settings › Bots › «Add a bot» › Telegram. harnsy is built to let you add a bot only on this machine, not from a phone signed in from outside.
- Under «The bot is for» choose «A project» and pick the project. (Or «The Assistant»: then harnsy is built to take messages only from you, everything goes to the Assistant, and it serves no groups and no other people.)
- Paste the token into «Bot token» and press «Create the bot». harnsy checks the token with Telegram, keeps it sealed and does not show it again. By design the token is not handed to your agents.
- harnsy then suggests two settings in @BotFather: forbid adding the bot to other groups once it is in yours (
/setjoingroups→ Disable), and keep the privacy mode on.
Add a Discord bot
- In the Discord Developer Portal: «New Application», then «Bot» › «Reset Token», and copy the token. Discord shows it once.
- On the same «Bot» page, under «Privileged Gateway Intents», switch on «Message Content Intent». Without it Discord refuses the connection, and the bot shows «setup not finished».
- Optional: switch off «Public Bot», so nobody else can add it to their server (Discord asks you to set «Installation» › «Install Link» to «None» first).
- In harnsy: Settings › Bots › «Add a bot» › Discord, paste the token into «Bot token», pick the project. «How to set up the Discord bot» on the same form repeats these steps.
- On the bot's card press «Bind a channel»: it shows an invite link. Open it to add the bot to your server with the permissions it needs.
On Discord, bot commands are typed as plain text: Discord's own / menu does not list them. A message from a bot is at most 2,000 characters on Discord (4,096 on Telegram); a longer text comes as several messages.
Make the private chat yours
- On the bot's card press «Bind a person». harnsy shows a one-time code that works for 10 minutes.
- Send it to the bot in a private chat: in Telegram
/start <code>(or press «Open in Telegram», then «Start»: the code goes by itself); in Discord/link <code>in a direct message to the bot. - Send a person's code only in a private chat. Sent in a group, the code burns and you need a new one.
- On the card press «Make owner», and switch on «Receiving messages».
The card shows the setup steps («Bot works», «You are bound», «You are the owner», «Receiving messages») and ticks each one when it is done. Until you are the owner and receiving is on, the bot answers nothing in your private chat.
From then on, what you write in the private chat goes to the project's lead. Start a message with an item's number, #123 …, and it reaches the lead about that item. When the lead asks you a question with choices, it can arrive in this chat as buttons (see Answers and approvals).
Groups, forum topics and Discord channels
- Bind a group: add the bot to the group, press «Bind a group» on the card, and write
/link <code>in the group. In a Discord channel: «Bind a channel», then/link <code>there (or@bot link <code>if Discord's/menu takes the command). A Telegram forum topic or a Discord thread is bound on its own, with/linkinside it. - Who it hears: in a group harnsy is built to pass on only a mention of the bot's name or a reply to its own message, and to drop the rest. It answers only people you have bound. What it passes on goes to the project's lead.
- Telegram privacy mode: with it on, a plain mention may not reach the bot. Reply to the bot's message instead.
- Everyone in the group reads what harnsy sends there. Bind a group only if everyone in it may see your project's work. What people in the group write to the bot reaches your agents and the AI service they run on: tell them.
What your agents may send
- harnsy lets agents write only to the chats you allowed for their project: on the chat's row, «Projects that may write to …».
- In a group, a topic or a Discord channel their messages start with 🤖, without an agent's or a project's name. In your private chat you see who wrote and for which project.
- Files from agents, per chat: «Any files», «Text and pictures only» or «No files», and «Largest file». Telegram takes files up to 50 MB, Discord up to 10 MB.
- harnsy cuts secrets it recognizes out of an agent's text and text files before they are sent. Archives, PDFs and pictures go as they are; the card lists the latest 20 under «Files agents sent». It is a safety net, not a guarantee.
- A schedule can send its result to a chat: see Schedules. To your private chat, at most one result of a schedule per 30 minutes.
What a person sends
- Text reaches the lead. Of a photo, a video, a file or a sticker, only the caption is passed on.
- A voice message is transcribed by your speech-to-text connection, if you have one, and the lead gets the text: up to 5 minutes and 10 MB by default. Your audio goes to that provider.
- A person can send up to 20 messages a minute.
Privacy
Messages pass through Telegram's or Discord's servers. Bot chats are not end-to-end encrypted, and the service's own terms apply to them. Do not send passwords or keys there; if your work holds customers' data, send it there only if you may. Anyone who can use your Telegram or Discord account can write to your agents in your name: protect the account.
harnsy adds no sandbox of its own: agents act with your user's rights on this computer. The token is stored sealed, but that is no wall against a program running as you.
Remove or replace
- A chat: «Archive» on its row. harnsy stops writing there; to come back, bind it again with a new code.
- A person: «Unbind». Binding again takes a new code.
- The bot: «Remove the bot». harnsy is built to erase its copy of the token; a backup made earlier still holds it. If the token may have leaked, revoke it:
/revokein @BotFather, «Reset Token» in the Developer Portal. The bot itself stays in Telegram (delete it with/deletebot) or in the Developer Portal. - A token you revoked: «Replace token». The bound chats and people stay.
If something goes wrong
| You see | Usually |
|---|---|
| «needs a project» | the bot has no project: messages are not delivered. Pick one on the card |
| «nobody bound» | bind yourself: «Bind a person», then /start <code> |
| «setup not finished» (Discord) | «Message Content Intent» is off in the Developer Portal |
| «not working: token refused» | the token was revoked or mistyped: «Replace token». Messages wait in the queue meanwhile |
| the bot is silent in a group | mention it or reply to its message; with Telegram's privacy mode a plain mention may not reach it |
| «This code no longer works» | it was sent in a group, or 10 minutes passed: take a new one |
Telegram, BotFather and Discord are names of their owners' products; harnsy is not affiliated with or endorsed by them.
Anthropic, Claude Code, OpenAI, ChatGPT, Codex, OpenCode, pi, Telegram, Discord, GitHub, Apple, macOS, iOS, iPhone, Safari, Google, Android, Chrome, Microsoft, Windows, Windows Security, Defender and QR Code are names of their owners’ products. harnsy is not affiliated with or endorsed by them. iOS is a trademark of Cisco used under licence by Apple; QR Code is a registered trademark of DENSO WAVE INCORPORATED. No logos.