# com.suibari.nagi.getPreferences

> Published by [suibari.com](https://lexicon.garden/identity/did:plc:uixgxpiqf4i63p6rgpu7ytmx)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:uixgxpiqf4i63p6rgpu7ytmx/com.suibari.nagi.getPreferences)
- [Documentation](https://lexicon.garden/lexicon/did:plc:uixgxpiqf4i63p6rgpu7ytmx/com.suibari.nagi.getPreferences/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:uixgxpiqf4i63p6rgpu7ytmx/com.suibari.nagi.getPreferences/examples)

## Definitions

### `com.suibari.nagi.getPreferences`

**Type**: `query`

端末をまたいで同期する本人の設定（my Nagi の既読位置とお気に入り絵文字）を返す。他ユーザーからは参照できない。

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `feedTabs` | `array` | No | フィードのタブ。表示順そのまま。 |
| `replyFreq` | `integer` | No | botたんからの返信確率（0〜100%）。Bluesky側のfreq設定と共用。 |
| `preferredName` | `string` | No | botたんに呼んでほしい名前。省略時は未設定＝表示名で呼ばれる。 |
| `readPositions` | `array` | Yes |  |
| `emojiFavorites` | `array` | Yes | お気に入り絵文字パレット。表示順そのまま。要素は #unicodeFavorite または #customFavorite。 |
| `feedTabsUpdatedAt` | `string` (datetime) | No | 省略時は、この利用者がまだ一度もタブをカスタムしていないことを表す（クライアントは既定タブを使う）。 |
| `emojiFavoritesUpdatedAt` | `string` (datetime) | No | 省略時は、この利用者のお気に入りがまだ一度も同期されていないことを表す。 |

#### Errors

- **AuthRequired**

### `com.suibari.nagi.getPreferences#feedTab`

**Type**: `object`

フィードのタブ1枚。必要なフィールドは kind ごとに異なる（list / custom は source、channel は uri、search は query）。

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes |  |
| `uri` | `string` (at-uri) | No | kind が channel のときのチャンネル。 |
| `kind` | `string` | Yes |  |
| `label` | `string` | No | 表示名のスナップショット。権威は uri / query 側。 |
| `query` | `string` | No | kind が search のときの保存クエリ。 |
| `source` | `string` | No | kind が list / custom のときの参照先（list=home, custom=affirmation）。将来のユーザー定義フィードは uri で指す。 |
| `queryKind` | `string` | No |  |

### `com.suibari.nagi.getPreferences#readPosition`

**Type**: `object`

「ここまで読んだ」位置。新旧の比較は (indexedAt, uri) の辞書順で行う。

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |
| `section` | `string` | Yes |  |
| `indexedAt` | `string` (datetime) | Yes |  |

### `com.suibari.nagi.getPreferences#customFavorite`

**Type**: `object`

Bluemoji のスナップショット。url などは表示のたびに再解決されるので、権威は uri のみ。

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `kind` | `string` | Yes |  |
| `emoji` | `unknown` | Yes |  |

### `com.suibari.nagi.getPreferences#unicodeFavorite`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `kind` | `string` | Yes |  |
| `emoji` | `string` | Yes |  |

## Raw Schema

```json
{
  "id": "com.suibari.nagi.getPreferences",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "AuthRequired"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "readPositions",
            "emojiFavorites"
          ],
          "properties": {
            "feedTabs": {
              "type": "array",
              "items": {
                "ref": "#feedTab",
                "type": "ref"
              },
              "maxLength": 16,
              "description": "フィードのタブ。表示順そのまま。"
            },
            "replyFreq": {
              "type": "integer",
              "maximum": 100,
              "minimum": 0,
              "description": "botたんからの返信確率（0〜100%）。Bluesky側のfreq設定と共用。"
            },
            "preferredName": {
              "type": "string",
              "maxLength": 120,
              "description": "botたんに呼んでほしい名前。省略時は未設定＝表示名で呼ばれる。",
              "maxGraphemes": 40
            },
            "readPositions": {
              "type": "array",
              "items": {
                "ref": "#readPosition",
                "type": "ref"
              }
            },
            "emojiFavorites": {
              "type": "array",
              "items": {
                "type": "unknown"
              },
              "maxLength": 32,
              "description": "お気に入り絵文字パレット。表示順そのまま。要素は #unicodeFavorite または #customFavorite。"
            },
            "feedTabsUpdatedAt": {
              "type": "string",
              "format": "datetime",
              "description": "省略時は、この利用者がまだ一度もタブをカスタムしていないことを表す（クライアントは既定タブを使う）。"
            },
            "emojiFavoritesUpdatedAt": {
              "type": "string",
              "format": "datetime",
              "description": "省略時は、この利用者のお気に入りがまだ一度も同期されていないことを表す。"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "端末をまたいで同期する本人の設定（my Nagi の既読位置とお気に入り絵文字）を返す。他ユーザーからは参照できない。"
    },
    "feedTab": {
      "type": "object",
      "required": [
        "id",
        "kind"
      ],
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 64
        },
        "uri": {
          "type": "string",
          "format": "at-uri",
          "maxLength": 2048,
          "description": "kind が channel のときのチャンネル。"
        },
        "kind": {
          "type": "string",
          "maxLength": 32,
          "knownValues": [
            "list",
            "global",
            "custom",
            "channel",
            "search"
          ]
        },
        "label": {
          "type": "string",
          "maxLength": 64,
          "description": "表示名のスナップショット。権威は uri / query 側。"
        },
        "query": {
          "type": "string",
          "maxLength": 128,
          "description": "kind が search のときの保存クエリ。"
        },
        "source": {
          "type": "string",
          "maxLength": 32,
          "description": "kind が list / custom のときの参照先（list=home, custom=affirmation）。将来のユーザー定義フィードは uri で指す。",
          "knownValues": [
            "home",
            "affirmation"
          ]
        },
        "queryKind": {
          "type": "string",
          "maxLength": 32,
          "knownValues": [
            "keyword",
            "tag"
          ]
        }
      },
      "description": "フィードのタブ1枚。必要なフィールドは kind ごとに異なる（list / custom は source、channel は uri、search は query）。"
    },
    "readPosition": {
      "type": "object",
      "required": [
        "section",
        "indexedAt",
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri",
          "maxLength": 2048
        },
        "section": {
          "type": "string",
          "maxLength": 32,
          "knownValues": [
            "bot",
            "community",
            "list",
            "channels",
            "news"
          ]
        },
        "indexedAt": {
          "type": "string",
          "format": "datetime"
        }
      },
      "description": "「ここまで読んだ」位置。新旧の比較は (indexedAt, uri) の辞書順で行う。"
    },
    "customFavorite": {
      "type": "object",
      "required": [
        "kind",
        "emoji"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "custom"
        },
        "emoji": {
          "type": "unknown"
        }
      },
      "description": "Bluemoji のスナップショット。url などは表示のたびに再解決されるので、権威は uri のみ。"
    },
    "unicodeFavorite": {
      "type": "object",
      "required": [
        "kind",
        "emoji"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "unicode"
        },
        "emoji": {
          "type": "string",
          "maxLength": 64
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
