Skip to content

Commit 2998322

Browse files
authored
Merge pull request #67 from m1-dev/next
docs: update cooldowns validation example
2 parents b09dd9c + 2caef04 commit 2998322

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/docs/pages/guide/validation-file-setup.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Validation functions are called on every command trigger, so it's important to k
1515
<Tabs items={['CommonJS', 'ESM', 'TypeScript']}>
1616
<Tabs.Tab label="CommonJS">
1717
```js filename="validations/cooldowns.js" copy
18-
const cooldowns = require('../cooldowns-cache');
18+
const cooldowns = new Set();
1919

2020
module.exports = ({ interaction, commandObj, handler }) => {
2121
if (cooldowns.has(`${interaction.user.id}-${commandObj.data.name}`)) {
@@ -32,7 +32,7 @@ Validation functions are called on every command trigger, so it's important to k
3232

3333
<Tabs.Tab label="ESM">
3434
```js filename="validations/cooldowns.js" copy
35-
import cooldowns from '../cooldowns-cache';
35+
const cooldowns = new Set();
3636

3737
export default function ({ interaction, commandObj, handler }) {
3838
if (cooldowns.has(`${interaction.user.id}-${commandObj.data.name}`)) {
@@ -50,7 +50,7 @@ Validation functions are called on every command trigger, so it's important to k
5050
<Tabs.Tab label="TypeScript">
5151
```ts filename="validations/cooldowns.ts" copy
5252
import type { ValidationProps } from 'commandkit';
53-
import cooldowns from '../cooldowns-cache';
53+
const cooldowns = new Set();
5454

5555
export default function ({ interaction, commandObj, handler }: ValidationProps) {
5656
if (cooldowns.has(`${interaction.user.id}-${commandObj.data.name}`)) {

0 commit comments

Comments
 (0)