> For the complete documentation index, see [llms.txt](https://away-from-keyboard.gitbook.io/afkhandler/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://away-from-keyboard.gitbook.io/afkhandler/methods/setcooldown.md).

# setCooldown

Sets a cooldown

*public* setCooldown(**name**: string, **guild**: [Guild](https://discord.js.org/#/docs/main/stable/class/Guild), **user**: [User](https://discord.js.org/#/docs/main/stable/class/User) | [GuildMember](https://discord.js.org/#/docs/main/stable/class/GuildMember), **timer**: string | number): [this](/afkhandler/classes/afkhandler.md)

* **name**: command name for cooldown
* **guild**: guild where the cooldown is
* **user**: what user will receive the cooldown
* **timer**: how much time will be the cooldown

```javascript
const guild = await client.guilds.fetch("4653644376432423")
const user = await client.users.fetch("65438525554545655")

client.setCooldown("ping", guild, user, "7d 5h 30m 20s")
```
