# Ask in Slack

> Link your Slack account once, then ask Corfedo AI about your code in a direct message or by mentioning it in a channel.

Source: https://docs.corfedo.ai/use/ask/slack/

When your workspace has the Slack integration, you can ask Corfedo AI from Slack. Answers use your own Corfedo access, so they read only code you may read.

## Before you begin

- An administrator has added Corfedo to your Slack workspace, see [Slack](https://docs.corfedo.ai/workspace/integrations/slack/).
- You can sign in to the Corfedo workspace.

## Link your account

### Ask your first question

Send the Corfedo app a direct message in Slack, such as "How does acme/payments retry a failed charge?". The first time, the app replies with **Link account**. Only you see the reply. The link works for 10 minutes.

![Link prompt in Slack](https://docs.corfedo.ai/images/integrations/slack/slack-link-prompt.png)

### Confirm in Corfedo

Select **Link account** and sign in to Corfedo if asked. Corfedo shows the Slack workspace and account it links. Select **Continue to Slack** and sign in to Slack as that account.

![Link your Slack account](https://docs.corfedo.ai/images/integrations/slack/link.png)

### Ask again

The page says **Account linked**. Ask your question again in Slack.

**Check:** Corfedo AI answers your question in Slack.

![Answer in a direct message](https://docs.corfedo.ai/images/integrations/slack/slack-answer.png)

## Ask and follow up

| Where | How |
| --- | --- |
| Direct message | Write to the Corfedo app |
| Channel | Mention the app, such as `@Corfedo how do we sign outgoing webhooks?`, in a channel your administrator enabled. The answer appears in the thread. |
| Follow-up | Reply in the same thread. The thread is one conversation, and one question is answered at a time. |

A channel answer uses your access, and everyone in the channel can read it. Ask in a direct message when the answer may include code others cannot see. Questions run with the profile and repositories your administrator chose for Slack, not with your choices in the browser.

![Answer in a channel thread](https://docs.corfedo.ai/images/integrations/slack/slack-channel-answer.png)

## Unlink your account

Open **Connections** in the menu under your name. Under **Linked accounts**, select **Unlink**. Your next question in Slack asks you to link again.

## Troubleshooting

Corfedo replies only to you when it cannot answer, and says why.

| Reply | Why | What to do |
| --- | --- | --- |
| "To ask me here, link your Corfedo account first." | You mentioned the app in a channel before linking | Select **Open direct message** and link there |
| "This link expired. Send me a message to get a new one." | The link is older than 10 minutes | Send another message |
| "I answer only in direct messages." | Mentions in channels are off | Ask in a direct message |
| "I don't answer in this channel." | This channel is not enabled | Ask in a direct message, or ask an administrator to add the channel |
| "I can't answer yet: no AI profile is chosen for this Slack app." | The integration has no profile | Ask an administrator to choose one |
| "I can't answer with this Slack app's AI profile" | The profile was removed, or you may not use it | Ask an administrator |
| "I can't answer yet: this Slack app needs new permissions." | The app must be reconnected | Ask an administrator |
| "You have reached your monthly AI spending limit." or "Your workspace has reached its monthly AI spending limit." | Your or the workspace's monthly limit is used up | Wait for next month, or ask an administrator |
| **Sign-in cancelled** after the link | You left the Slack sign-in | Open the link from Slack again |
| **Link request expired** or **Different account** | The link is too old, or you signed in to Slack as another account | Ask again in Slack for a new link, and sign in as the account that asked |
