How to Run an AI Coding Agent From Discord or Telegram

Want an AI coding agent Discord bot or Telegram bot? Learn how to connect a Sharkly Agent, file Tasks from chat, and stop runs where they start.

Sophia Carter

Sophia Carter

4 December 2026

How to Run an AI Coding Agent From Discord or Telegram

TL;DR: An AI coding agent Discord bot (or Telegram bot) in Sharkly is a bot token bound to one Agent. You create the bot in the Discord Developer Portal or with @BotFather, paste its token into Integrations, and add the bot to your server or group. A second, separate bot can act as your Space’s task assistant and file Tasks from the chat.

Your users already report bugs in a chat app. Someone on your team copies each report into the tracker, then pings whoever runs the coding agent. This guide removes both hops. You’ll connect Sharkly to Telegram or Discord so a mention in a group reaches an Agent, and a request in a channel becomes a Task in your Space.

Before you start

You need four things:

  1. A Sharkly organization with a Space. The task assistant files Tasks into one Space, so pick the Space that owns incoming requests.
  2. An Agent on a Computer. A Computer is a device running the Sharkly local service, and the Agent’s runs happen there. New to both? Read getting started with Sharkly and what a Sharkly Agent is.
  3. A bot on the chat side. For Telegram, a bot token from @BotFather. For Discord, an application in the Discord Developer Portal and the right to manage the target server.
  4. Ten quiet minutes. Both setups are short, but a missed toggle on the chat side fails silently.

One check first: open Integrations in your organization and look at the Discord and Telegram cards. On 2026-12-04, in our demo organization, Telegram showed Set up Telegram while the Discord card read Coming soon, even though the Discord help page documents a full setup. If your Discord card shows no setup button, start with Telegram; the steps match.

How an AI coding agent Discord bot works

The answer has two parts, and they don’t depend on each other. Both the Telegram integration page and the Discord page describe the same pair:

  • Agent bot. One Sharkly Agent behind one bot token. You talk to that Agent in direct messages, group or channel mentions, threads and topics.
  • Task assistant. One system assistant per Space. You @ it in a group, and it turns the conversation into Tasks, then looks up and updates that Space’s Tasks on request.

A task assistant is not an ordinary Agent. It never shows up in Agent lists, assignment pickers or in-app chat. And an Agent bot never turns messages into Tasks on its own. If you want both chat with Echo and Tasks from the channel, you configure both, each with its own bot token.

Architecture diagram of the two chat connections in a Sharkly organization: a Discord server or Telegram group talks to an Agent bot that starts an Agent run on a Computer, and separately mentions a per-Space task assistant that creates Tasks in the Space. Each connection uses its own bot token.

Step 1: Create the bot on the chat side

Telegram. Open @BotFather, send /newbot, enter a display name, then a username ending in bot. BotFather replies with the token. Store it as <bot-token> in your password manager; it grants full control of the bot. The BotFather guide covers the commands.

Decide now whether the bot should read group messages that don’t mention it. If yes, send /setprivacy, pick the bot and choose Disable. Telegram applies that change only after you remove the bot from the group and add it back. Making the bot a group administrator works too, and reaction triggers need admin rights anyway.

Discord. Create an application in the Discord Developer Portal, open the Bot page, reset and copy the token. On the same page, enable Message Content Intent under Privileged Gateway Intents and save. Without it, the bot sees only direct messages and @ mentions, so channel triggers, emoji triggers and chat context all stop working. Discord explains the intent in its gateway documentation.

Step 2: Connect Echo as an Agent bot

  1. In Sharkly, open Integrations, then Set up Telegram (or the Discord page).
  2. Under Connect Agents, click Connect Agent. You can also open the Agent’s detail page and use its Integrations tab, which binds that Agent directly.
  3. Pick Echo and paste <bot-token>.
  4. Click connect. Sharkly validates the token.

On Telegram, the binding completes after validation. Use Add to group on the settings page to put the bot in your group, or Open chat to message it. On Discord, the Discord authorization page opens next: pick the server and authorize. The bot must share a server with you before even direct messages work.

The integration page then lists the bot, its bound Agent, its groups or servers, and its status. A Token rejected state means the platform refused the token: regenerate it and connect again.

Step 3: Bind the task assistant to your Space

  1. On the same integration page, go to the Task assistant section.
  2. Find your Space’s row (ours is Sharkly Task Assistant - Cancel Anything) and click Bind Telegram or Bind Discord.
  3. Choose the Runtime that runs the assistant. A Runtime is the coding agent CLI on a Computer, such as Claude Code or Codex.
  4. Paste a second bot token and add that bot to the same group or server.

Each Space gets at most one task assistant. The row’s ··· menu holds Settings, Unbind and Remove assistant. Settings opens the panel an Agent uses: Computer and Runtime, default model, instructions and Skills. Its description and instructions inherit the organization’s Task assistant template until you edit them on the assistant, which marks them Overridden. Reset to inherit brings the template back.

Step 4: Talk to the Agent from chat

You now have four ways in:

  1. Direct message. The first DM creates an Agent session; later messages continue it.
  2. Mention in a group or channel. This is the default trigger. Echo answers with nearby messages as context, inside the thread or topic you mentioned it in.
  3. Reaction or emoji trigger. Turn it on in the Agent’s integration settings. Adding the chosen emoji to a message starts a run with that message’s context.
  4. Message trigger. Every message in the selected channels or groups starts a run, no mention needed. Use it on a narrow channel only.

To file work, mention the task assistant instead: “@assistant users on Spotify say the cancel button 404s since this morning.” It writes the report up as a Task in the Space. You can ask it later, in the same group, for that Task’s status.

/new starts a fresh Agent session without the earlier context. It does not file a Task; that’s the task assistant’s job.

Sequence diagram of a bug report in a chat group: a user mentions the task assistant, which files a Task in the Space; the user mentions the Echo Agent bot, which starts a run and replies in the same thread; on Discord a cross mark reaction on the trigger message stops the run, while on Telegram the run is stopped with the Stop button in Sharkly.

Files come back to the chat too. Telegram sends images as photos and other files as documents, up to 50 MB each and 10 per reply. On Discord the bot needs the Attach files permission in that channel.

Step 5: Stop a run from the chat

On Discord, add the cross mark reaction to the message that started the run. Anyone in the chat can do it, however the run began. The working indicator comes off, the chat is told the turn stopped, and the run is marked stopped in Sharkly, the same as pressing Stop in the app. The stop emoji can be changed in the integration settings.

Telegram does not support stopping by reaction. Open the run in Sharkly and click Stop.

Discord vs Telegram: what differs

Telegram Discord
Bot creation @BotFather, /newbot Developer Portal app, Bot page
Read non-mention messages Privacy Mode off, or bot is admin Message Content Intent on
Joining Add to group after binding Server authorization during connect
Reaction trigger Bot must be group admin; last 100 messages, 24 hours Emoji trigger in integration settings
Stop a run Click Stop in Sharkly Cross mark reaction on the trigger message
Threads Forum topics Channel threads
App status on 2026-12-04 Set up available Card read Coming soon
Sequence diagram of the setup order: the admin creates a bot with BotFather or the Discord Developer Portal, turns off Privacy Mode or turns on Message Content Intent, pastes the bot token in Sharkly Integrations, Sharkly validates it, and the bot joins the group through Add to group on Telegram or server authorization on Discord.

What to watch for

  • The group is missing from the list. Telegram doesn’t let bots list their groups. Add the bot, post any message in the group, and it appears.
  • The bot ignores channel chatter. On Telegram, Privacy Mode is still on, or you didn’t re-add the bot after turning it off. On Discord, Message Content Intent is off.
  • A message keeps failing. Sharkly skips it so later messages aren’t blocked. Ask the sender to post it again.
  • Disconnecting deletes nothing. It stops the exchange; chat history and Sharkly sessions stay.
  • The help page and the app disagree. Trust the app. Our Discord card read Coming soon while the help page described a working setup.

Two other ways teams use this

  • A support desk binds only the task assistant to a Triage-first Space. Users file requests in a public group; nobody talks to an Agent. Pair it with triage rules.
  • A platform team binds a coding Agent with the message trigger on one alerts channel, so every alert gets a first look in its own thread. For the Slack version, read a Slack bot for coding agents or Slack bug reports to agent Tasks.

Recap checklist

  • [ ] Bot created, token kept out of chat and tickets
  • [ ] Privacy Mode off or Message Content Intent on, if you need non-mention messages
  • [ ] Agent bot connected and added to the group or server
  • [ ] Task assistant bound to the right Space with its own token
  • [ ] Triggers chosen per channel
  • [ ] Team knows how to stop a run on each platform

Sharkly is free to start, and the integrations page lists the other tools it connects to. Create the bot today, bind it to the Agent your users already ask about, and let the next bug report file itself.

FAQ

Do Discord or Telegram messages become Sharkly Tasks automatically?

No. An Agent bot only chats. To turn a discussion into a Task, @ the Space’s task assistant in the group; it creates the Task from the chat context.

Can one bot be both the Agent bot and the task assistant?

The help pages describe them as two connections, each configured separately with a bot token. Plan on two bots.

Why can’t my Telegram reaction stop the Agent?

Telegram doesn’t support reaction stops. Click Stop on the run in Sharkly; Discord users can react with the cross mark instead.

Why does the bot only answer when mentioned?

That’s the default trigger. Turn on reaction or message triggers in the Agent’s integration settings, after disabling Privacy Mode (Telegram) or enabling Message Content Intent (Discord).

Does disconnecting delete history?

No. Messages in the chat app and sessions in Sharkly are both kept.

Explore more

How to Connect GitLab to AI Agents in Sharkly

How to Connect GitLab to AI Agents in Sharkly

Want GitLab issues worked by AI agents? Learn how the Sharkly GitLab integration syncs issues to tasks and links merge requests back.

4 December 2026

How to Control a Sharkly Agent From Lark

How to Control a Sharkly Agent From Lark

Want a Lark AI agent bot for your team? Learn how to file Sharkly Tasks from a Lark group, run an Agent, and get progress back in the thread.

4 December 2026

Claude Prompt Cache TTL: Why Agent Pauses Cost You Money

Claude Prompt Cache TTL: Why Agent Pauses Cost You Money

Is the Claude prompt cache TTL raising your agent bill? Learn why pauses over 5 minutes force a full rewrite and when the 1-hour cache pays off.

4 December 2026

How to Run an AI Coding Agent From Discord or Telegram