# /8ball

> Ask the magic 8-ball a question and get a random answer.

Ask a yes-or-no question. The bot picks a random answer.

```text
/8ball question: Will I win the giveaway?
```

> 🎱 **Will I win the giveaway?**
> Signs point to yes.

## Setup

Create a slash command and switch to **Advanced**.

| Field | Value |
|---|---|
| Command Name | `8ball` |
| Description | `Ask the magic 8-ball` |

**Arguments:**

| Type | Name | Required |
|---|---|---|
| Text | `question` | Yes |

## Code

**Pre-hook:**

```python
answer = random([
    "It is certain.",
    "Without a doubt.",
    "Yes, definitely.",
    "Signs point to yes.",
    "Ask again later.",
    "Cannot predict now.",
    "Don't count on it.",
    "My sources say no.",
    "Very doubtful.",
])
```

**Content / Reply Message:**

```text
🎱 **{question}**
{answer}
```

`random` picks one item from the list. The reply shows it with `{answer}`, and the question with `{question}`.

## Make it yours

Add or remove answers in the list. Each answer is text in quotes, followed by a comma.

## Related

- [Variables](https://ccbot.app/docs/getting-started/variables) explains `{ }` in the reply.
- [/coinflip](https://ccbot.app/docs/examples/coinflip) is another random pick.
