# pet.trezy.getStats

> Published by [trezy.pet](https://lexicon.garden/identity/did:plc:ollch4g7tes2reb5eceiwuol)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ollch4g7tes2reb5eceiwuol/pet.trezy.getStats)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ollch4g7tes2reb5eceiwuol/pet.trezy.getStats/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ollch4g7tes2reb5eceiwuol/pet.trezy.getStats/examples)

## Definitions

### `pet.trezy.getStats`

**Type**: `query`

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `pet` | `string` (at-uri) | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `error` | `string` | No |  |
| `level` | `integer` | No |  |
| `hunger` | `integer` | No |  |
| `happiness` | `integer` | No |  |
| `hungerPips` | `array` | No |  |
| `happinessPips` | `array` | No |  |
| `totalInteractions` | `integer` | No |  |
| `interactionCooldown` | `integer` | No | The full cooldown length in seconds, from pet.trezy.gameConfig. Lets a client start a countdown the instant it acts, without waiting a round trip and without hardcoding the number. |
| `petCooldownRemaining` | `integer` | No | Seconds until this pet can be petted again, or 0 if it can be now. |
| `feedCooldownRemaining` | `integer` | No | Seconds until this pet can be fed again, or 0 if it can be now. Reported so the client can show a countdown and disable the button on the real rule, rather than on a copy of the cooldown it keeps itself and discovers is wrong by being refused. |

## Raw Schema

```json
{
  "id": "pet.trezy.getStats",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "properties": {
            "error": {
              "type": "string"
            },
            "level": {
              "type": "integer"
            },
            "hunger": {
              "type": "integer"
            },
            "happiness": {
              "type": "integer"
            },
            "hungerPips": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "happinessPips": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "totalInteractions": {
              "type": "integer"
            },
            "interactionCooldown": {
              "type": "integer",
              "minimum": 1,
              "description": "The full cooldown length in seconds, from pet.trezy.gameConfig. Lets a client start a countdown the instant it acts, without waiting a round trip and without hardcoding the number."
            },
            "petCooldownRemaining": {
              "type": "integer",
              "minimum": 0,
              "description": "Seconds until this pet can be petted again, or 0 if it can be now."
            },
            "feedCooldownRemaining": {
              "type": "integer",
              "minimum": 0,
              "description": "Seconds until this pet can be fed again, or 0 if it can be now. Reported so the client can show a countdown and disable the button on the real rule, rather than on a copy of the cooldown it keeps itself and discovers is wrong by being refused."
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "did",
          "pet"
        ],
        "properties": {
          "did": {
            "type": "string",
            "format": "did"
          },
          "pet": {
            "type": "string",
            "format": "at-uri"
          }
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
