# SERVER EXPORTS

<details>

<summary>GalleryMedia Structure</summary>

```
{
  "id": 123,
  "type": "image",
  "url": "[https://example.com/image.jpg](https://example.com/image.jpg)",
  "thumbnail": "[https://example.com/thumb.jpg](https://example.com/thumb.jpg)",
  "favorite": false,
  "albumId": null,
  "createdAt": 1678900000
}
```

</details>

### Save Media (By Source)

Saves a photo or video to the player's gallery using their Server ID (Source).

{% code overflow="wrap" lineNumbers="true" %}

```lua
local result = exports["17mov_Phone"]:Gallery_SaveMediaBySrc(src, type, url)
```

{% endcode %}

**Returns:**

* `table`: `{ success: boolean, data: GalleryMedia }`

<table><thead><tr><th width="123" align="center">Argument</th><th width="140" align="center">Type</th><th width="107" align="center">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">src</td><td align="center"><code>number</code></td><td align="center">❌</td><td>The player's server ID (source).</td></tr><tr><td align="center">type</td><td align="center"><code>photo | video</code></td><td align="center">❌</td><td>Type of media</td></tr><tr><td align="center">url</td><td align="center"><code>string</code></td><td align="center">❌</td><td>Direct URL to the image or video file.</td></tr></tbody></table>

### Save Media (By Number)

Saves a photo or video to the player's gallery using their phone number.

{% code overflow="wrap" lineNumbers="true" %}

```lua
local result = exports["17mov_Phone"]:Gallery_SaveMediaByNumber(number, type, url)
```

{% endcode %}

**Returns:**

* `table`: `{ success: boolean, data: GalleryMedia }`

<table><thead><tr><th width="118" align="center">Argument</th><th width="140" align="center">Type</th><th width="107" align="center">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">number</td><td align="center"><code>number</code></td><td align="center">❌</td><td>The player's phone number.</td></tr><tr><td align="center">type</td><td align="center"><code>photo | video</code></td><td align="center">❌</td><td>Type of media</td></tr><tr><td align="center">url</td><td align="center"><code>string</code></td><td align="center">❌</td><td>Direct URL to the image or video file.</td></tr></tbody></table>

### Delete Media (By Source)

Deletes specific media from the player's gallery using their Server ID (Source).

{% code overflow="wrap" lineNumbers="true" %}

```lua
local success = exports["17mov_Phone"]:Gallery_DeleteMediaBySrc(src, mediaId)
```

{% endcode %}

**Returns:**

* `boolean`: `true` if deletion was successful.

<table><thead><tr><th width="118" align="center">Argument</th><th width="188" align="center">Type</th><th width="105" align="center">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">src</td><td align="center"><code>number</code></td><td align="center">❌</td><td>The player's server ID (source).</td></tr><tr><td align="center">mediaId</td><td align="center"><code>number | number[]</code></td><td align="center">❌</td><td>The id of media</td></tr></tbody></table>

### Delete Media (By Number)

Deletes specific media from the player's gallery using their phone number.

{% code overflow="wrap" lineNumbers="true" %}

```lua
local success = exports["17mov_Phone"]:Gallery_DeleteMediaByNumber(src, mediaId)
```

{% endcode %}

**Returns:**

* `boolean`: `true` if deletion was successful.

<table><thead><tr><th width="118" align="center">Argument</th><th width="188" align="center">Type</th><th width="105" align="center">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">src</td><td align="center"><code>number</code></td><td align="center">❌</td><td>The player's phone number.</td></tr><tr><td align="center">mediaId</td><td align="center"><code>number | number[]</code></td><td align="center">❌</td><td>The id of media</td></tr></tbody></table>

### Fetch All Media (By Source)

Retrieves all media items from a player's gallery using their Server ID (Source).

{% code overflow="wrap" lineNumbers="true" %}

```lua
local mediaList = exports["17mov_Phone"]:Gallery_FetchAllMediaBySrc(src)
```

{% endcode %}

**Returns:**

* `GalleryMedia[]`: An array of media objects.

<table><thead><tr><th width="125" align="center">Argument</th><th width="121" align="center">Type</th><th width="110" align="center" valign="top"></th><th></th></tr></thead><tbody><tr><td align="center">src</td><td align="center"><code>number</code></td><td align="center" valign="top">❌</td><td>The player's server ID (source).</td></tr></tbody></table>

### Fetch All Media (By Number)

Retrieves all media items from a player's gallery using their phone number.

{% code overflow="wrap" lineNumbers="true" %}

```lua
local mediaList = exports["17mov_Phone"]:Gallery_FetchAllMediaByNumber(number)
```

{% endcode %}

**Returns:**

* `GalleryMedia[]`: An array of media objects.

<table><thead><tr><th width="125" align="center">Argument</th><th width="121" align="center">Type</th><th width="110" align="center" valign="top">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">src</td><td align="center"><code>number</code></td><td align="center" valign="top">❌</td><td>The player's phone number.</td></tr></tbody></table>
