Agent
Discord
Tag @trycodebot in a Discord channel and it replies right there, working in the channel’s repository.
Discord support is new. Tell us if something doesn’t work as described.
Add Codebot to your server
Add to Discord
On Settings → Integrations, click Connect next to Discord and pick the server. You need the Manage Server permission there. Codebot asks to view channels, send messages, read message history, add reactions and create threads. Its channels are set up on Settings → Integrations → Discord.
Turn on channels
Codebot stays quiet until you turn a channel on. Threads in a channel follow the channel.
Set up each channel
Open a channel’s settings to choose:
- Repository: where requests from this channel are worked on. Without one, Codebot uses your only repository, or asks.
- Instructions for this channel: added to the agent’s instructions for requests from here.
- A thread per request: Codebot opens a thread on every request and answers there, instead of replying in the channel.
- Make changes here: on, the agent may do what Agent → Access allows (push, open pull requests, change things in connected services). Off, it only investigates and explains here. It can’t allow more than Access does.
- Listen to conversations here: on while Listen to conversations is on in Agent → Ambient. Turn it off to keep Codebot out of conversations here.
- Who can ask: limit requests to some roles. With none selected, anyone who can post in the channel can ask.
- Monthly compute limit (minutes): a cap on compute used by requests from this channel.
The Discord switch on Agent → Places turns the whole Discord integration off and on.
Listen to conversations, on Agent → Ambient, is off by default. When an admin turns it on, Codebot follows conversations in your channels and their threads, even when no one tags it, and remembers decisions, conventions and owners. It never replies to them. It reads only what was written after listening went on. Turn it off for one channel in that channel’s settings. See Memory.
Ask Codebot
There are three ways to ask, in a channel you turned on:
- Tag it: write
@trycodebotand your request in a message. - Slash command:
/codebot message: …. - From any message: open the message’s menu, pick Apps → Ask Codebot, and say what to do with it.
Codebot replies to the request with a status message that says what kind of work it is doing, like Reading the code or Running checks. The commands and files themselves are on the run page, behind Follow along. When it’s done, the answer replaces the status message as a reply to your request, with any pull request below it, and you’re notified. An answer too long for one message goes into a thread on the conversation's first message, with a pointer to it in the channel. Later long answers in the same conversation go into that thread too.
To continue, reply to any of Codebot’s messages. No need to tag it. Anyone allowed in the channel can. A reply that tags someone else and not Codebot is left alone. A conversation’s requests share a branch and a pull request. Tagging Codebot without replying starts a new conversation.
Asked inside a thread, Codebot answers in that thread, and tagging it again there continues the conversation. Channels set to A thread per request work this way for every request.
When Codebot opened a pull request for a conversation, it follows up there: it says when the pull request is merged or closed, when someone reviews it, and when its checks fail on the latest commit, and it notifies you for requested changes and failed checks. Reply to a follow-up to continue the conversation, for example to fix the checks. On Azure DevOps it says only when the pull request is completed or abandoned. Admins turn this off with Follow up on Agent → Ambient.
Routines
Ask for something that should happen regularly and Codebot sets up a routine instead of doing it once: every morning, check the database and tell us if anything looks off. A routine runs on the channel’s repository on its schedule, in a fresh sandbox each time, and posts in the channel only when it has something new. Codebot tells you what it set up, with a link to Routines, where anyone in your organization can change it. Ask stop the database check to pause one. From a channel, Codebot can pause any routine, but change or delete only those that work on the channel’s repository and post there.
A routine set up from a channel can’t do more than a request in that channel: it reads only, unless the channel may push and you asked for code changes. Routines run at most once an hour, and an organization can have 25 on at a time. Admins can turn this off with Set up routines when asked on the Routines page.
What it reads
For each request the agent reads recent messages in the channel before it, including its own earlier answers. In a thread it reads the thread so far, and for the first request, the channel before the thread. It also remembers what it was asked and answered earlier in the conversation. Messages are context, not instructions: only the request itself tells the agent what to do.
Limits
- Direct messages aren’t supported.
- Codebot only answers when it’s tagged, used through
/codebot, or Ask Codebot; it doesn’t join conversations on its own. - Codebot’s messages never ping roles or
@everyone.