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

# Lookups and queries

> Look up nations, filter alliances, and save sheet shortcuts

These member commands answer quick questions.

## Who is this?

Run `/who` with exactly one of:

* `user`: a Discord user. The bot shows their linked nation card.
* `discord_id`: a raw Discord ID. Same result.
* `nation_id_or_link`: a nation. The bot shows the linked Discord account.

`/legacy-who` takes the same options and gives a one-line answer instead of a card.

The lookup only works for people who verified with the bot.

## Filter nations

`/query run` lists nations that match a condition.

1. Set `alliances_or_coalitions` to the alliances to search.
2. Set `filter` to a condition, for example `score>1000`.
3. Optional: set `sheet_id` to export the results to a Google Sheet. Add `select` to choose the sheet columns.

Run `/query help` for the full list of filter keys and operators. Use `&` for AND and `|` for OR. `/query count` returns only the number of matches.

## Sheet shortcuts

Save a Google Sheet under a short name. Then use the name anywhere a command asks for a `sheet_id`.

* `/sheet-alias set name:<name> sheet_id:<link or ID>` saves a shortcut.
* `/sheet-alias delete name:<name>` removes it.

Aliases are personal. Only you can use yours.

Share any export sheet with the bot's service account with editor access first. The bot shows the exact account to share with when it cannot write to your sheet. Exports overwrite the first tab of the sheet.
