# LinkedRolesOptions

`interface` in `plugin-linked-roles` · v0.1.0

<https://seedcord.org/docs/packages/plugin-linked-roles/0.1.0/interfaces/linked-roles-options>

What [`with`](/docs/packages/plugin-linked-roles/0.1.0/classes/linked-roles#with) takes.

```ts
interface LinkedRolesOptions<
    TRecords extends LinkedRoleRecords,
    TScopes extends OAuthScope = never,
    TKeep extends boolean = false
>
```

## Properties

### keepTokens

```ts
keepTokens?: TKeep | undefined
```

Saves each user's tokens in your bot's `kv` so you can update their values later. This needs a `kv`
driver that saves to a file or a database. Leave it out when a user's values never change after
they connect.

### onResult

```ts
onResult?: ((result: LinkedRolesResult, request: Request) => Promisable<Response>) | undefined
```

Returns the page that a visitor gets after the callback route, for every `kind` of
[`LinkedRolesResult`](/docs/packages/plugin-linked-roles/0.1.0/types/linked-roles-result). Without it, they get a plain page that says what happened.

### records

```ts
records: TRecords & RecordProblems<TRecords>;
```

The values that a server can set role requirements on, by key. Discord takes 5 at most.

### scopes

```ts
scopes?: readonly TScopes[] | undefined
```

Scopes to request when a user connects, like `'connections'` to read their GitHub account. The
plugin always adds `identify` and `role_connections.write`.

## Methods

### values

```ts
values(
    connecting: ConnectingUser<TScopes>
): Promisable<RoleConnection<TRecords> | Refusal>
```

Returns a user's value for every record. Return `{ refuse: 'your message' }` to refuse them, like
when they have to do something in your bot first. The plugin shows them the message and doesn't write
anything.
