# DmOnly

`function` in `core` · v0.7.0

<https://docs.seedcord.org/packages/core/0.7.0/functions/dm-only>

Passes in a direct message, else refuses.

Agnostic, fitting any handler kind. The inverse of [`GuildOnly`](/packages/core/0.7.0/functions/guild-only), so combining the two in an [`and`](/packages/core/0.7.0/functions/and) can never pass.

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

Passes in a direct message, else refuses.

Agnostic, fitting any handler kind. The inverse of [`GuildOnly`](/packages/core/0.7.0/functions/guild-only), so combining the two in an [`and`](/packages/core/0.7.0/functions/and) can never pass.

Parameters.

- `options?` `GateNoticeOptions` — Reword the default refusal with `message`, or replace it with `notice`.

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