# Doc

## Properties

| Property    | Description                                                           | Type                                                                                                                                                                                  |
| ----------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| data        | Raw data                                                              | Object                                                                                                                                                                                |
| client      | Client                                                                | [Client](/documentation/select-version/v.0.1.7/components/client.md)                                                                                                                  |
| id          | ID of the doc                                                         | Number                                                                                                                                                                                |
| guildID     | Guild/server id                                                       | String                                                                                                                                                                                |
| channelID   | ID of the 'docs' channel.                                             | String                                                                                                                                                                                |
| title       | Doc title/name                                                        | String                                                                                                                                                                                |
| name        | Doc title/name                                                        | String                                                                                                                                                                                |
| content     | Content of the doc                                                    | String                                                                                                                                                                                |
| mentions    | Doc mentions                                                          | Object ([<mark style="color:purple;">MentionsType</mark>](https://github.com/DinographicPixels/touchguild-docs/blob/main/documentation/select-version/v.0.1.7/types/mentionstype.md)) |
| \_createdAt | Timestamp (unix epoch time) of the doc's creation.                    | Number\|null                                                                                                                                                                          |
| memberID    | ID of the member who created the doc.                                 | String                                                                                                                                                                                |
| \_updatedAt | Timestamp (unix epoch time) of when the doc was updated. (if updated) | Number\|null                                                                                                                                                                          |
| updatedBy   | ID of the member who updated the doc. (if updated)                    | String                                                                                                                                                                                |
| member      | Member that made emit the event.                                      | [Member](/documentation/select-version/v.0.1.7/components/member.md)                                                                                                                  |
| createdAt   | String representation of the \_createdAt timestamp.                   | Date\|null                                                                                                                                                                            |
| updatedAt   | String representation of the \_updatedAt timestamp.                   | Date\|null                                                                                                                                                                            |

## Constructor

```javascript
new Doc(rawData, client)
```

| Properties | Description                                     | Type                                                                 | Required? |
| ---------- | ----------------------------------------------- | -------------------------------------------------------------------- | --------- |
| rawData    | raw data received from ws and converted to JSON | Object                                                               | true      |
| client     | Client                                          | [Client](/documentation/select-version/v.0.1.7/components/client.md) | true      |

{% hint style="danger" %}
Do not use this constructor unless you know what you're doing. This constructor is used to return you rawdata into component.
{% endhint %}

## Methods

### edit(options)

Edit the doc.

| Properties       | Description     | Type   | Required? |
| ---------------- | --------------- | ------ | --------- |
| options          | Edit options    | Object | true      |
| options.title?   | New doc title   | String | false     |
| options.content? | New doc content | String | false     |

> Returns: <mark style="color:purple;">Promise<</mark>[<mark style="color:purple;">Doc</mark>](/documentation/select-version/v.0.1.7/components/doc.md)<mark style="color:purple;">></mark>

### delete()

Delete the doc.

> Returns: <mark style="color:purple;">Promise\<void></mark>


---

# 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://legacy.docs.touchguild.com/documentation/select-version/v.0.1.7/components/doc.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.
