# OwnerOnly

`function` in `core` · v0.12.0

<https://seedcord.org/docs/packages/core/0.12.0/functions/owner-only>

Passes only for a user id listed in `config.ownerIds`, else refuses.

Agnostic, so it attaches to interaction and event handlers alike. With no `ownerIds` configured it refuses every caller. Pass a Notice class as `notice` to replace the refusal.

```ts
OwnerOnly(
    options?: GateNoticeOptions
): Gate<GateContextBase, "OwnerOnly">
```

Passes only for a user id listed in `config.ownerIds`, else refuses.

Agnostic, so it attaches to interaction and event handlers alike. With no `ownerIds` configured it refuses every caller. Pass a Notice class as `notice` to replace the refusal.

Parameters.

- `options?` `GateNoticeOptions` — Replace the refusal with a Notice class as `notice`.

Returns `Gate<GateContextBase, 'OwnerOnly'>`.
