# Discord commands

Every /crew command: what it does, its options, and who can use it.

Crew's commands all start with `/crew`. Type `/crew` in any channel of your server to see them.

- **Answers are private.** Only you see Crew's reply, so you can use commands anywhere.
- **Same permissions as the website.** A command can't do anything you couldn't do in the app.
- **Your profile must be linked** to your Discord account for commands about yourself (clocking in,
  your status, your requests and leave).
- **Sensitive actions aren't commands.** Deleting data, archiving and access settings are only
  possible on the website.

## Quick reference

| Command                            | Who                | What it does                                                    |
| ---------------------------------- | ------------------ | --------------------------------------------------------------- |
| `/crew clockin type [subdivision]` | Members and up     | Start logging activity.                                         |
| `/crew clockout [notes] [proof]`   | Members and up     | Stop, and log the time since you clocked in.                    |
| `/crew status`                     | Members and up     | Your hours, requirements, role and clock-in.                    |
| `/crew whois user`                 | Anyone with access | Look someone up.                                                |
| `/crew away`                       | Anyone with access | Who is on leave today.                                          |
| `/crew requests`                   | Members and up     | Your requests; for managers, what's waiting for their approval. |
| `/crew leave start [end] [reason]` | Members and up     | Request leave.                                                  |
| `/crew promote user role [reason]` | Managers and up    | Change someone's role.                                          |

`[brackets]` mark optional options.

## Activity

### `/crew clockin`

Starts a clock-in. Options:

- **type** (required): the activity type. Crew suggests your organization's types as you type.
- **subdivision**: the sub-division, if the type has them (also suggested).

You can only be clocked in once. A clock-in left open for more than 24 hours is discarded.

### `/crew clockout`

Stops your clock-in and logs the time as an activity entry. Options:

- **notes**: what you did.
- **proof**: a proof link, such as a screenshot (`https://…`). Required if the activity type
  requires proof.

If the type needs approval, the entry waits for your manager like any other.

### `/crew status`

Your hours this week and this month, each requirement that applies to you and whether it's met, your
role, and whether you're clocked in (and since when).

## People

### `/crew whois`

Looks someone up. Option: **user** (required), the Discord member. Shows their name and title,
department and manager, role and time in role (with their last promotion), time in service, initial
training status and employment status, with a link to their profile. Managers also see when they
last logged approved activity. Contact details and records are never shown.

### `/crew away`

Lists who is on leave today. Reasons are never shown.

### `/crew promote`

Changes someone's role. Options:

- **user** (required): who.
- **role** (required): the new role (suggested from your role list).
- **reason**: why, kept in their role history.

The same rules apply as on the website: managers can only change roles for people in their reporting
line, only up to their own access level, and never their own. The bot updates their Discord role.

## Requests

### `/crew requests`

Your recent requests and their status. Managers also see what's waiting for them: requests from
their direct reports and activity entries to approve, with links to decide them in the app.

### `/crew leave`

Requests leave. Options:

- **start** (required): first day, as `YYYY-MM-DD`.
- **end**: last day, as `YYYY-MM-DD`. Leave it out for a single day.
- **reason**: only you, your managers and Super Users see it.

The request goes to your manager exactly like one made on the website.

### Troubleshooting

- **`/crew` doesn't appear.** Restart Discord. If it's still missing, a Super User can run
  **Settings → Integrations → Check the bot**; the **Slash commands** line says what's wrong.
- **"Your Discord account isn't linked".** Ask a manager to link your account to your Crew profile.
- **"You don't have access to Crew in this server".** None of your Discord roles gives access. Ask
  a Super User.
- **"Crew is archived for this server".** Commands stop while the organization is archived.
- **"You can't change your own service record".** Promotions must come from someone else.

Source: https://docs.noyralabs.com/crew/slash-commands
