Skip to content
Functioncorev0.14.0

DmOnly

Passes in a direct message, else refuses.

Agnostic, fitting any handler kind. The inverse of GuildOnly, so combining the two in an and can never pass.

See also:the @Gated decorator from your transport package

DmOnly(
    options?: GateNoticeOptions
): Gate<GateContextBase, "DmOnly">
\@Gated(DmOnly())
\@SlashRoute('verify')
class VerifyHandler extends SlashHandler<'verify'> {
    async execute() {
        // ...
    }
}

options?

Replace the refusal with a Notice class as notice.