> For the complete documentation index, see [llms.txt](https://docs.wornoffkeys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wornoffkeys.com/commands/required-permissions.md).

# Required permissions

{% embed url="<https://youtu.be/_67r4wq23BA?t=320>" %}

You may want your commands to only be ran by users who have specific Discord permissions. This is often useful for administration commands.

Using WOKCommands you can easily specify what Discord permissions users need to run the command:

{% tabs %}
{% tab title="JavaScript" %}
{% code title="ping.js" %}

```javascript
const { PermissionFlagsBits } = require("discord.js");
const { CommandType } = require("wokcommands");

module.exports = {
  description: "Ping pong command",

  type: CommandType.BOTH,

  permissions: [PermissionFlagsBits.Administrator],

  callback: () => {
    return {
      content: "Pong!",
    };
  },
};
```

{% endcode %}
{% endtab %}

{% tab title="TypeScript" %}
{% code title="ping.ts" %}

```typescript
import { PermissionFlagsBits } from "discord.js";
import { CommandObject, CommandType, CooldownTypes } from "wokcommands";

export default {
  description: "Ping pong command",

  type: CommandType.BOTH,

  permissions: [PermissionFlagsBits.Administrator],

  callback: () => {
    return {
      content: "Pong!",
    };
  },
} as CommandObject;
```

{% endcode %}
{% endtab %}
{% endtabs %}
