# CooldownOptions

`interface` in `seedcord` · v0.13.0

<https://docs.seedcord.org/packages/seedcord/0.13.0/interfaces/cooldown-options>

Options for [`Cooldown`](/packages/seedcord/0.13.0/functions/cooldown). `per` sets the bucket the window applies to and `limit` the uses allowed per window. `message` rewords the refusal and `notice` replaces it, both receiving the epoch ms the key frees up so the refusal can show the retry time.

```ts
interface CooldownOptions
```

## Examples

```ts
// one use per channel, rewording the refusal with the retry time
Cooldown('10s', {
    per: 'channel',
    message: (expires) => `Slow down. Try again <t:${Math.round(expires / 1000)}:R>.`
});
```

```ts
// five uses per minute, per user
Cooldown('1m', { limit: 5 });
```

## Properties

### limit

```ts
limit: number;
```

Uses allowed inside one window before the gate refuses.

### message

```ts
message: (expires: EpochMs) => string;
```

Reword the refusal, keeping the standard notice card. Receives the epoch ms the key frees up, so the text can include the retry time with `<t:${Math.round(expires / 1000)}:R>`.

### notice

```ts
notice: (expires: EpochMs) => Notice;
```

Replace the refusal Notice entirely, for full control or a translated copy. Receives the epoch ms the key frees up.

### per

```ts
per: "user" | "guild" | "channel";
```

The bucket the cooldown window applies to. 'user' scopes by user ID, 'guild' scopes by guild ID (falls back to global if no guild), and 'channel' scopes by channel ID (falls back to global if no channel). If your handler can run in DMs and you want a per-user cooldown, use 'user' and it won't charge a shared global bucket for users without IDs.
