# Test servers

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

You may want some commands to only be enabled in specific servers/guilds for testing. This will give you a good idea if something is working in a production environment without risking bugs for your other users.

You can easily specify a command as a "test only" command like so:

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

```javascript
const { CommandType } = require("wokcommands");

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

  type: CommandType.BOTH,

  testOnly: true,

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

{% endcode %}
{% endtab %}

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

```typescript
const { CommandType } = require("wokcommands");

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

  type: CommandType.BOTH,

  testOnly: true,

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

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

You can then specify any amount of server/guild IDs when initializing WOKCommands like so:

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

```javascript
const path = require("path");
const WOK = require("wokcommands");
require("dotenv/config");

const client = new Client({
  intents: [
    IntentsBitField.Flags.Guilds,
    IntentsBitField.Flags.GuildMessages,
    IntentsBitField.Flags.DirectMessages,
    IntentsBitField.Flags.MessageContent,
  ],
  partials: [Partials.Channel],
});

client.on("ready", () => {
  console.log("The bot is ready");

  new WOK({
    client,
    commandsDir: path.join(__dirname, "commands"),
    testServers: ["Server_id_here"],
  });
});

client.login(process.env.TOKEN);
```

{% endcode %}
{% endtab %}

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

```typescript
import { Client, IntentsBitField, Partials } from "discord.js";
import path from "path";
import WOK from "wokcommands";
require("dotenv/config");

const client = new Client({
  intents: [
    IntentsBitField.Flags.Guilds,
    IntentsBitField.Flags.GuildMessages,
    IntentsBitField.Flags.DirectMessages,
    IntentsBitField.Flags.MessageContent,
  ],
  partials: [Partials.Channel],
});

client.on("ready", () => {
  console.log("The bot is ready");

  new WOK({
    client,
    commandsDir: path.join(__dirname, "commands"),
    testServers: ["Server_id_here"],
  });
});

client.login(process.env.TOKEN);
```

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wornoffkeys.com/commands/test-servers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
