> For the complete documentation index, see [llms.txt](https://oliver1308pro.gitbook.io/docs.codestormstudios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oliver1308pro.gitbook.io/docs.codestormstudios/free-assets/redm-assets/css-overwatch/exports.md).

# Exports

If you have other resources that you wish to be able to use information available in zdiscord, you might just be in luck. Here is a list of all the available exports for zdiscord and samples of how to use them in javascript or lua. If you don’t see something you want here submit a feature request or pull request

***

## Exports

<details>

<summary>isRolePresent</summary>

{% hint style="info" %}
Returns a true/false boolean if a role is present for a role id or array of role-ids

This is a ServerOnly Export
{% endhint %}

```javascript
// JAVASCRIPT EXAMPLE
// Source - Discord Role ID
const bool = global.exports.CSS_Overwatch.isRolePresent(global.source, "897991948097433681");

// Discord ID - Array of Roles
const bool = global.exports.CSS_Overwatch.isRolePresent("142831624868855808", [
    "897991948097433681",
    "897991948097433682"
]);
```

```lua
-- LUA EXAMPLE
-- Source - Discord Role ID
local bool = exports.CSS_Overwatch:isRolePresent(source, "897991948097433681");

-- Discord ID - Array of Roles
local bool = exports.CSS_Overwatch:isRolePresent("142831624868855808", {
    "897991948097433681",
    "897991948097433682"
});
```

</details>

<details>

<summary>getDiscordId</summary>

{% hint style="info" %}
Returns a player’s discord id

This is a ServerOnly Export
{% endhint %}

```javascript
// JAVASCRIPT EXAMPLE
const id = global.exports.CSS_Overwatch.getDiscordId(global.source);
```

```lua
-- LUA EXAMPLE
local id = exports.CSS_Overwatch:getDiscordId(source);
```

</details>

<details>

<summary>getRoles</summary>

{% hint style="info" %}
Returns an array of roles for a discord id or source

This is a ServerOnly Export
{% endhint %}

```javascript
// JAVASCRIPT EXAMPLE
// Source
const roles = global.exports.CSS_Overwatch.getRoles(global.source);

// Discord ID
const roles = global.exports.CSS_Overwatch.getRoles("142831624868855808");
```

```lua
-- LUA EXAMPLE
-- Source
local roles = exports.CSS_Overwatch:getRoles(source);

-- Discord ID
local roles = exports.CSS_Overwatch:getRoles("142831624868855808");
```

</details>

<details>

<summary>getName</summary>

{% hint style="info" %}
Returns an string containing the discord name/nickname for a discord id or source

This is a ServerOnly Export
{% endhint %}

```javascript
// JAVASCRIPT EXAMPLE
// Source
const name = global.exports.CSS_Overwatch.getName(global.source);

// Discord ID
const name = global.exports.CSS_Overwatch.getName("142831624868855808");
```

```lua
-- LUA EXAMPLE
-- Source
local name = exports.CSS_Overwatch:getName(source);

-- Discord ID
local name = exports.CSS_Overwatch:getName("142831624868855808");
```

</details>

<details>

<summary>Log</summary>

{% hint style="info" %}
send a message to a configured Log webhook

This is a ServerOnly Export
{% endhint %}

{% hint style="warning" %}
Remember to have this line in the top of your command for it to work

```javascript
const logEvent = require('../addons/log');
```

{% endhint %}

<pre class="language-javascript"><code class="lang-javascript">// JAVASCRIPT EXAMPLE
<strong>// event, message, color (optional) 
</strong>logEvent("additems", `${interaction.member.displayName} Spawnede ${count}x ${item} ind til ${playerName} (${playerId}).`, {
    color: "#00FF00",
});
</code></pre>

```lua
-- LUA EXAMPLE
-- event, message, color (optional) 
logEvent("additems", `${interaction.member.displayName} Spawnede ${count}x ${item} ind til ${playerName} (${playerId}).`, {
    color: "#00FF00",
});
```

</details>
