{
  "id": "twitch",
  "channels": [
    "twitch"
  ],
  "channelEnvVars": {
    "twitch": [
      "OPENCLAW_TWITCH_ACCESS_TOKEN"
    ]
  },
  "configSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {}
  },
  "channelConfigs": {
    "twitch": {
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "anyOf": [
          {
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "markdown": {
                    "type": "object",
                    "properties": {
                      "tables": {
                        "type": "string",
                        "enum": [
                          "off",
                          "bullets",
                          "code",
                          "block"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string"
                  },
                  "accessToken": {
                    "type": "string"
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "minLength": 1
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "allowFrom": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "allowedRoles": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "moderator",
                        "owner",
                        "vip",
                        "subscriber",
                        "all"
                      ]
                    }
                  },
                  "requireMention": {
                    "type": "boolean"
                  },
                  "responsePrefix": {
                    "type": "string"
                  },
                  "clientSecret": {
                    "type": "string"
                  },
                  "refreshToken": {
                    "type": "string"
                  },
                  "expiresIn": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "obtainmentTimestamp": {
                    "type": "number"
                  }
                },
                "required": [
                  "username",
                  "accessToken",
                  "channel"
                ],
                "additionalProperties": false
              }
            ]
          },
          {
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "markdown": {
                    "type": "object",
                    "properties": {
                      "tables": {
                        "type": "string",
                        "enum": [
                          "off",
                          "bullets",
                          "code",
                          "block"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "accounts": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "username": {
                          "type": "string"
                        },
                        "accessToken": {
                          "type": "string"
                        },
                        "clientId": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string",
                          "minLength": 1
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "allowFrom": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "allowedRoles": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "moderator",
                              "owner",
                              "vip",
                              "subscriber",
                              "all"
                            ]
                          }
                        },
                        "requireMention": {
                          "type": "boolean"
                        },
                        "responsePrefix": {
                          "type": "string"
                        },
                        "clientSecret": {
                          "type": "string"
                        },
                        "refreshToken": {
                          "type": "string"
                        },
                        "expiresIn": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "obtainmentTimestamp": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "username",
                        "accessToken",
                        "channel"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "accounts"
                ],
                "additionalProperties": false
              }
            ]
          }
        ]
      },
      "label": "Twitch",
      "description": "Twitch chat integration"
    }
  }
}
