> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dogebot.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Point a variable at someone else

> Add [ ] to a variable to get the value of a different person, channel or server.

Normally a variable is about **whoever started the command or event**. `{user_name}` is the name of the person who typed the command.

But what if you want the name of **someone else**, like the person they picked in `/hug @Alex`? Then you **point** the variable at that person by adding square brackets `[ ]` at the end:

```text theme={null}
{user_name[option_friend]} got a big hug from {user_name}!
```

The bot sends:

```text theme={null}
Alex got a big hug from Sam!
```

## What can go inside the brackets?

Three kinds of things. Pick whichever you have.

**A plain ID**

Type the ID straight in. The variable then **always** points at that one person, channel or server.

```text theme={null}
{user_icon[136327647792726016]}
{channel_name[879733469452836864]}
{server_members[822426820447567872]}
```

> [!TIP]
>
> To copy an ID in Discord, turn on **Developer Mode** (User Settings, then Advanced), then right-click a person, channel or server and press **Copy ID**.

**An input**

In a command, use an **input** the person filled in. Write `option_` and the input's name, **without** curly brackets.

```text theme={null}
{user_icon[option_friend]}
{user_joined[option_member]}
{channel_name[option_channel]}
```

The input must be the right kind: a **Member picker** for a person, a **Channel picker** for a channel. If the person skipped an optional member input, the variable is about **them** instead.

**Another variable**

Use any variable that holds an ID. Here you **keep** its curly brackets.

```text theme={null}
{user_icon[{bot_id}]}
{user_name[{event_user_id}]}
{channel_name[{DBVAR_log_channel}]}
{user_name[{weather.response.owner_id}]}
```

Mentions work too. If a variable holds `<@136327647792726016>` or `<#879733469452836864>`, DogeBot takes the ID out of it for you.

## Which variables can be pointed?

| Group | Variables you can point | Example |
| - | - | - |
| A person | `user_name`, `user_displayName`, `user_tag`, `user_id`, `user_mention`, `user_icon`, `user_avatar`, `user_status`, `user_createdAt`, `user_joined`, `user_discriminator`, `isBot` | `{user_joined[option_member]}` |
| A channel | `channel_name`, `channel_id`, `channel_type`, `channel_topic`, `channel_mention` | `{channel_topic[option_channel]}` |
| A server | `server`, `server_id`, `server_icon`, `server_members`, `server_owner_id`, `first_channel_id` | `{server[{event_guild_id}]}` |
| Your own variables | Any **User** or **Channel** variable | `{DBVAR_coins[option_user]}` |
| Discord objects | `Guild`, `Channel`, `Member`, `User`, `Role`, `Emoji`, `Sticker`, `GuildScheduledEvent` | `{Member[option_user].nickname}` |

> [!WARNING]
>
> **Discord objects are different.** The brackets go **straight after the object name**, before the dot:
>
> `{Channel[879733469452836864].name}` works.
>
> `{Channel.name[879733469452836864]}` does **not** work.
>
> See [Discord objects](/variables/discord-objects).

## Your own variables

The same trick works for your own **User** variables. This is how you show **someone else's** coins:

```text theme={null}
{user_name[option_member]} has {DBVAR_coins[option_member]} coins.
```

And to **change** someone else's value, use the **Whose variable** box in the **Save a value** or **Do the maths** block. See [Use your variables in blocks](/variables/use-your-variables-in-blocks).

## A full example: /whois

A command that shows facts about any member.

**1. Make the command**

Make a slash command called `whois`.

**2. Add a Member picker input**

Add a **Member picker** input and name it `member`.

**3. Add a Reply with a card block**

Fill it in like this:

```text theme={null}
Title: {user_displayName[option_member]}
Picture: {user_icon[option_member]}
Text:
Username: {user_name[option_member]}
Joined this server: {user_joined[option_member]}
Account made: {user_createdAt[option_member]}
Is a bot: {isBot[option_member]}
```

**4. Save and try it**

Press **Save Command** and type `/whois @someone` in Discord.

## If it doesn't work

| What you see | Why | Fix |
| - | - | - |
| The variable shows as plain text, like `{user_name[option_friend]}` | The input name is wrong, or the person isn't in the server | Check the input's name, and that it's a **Member picker**. |
| `{user_name[{option_friend}]}` doesn't work | Inputs go in **without** curly brackets | Write `{user_name[option_friend]}`. |
| A channel value is empty | The bot can't see that channel | Give your bot the **View Channel** permission there. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.