# Global Variables

{% hint style="warning" %}
If you declare a variable with the same name or reset the value, the global variable will be overwritten with the defined value.
{% endhint %}

## Global Variables - Boolean

<table><thead><tr><th width="138">Variable</th><th width="104">Value</th><th>Usage</th></tr></thead><tbody><tr><td>animated</td><td>true</td><td>Typically used to set the emoji to animated</td></tr><tr><td>disabled</td><td>true</td><td>Typically used to set the component to disabled</td></tr><tr><td>ephemeral</td><td>true</td><td>Typically used to set the message to ephemeral</td></tr><tr><td>fetchReply</td><td>true</td><td>Typically used to fetch the message from an interaction</td></tr><tr><td>inline</td><td>true</td><td>Typically used to set fields inline into an embed</td></tr><tr><td>required</td><td>true</td><td>Typically used to set the component/option is required</td></tr></tbody></table>

{% tabs %}
{% tab title="Code Example" %}

```typescript
// Before
await interaction.reply({
   content: "Hello World 😀",
   ephemeral: true
});

// After
await interaction.reply({
   content: "Hello World 😀",
   ephemeral
});
```

```typescript
console.log(disabled); // true
const disabled = false;
console.log(disabled); // false
```

```typescript
console.log(inline); // true
inline = false;
console.log(inline); // false
```

{% endtab %}
{% endtabs %}

## Variable - sleep

{% tabs %}
{% tab title="TypeScript" %}

```typescript
import { setTimeout as sleep } from "node:timers/promises";

(async () => {
  console.log("1");
  await sleep(5000); // Pause the code for 5 seconds
  console.log("2");
})();
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const { setTimeout: sleep } = require("node:timers/promises");

(async () => {
  console.log("1");
  await sleep(5000); // Pause the code for 5 seconds
  console.log("2");
})();
```

{% endtab %}

{% tab title="djs-protofy" %}

```typescript
// import or require is not required here;

(async () => {
  console.log("1");
  await sleep(5000); // Pause the code for 5 seconds
  console.log("2");
})();
```

{% endtab %}
{% endtabs %}
