# Client

## Properties

| Property    | Description                                                                   | Type                                                                     |
| ----------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| params      | The bot's options you set when you're creating a new client. (includes token) | Object                                                                   |
| identifiers | Names of all standard Guilded events and their equivalent in simple types.    | Object                                                                   |
| ws          | The WebSocket manager used to connect to the API.                             | WSManager                                                                |
| cache       | The client's cache, used for storing things such as message contents          | Map                                                                      |
| calls       | --                                                                            | --                                                                       |
| token       | The bot's inserted token.                                                     | String                                                                   |
| user        | Logged bot's user.                                                            | [UserClient](/documentation/select-version/v.0.1.7/components/user-1.md) |

## Constructor

```javascript
new Client(params)
```

| Properties   | Description                                            | Type    | Required? |
| ------------ | ------------------------------------------------------ | ------- | --------- |
| params       | Client's parameters/options.                           | Object  | true      |
| params.token | Bot's token                                            | String  | true      |
| params.REST  | Enable/disable REST methods, it is enabled by default. | Boolean | false     |

## Methods

{% hint style="info" %}
Client have standard event emitter types, they're not listed there.
{% endhint %}

### connect()

Connects your bot to the Guilded API.

### disconnect(crashOnDisconnect?)

Disconnect the client from the Guilded API.

| Properties         | Description                                                                                                        | Type    |
| ------------------ | ------------------------------------------------------------------------------------------------------------------ | ------- |
| crashOnDisconnect? | <p>If true, it'll crash when executing the method. If false, it'll only log the action.</p><p>(default: false)</p> | Boolean |

### getRESTChannel(channelID)

Get a specific channel's information.

| Properties | Description                          | Type   |
| ---------- | ------------------------------------ | ------ |
| channelID  | id of the channel you'd like to get. | String |

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

### getRESTMember(guildID, memberID)

Get a specific guild's/server's member.

| Properties | Description      | Type   |
| ---------- | ---------------- | ------ |
| guildID    | id of the server | String |
| memberID   | id of the user   | String |

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

### getRESTGuild(guildID)

Get a specific guild/server.

| Properties | Description      | Type   |
| ---------- | ---------------- | ------ |
| guildID    | id of the server | String |

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

### getRESTChannelMessages(channelID, filter?)

Get a list channel Message component.

| Properties             | Description                      | Type    |
| ---------------------- | -------------------------------- | ------- |
| channelID              | id of the channel                | String  |
| filter?                | filter channel messages          | Object  |
| filter.before?         | Date-time string                 | String  |
| filter.after?          | Date-time string                 | String  |
| filter.limit?          | Limit the channel message output | Number  |
| filter.includePrivate? | Include private messages or not  | Boolean |

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

### getRESTChannelDocs(channelID, filter?)

Get a list of channel Doc component.

| Properties     | Description                  | Type   |
| -------------- | ---------------------------- | ------ |
| channelID      | id of the channel            | String |
| filter?        | filter channel docs          | Object |
| filter.before? | Date-time string             | String |
| filter.limit?  | Limit the channel doc output | Number |

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

### getRESTChannelDoc(channelID, docID)

Get a specific channel doc.

| Properties | Description       | Type   |
| ---------- | ----------------- | ------ |
| channelID  | id of the channel | String |
| docID      | id of the doc     | Number |

> 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>

### getRESTForumTopics(channelID, filter?)

Get a list of ForumTopic component.

| Properties     | Description                                           | Type   |
| -------------- | ----------------------------------------------------- | ------ |
| channelID      | id of the forum channel                               | String |
| filter?        | filter forum topics                                   | Object |
| filter.before? | Date-time string                                      | String |
| filter.limit?  | Limit the forum topic output (improves response time) | Number |

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

### getRESTForumTopic(channelID, topicID)

Get a specific ForumTopic component

| Properties | Description             | Type   |
| ---------- | ----------------------- | ------ |
| channelID  | id of the forum channel | String |
| topicID    | id of the forum topic   | Number |

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

### getRESTTopicComments(channelID, topicID)

Get a list of ForumTopicComment component.

| Properties | Description                 | Type   |
| ---------- | --------------------------- | ------ |
| channelID  | id of the forum channel     | String |
| topicID    | id of the forum topic topic | Number |

> Returns: <mark style="color:purple;">Promise\<Array<</mark>[<mark style="color:purple;">ForumTopicComment</mark>](/documentation/select-version/v.0.1.7/components/forumtopic-1.md)<mark style="color:purple;">>></mark>

### getRESTTopicComment(channelID, topicID, commentID)

Get a specific ForumTopicComment component

| Properties | Description                 | Type   |
| ---------- | --------------------------- | ------ |
| channelID  | id of the forum channel     | String |
| topicID    | id of the forum topic topic | Number |
| commentID  | id of the topic comment     | Number |

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

### getRESTCalendarEvents(channelID, filter?)

Get a list of CalendarEvent component

| Properties     | Description                     | Type   |
| -------------- | ------------------------------- | ------ |
| channelID      | id of the channel               | String |
| filter?        | filter calendar events          | Object |
| filter.before? | Date-time string                | String |
| filter.after?  | Date-time string                | String |
| filter.limit?  | Limit the calendar event output | Number |

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

### getRESTCalendarEvent(channelID, eventID)

Get a specific calendar event component

| Properties | Description                            | Type   |
| ---------- | -------------------------------------- | ------ |
| channelID  | id of the channel containing the event | String |
| eventID    | id of the event                        | Number |

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

### getRESTCalendarRsvps(channelID, eventID)

Get a list of calendar event rsvp

| Properties | Description                            | Type   |
| ---------- | -------------------------------------- | ------ |
| channelID  | id of the channel containing the event | String |
| eventID    | id of the event                        | Number |

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

### getRESTCalendarRsvp(channelID, eventID, memberID)

Get a specific calendar event rsvp

| Properties | Description                            | Type   |
| ---------- | -------------------------------------- | ------ |
| channelID  | id of the channel containing the event | String |
| eventID    | id of the event                        | Number |
| memberID   | id of the member                       | String |

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

### getRESTListItem(channelID, itemID)

Get a specific item from a list channel.

| Properties | Description                                | Type   |
| ---------- | ------------------------------------------ | ------ |
| channelID  | id of the channel containing the list item | String |
| itemID     | id of the item                             | String |

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

### getRESTListItems(channelID)

Get a list of ListItem from a list channel.

| Properties | Description                                 | Type   |
| ---------- | ------------------------------------------- | ------ |
| channelID  | id of the channel containing the list items | String |

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

### getRESTGuildWebhook(guildID, webhookID)

Get a guild webhook.

| Properties | Description       | Type   |
| ---------- | ----------------- | ------ |
| guildID    | id of the guild   | String |
| webhookID  | id of the webhook | String |

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

### getRESTChannelWebhooks(guildID, channelID)

Get a list of webhook selected from a specific channel.

| Properties | Description       | Type   |
| ---------- | ----------------- | ------ |
| guildID    | id of the guild   | String |
| channelID  | id of the channel | String |

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

### getChannelMessages(channelID, filter?)

Get a list of channel messages, only basic data included.

| Properties             | Description                      | Type    |
| ---------------------- | -------------------------------- | ------- |
| channelID              | id of the channel                | String  |
| filter?                | filter channel messages          | String  |
| filter.before?         | Date-time string                 | String  |
| filter.after?          | Date-time string                 | String  |
| filter.limit?          | Limit the channel mesage output  | Number  |
| filter.includePrivate? | Include private messages or not. | Boolean |

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

{% hint style="warning" %}
Non-REST Methods only returns an object/array, methods and cached information aren't provided.

Be aware that the returned object/array is having Guilded API types and not ours.
{% endhint %}

{% hint style="info" %}
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
{% endhint %}

### getChannelDocs(channelID, filter?)

Get a list of channel docs, only basic data included.

| Properties     | Description                       | Type   |
| -------------- | --------------------------------- | ------ |
| channelID      | id of the channel containing docs | String |
| filter?        | filter channel docs               | String |
| filter.before? | Date-time string                  | String |
| filter.limit?  | Limit the channel doc output      | Number |

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

{% hint style="warning" %}
Non-REST Methods only returns an object/array, methods and cached information aren't provided.

Be aware that the returned object/array is having Guilded API types and not ours.
{% endhint %}

{% hint style="info" %}
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
{% endhint %}

### getForumTopics(channelID, filter?)

Get a list of forum topic, only basic data included.

| Properties     | Description                               | Type   |
| -------------- | ----------------------------------------- | ------ |
| channelID      | id of the forum channel containing topics | String |
| filter?        | filter forum topics                       | String |
| filter.before? | Date-time string                          | String |
| filter.limit?  | Limit the forum topic output              | Number |

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

{% hint style="warning" %}
Non-REST Methods only returns an object/array, methods and cached information aren't provided.

Be aware that the returned object/array is having Guilded API types and not ours.
{% endhint %}

{% hint style="info" %}
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
{% endhint %}

### getTopicComments(channelID, topicID)

Array of object containing forum topic comments

| Properties | Description             | Type   |
| ---------- | ----------------------- | ------ |
| channelID  | id of the forum channel | String |
| topicID    | id of the forum topic   | Number |

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

{% hint style="warning" %}
Non-REST Methods only returns an object/array, methods and cached information aren't provided.

Be aware that the returned object/array is having Guilded API types and not ours.
{% endhint %}

{% hint style="info" %}
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
{% endhint %}

### getCalendarEvents(channelID, filter?)

Get a list of calendar event, only basic data included.

| Properties     | Description                                  | Type   |
| -------------- | -------------------------------------------- | ------ |
| channelID      | id of the calendar channel containing events | String |
| filter?        | filter calendar events                       | String |
| filter.before? | Date-time string                             | String |
| filter.after?  | Date-time string                             | String |
| filter.limit?  | Limit the calendar event output              | Number |

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

{% hint style="warning" %}
Non-REST Methods only returns an object/array, methods and cached information aren't provided.

Be aware that the returned object/array is having Guilded API types and not ours.
{% endhint %}

{% hint style="info" %}
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
{% endhint %}

### getCalendarRsvps(channelID, eventID)

Get a list of calendar event rsvp, only basic data included.

| Properties | Description                                  | Type   |
| ---------- | -------------------------------------------- | ------ |
| channelID  | id of the calendar channel containing events | String |
| eventID    | id of the calendar event                     | Number |

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

{% hint style="warning" %}
Non-REST Methods only returns an object/array, methods and cached information aren't provided.

Be aware that the returned object/array is having Guilded API types and not ours.
{% endhint %}

{% hint style="info" %}
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
{% endhint %}

### getListItems(channelID)

List of item of the selected list channel, only basic data included.

| Properties | Description                                      | Type   |
| ---------- | ------------------------------------------------ | ------ |
| channelID  | id of the list channel which contains the items. | String |

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

{% hint style="warning" %}
Non-REST Methods only returns an object/array, methods and cached information aren't provided.

Be aware that the returned object/array is having Guilded API types and not ours.
{% endhint %}

{% hint style="info" %}
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
{% endhint %}

### getMemberRoles(guildID, memberID)

Gives you a list of every roles the member has.

| Properties | Description             | Type   |
| ---------- | ----------------------- | ------ |
| guildID    | id of the server/guild  | String |
| memberID   | id of the target member | String |

{% hint style="success" %}
getMemberRoles is the only proposed method to get member's roles, it is because there is nothing to treat, it's just an array of 'roles' which are numbers/int.
{% endhint %}

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

### getChannelWebhooks(guildID, channelID)

Returns you a list of channel webhooks, only basic data included.

| Properties | Description            | Type   |
| ---------- | ---------------------- | ------ |
| guildID    | id of the server/guild | String |
| channelID  | id of the channel      | String |

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

{% hint style="warning" %}
Non-REST Methods only returns an object/array, methods and cached information aren't provided.

Be aware that the returned object/array is having Guilded API types and not ours.
{% endhint %}

{% hint style="info" %}
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
{% endhint %}

### createChannel(location, name, type, options)

Create a channel in a guild, can also be placed in a group or category.

| Properties         | Description                                                                                                                 | Type    | Required? |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------- | ------- | --------- |
| guildID            | id of the guild/server                                                                                                      | Object  | true      |
| name               | new channel's name                                                                                                          | String  | true      |
| type               | new channel's type ("announcement", "chat", "calendar", "forums", "media", "docs", "voice", "list", "scheduling", "stream") | String  | true      |
| options            | new channel's options                                                                                                       | Object  | false     |
| options.topic      | new channel's topic/description.                                                                                            | String  | false     |
| options.isPublic   | --                                                                                                                          | Boolean | false     |
| options.categoryID | locate the channel in a specific category                                                                                   | Number  | false     |
| options.groupID    | locate the channel in a specific group                                                                                      | String  | false     |

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

### createMessage(channelID, options)

Create a message in a specific channel.

| Properties              | Description                                                | Type           | Required? |
| ----------------------- | ---------------------------------------------------------- | -------------- | --------- |
| channelID               | channel's id                                               | String         | true      |
| options                 | message's options                                          | Object         | true      |
| options.content         | message content                                            | String         | false     |
| options.embeds          | message's embeds                                           | Array\<Object> | false     |
| options.replyMessageIds | list of message id to reply                                | Array\<String> | false     |
| options.isSilent        | notify user(s)?                                            | Boolean        | false     |
| options.isPrivate       | message will only be seen by those mentioned or replied to | Boolean        | false     |

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

### editMessage(channelID, messageID, newMessage)

Update a specific message.

| Properties         | Description           | Type           | Required? |
| ------------------ | --------------------- | -------------- | --------- |
| channelID          | channel's id          | String         | true      |
| messageID          | target message id     | String         | true      |
| newMessage         | new message's options | Object         | true      |
| newMessage.content | new message content   | String         | false     |
| newMessage.embeds  | new message's embeds  | Array\<Object> | false     |

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

### deleteMessage(channelID, messageID)

Delete a specific message.

| Properties | Description       | Type   | Required? |
| ---------- | ----------------- | ------ | --------- |
| channelID  | channel's id      | String | true      |
| messageID  | target message id | String | true      |

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

### addMessageReaction(channelID, messageID, reaction)

Add a reaction to a channel message

| Properties | Description       | Type   | Required? |
| ---------- | ----------------- | ------ | --------- |
| channelID  | channel id        | String | true      |
| messageID  | target message id | String | true      |
| reaction   | emote id          | Number | true      |

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

### removeMessageReaction(channelID, messageID, reaction)

Remove a specific reaction from a channel message.

| Properties | Description       | Type   | Required? |
| ---------- | ----------------- | ------ | --------- |
| channelID  | channel id        | String | true      |
| messageID  | target message id | String | true      |
| reaction   | emote id          | Number | true      |

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

### createTopic(channelID, options)

Create a topic in a forum.

| Properties      | Description      | Type   | Required? |
| --------------- | ---------------- | ------ | --------- |
| channelID       | forum channel id | String | true      |
| options         | topic options    | Object | true      |
| options.title   | topic title      | String | true      |
| options.content | topic content    | String | true      |

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

### editTopic(channelID, topicID)

Edit a specific forum topic

| Properties       | Description      | Type   | Required? |
| ---------------- | ---------------- | ------ | --------- |
| channelID        | forum channel id | String | true      |
| topicID          | forum topic id   | Number | true      |
| options          | topic options    | Object | true      |
| options.title?   | topic title      | String | false     |
| options.content? | topic content    | String | false     |

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

### deleteTopic(channelID, topicID)

Delete a specific forum topic

| Properties | Description      | Type   | Required? |
| ---------- | ---------------- | ------ | --------- |
| channelID  | forum channel id | String | true      |
| topicID    | forum topic id   | Number | true      |

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

### pinTopic(channelID, topicID)

Pin a specific forum topic.

| Properties | Description      | Type   | Required? |
| ---------- | ---------------- | ------ | --------- |
| channelID  | forum channel id | String | true      |
| topicID    | forum topic id   | Number | true      |

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

### unpinTopic(channelID, topicID)

Unpin a specific forum topic.

| Properties | Description      | Type   | Required? |
| ---------- | ---------------- | ------ | --------- |
| channelID  | forum channel id | String | true      |
| topicID    | forum topic id   | Number | true      |

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

### lockTopic(channelID, topicID)

Lock a specific forum topic.

| Properties | Description             | Type   |
| ---------- | ----------------------- | ------ |
| channelID  | id of the forum channel | String |
| topicID    | id of the forum topic   | Number |

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

### unlockTopic(channelID, topicID)

Unlock a specific forum topic.

| Properties | Description             | Type   |
| ---------- | ----------------------- | ------ |
| channelID  | id of the forum channel | String |
| topicID    | id of the forum topic   | Number |

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

### addTopicReaction(channelID, topicID, emoteID)

Add a reaction to a specified forum topic

| Properties | Description             | Type   |
| ---------- | ----------------------- | ------ |
| channelID  | id of the forum channel | String |
| topicID    | id of the forum topic   | Number |
| emote      | id of an emote          | Object |

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

### removeTopicReaction(channelID, topicID, emoteID)

Remove a specific reaction from a forum topic.

| Properties | Description             | Type   |
| ---------- | ----------------------- | ------ |
| channelID  | id of the forum channel | String |
| topicID    | id of the forum topic   | Number |
| emote      | id of an emote          | Object |

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

### createTopicComment(channelID, topicID, options)

Add a comment to a specific forum topic.

| Properties      | Description             | Type   |
| --------------- | ----------------------- | ------ |
| channelID       | id of the forum channel | String |
| topicID         | id of the forum topic   | Number |
| options         | create options          | Object |
| options.content | content of the comment  | String |

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

### editTopicComment(channelID, topicID, commentID, options?)

Edit a specific forum topic's comment.

| Properties        | Description                | Type   |
| ----------------- | -------------------------- | ------ |
| channelID         | id of the channel          | String |
| topicID           | id of the forum topic      | Number |
| commentID         | id of the topic comment    | Number |
| options?          | edit options               | Object |
| options?.content? | new content of the comment | String |

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

### deleteTopicComment(channelID, topicID, commentID)

Delete a specific forum topic's comment.

| Properties | Description             | Type   |
| ---------- | ----------------------- | ------ |
| channelID  | id of the channel       | String |
| topicID    | id of the forum topic   | Number |
| commentID  | id of the topic comment | Number |

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

### createDoc(channelID, options)

Create a doc in a docs channel.

| Properties      | Description    | Type   | Required? |
| --------------- | -------------- | ------ | --------- |
| channelID       | doc channel id | String | true      |
| options         | doc options    | Object | true      |
| options.title   | doc title      | String | true      |
| options.content | doc content    | String | true      |

> 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>

### editDoc(channelID, docID, options)

Edit a specific doc.

| Properties       | Description    | Type   | Required? |
| ---------------- | -------------- | ------ | --------- |
| channelID        | doc channel id | String | true      |
| docID            | channel doc id | Number | true      |
| options          | doc options    | Object | true      |
| options.title?   | doc title      | String | false     |
| options.content? | 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>

### deleteDoc(channelID)

Delete a specific channel doc.

| Properties | Description    | Type   | Required? |
| ---------- | -------------- | ------ | --------- |
| channelID  | doc channel id | String | true      |
| docID      | channel doc id | Number | true      |

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

### createCalendarEvent(channelID, options)

Create a calendar event.

| Properties           | Description                     | Type    | Required? |
| -------------------- | ------------------------------- | ------- | --------- |
| channelID            | calendar channel id             | String  | true      |
| options              | calendar event options          | Object  | true      |
| options.name         | event name                      | String  | true      |
| options.description? | event description               | String  | false     |
| options.location?    | event location, can be anything | String  | false     |
| options.startsAt?    | Date-time string                | String  | false     |
| options.url?         | event url                       | String  | false     |
| options.color?       | event color                     | Number  | false     |
| options.rsvpLimit?   | event entry limit               | Number  | false     |
| options.duration?    | event duration in ms            | Number  | false     |
| options.isPrivate?   | --                              | Boolean | false     |

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

### editCalendarEvent(channelID, eventID, options)

Edit a specific calendar event.

| Properties           | Description                     | Type    | Required? |
| -------------------- | ------------------------------- | ------- | --------- |
| channelID            | calendar channel id             | String  | true      |
| eventID              | calendar event id               | Number  | true      |
| options              | calendar event options          | Object  | true      |
| options.name?        | event name                      | String  | false     |
| options.description? | event description               | String  | false     |
| options.location?    | event location, can be anything | String  | false     |
| options.startsAt?    | Date-time string                | String  | false     |
| options.url?         | event url                       | String  | false     |
| options.color?       | event color                     | Number  | false     |
| options.rsvpLimit?   | event entry limit               | Number  | false     |
| options.duration?    | event duration in ms            | Number  | false     |
| options.isPrivate?   | --                              | Boolean | false     |

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

### deleteCalendarEvent(channelID, eventID)

Delete a specific calendar event.

| Properties | Description         | Type   | Required? |
| ---------- | ------------------- | ------ | --------- |
| channelID  | calendar channel id | String | true      |
| eventID    | calendar event id   | Number | true      |

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

### editCalendarRsvp(channelID, eventID, memberID)

Add/edit a specific calendar event RSVP.

| Properties     | Description                                                                            | Type   | Required? |
| -------------- | -------------------------------------------------------------------------------------- | ------ | --------- |
| channelID      | calendar channel id                                                                    | String | true      |
| eventID        | calendar event id                                                                      | Number | true      |
| memberID       | rsvp member id                                                                         | String | true      |
| options        | event rsvp options                                                                     | Object | true      |
| options.status | RSVP status ('going' ,'maybe'\|, 'declined', 'invited', 'waitlisted', 'not responded') | String | true      |

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

### deleteCalendarRsvp(channelID, eventID, memberID)

Delete a specific calendar event RSVP.

| Properties | Description           | Type   | Required? |
| ---------- | --------------------- | ------ | --------- |
| channelID  | calendar channel id   | String | true      |
| eventID    | calendar event id     | Number | true      |
| memberID   | rsvp target member id | String | true      |

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

### createListItem(channelID, content, note?)

Create an item within a list channel.

| Properties   | Description                  | Type   | Required? |
| ------------ | ---------------------------- | ------ | --------- |
| channelID    | 'List' channel id.           | String | true      |
| content      | content/message of the list  | String | true      |
| note?        | Note object                  | Object | false     |
| note.content | add a note/edit note content | String | true      |

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

### editListItem(channelID, itemID, content, note?)

Edit a list item.

| Properties   | Description                  | Type   | Required? |
| ------------ | ---------------------------- | ------ | --------- |
| channelID    | 'List' channel id.           | String | true      |
| itemID       | ID of the target item.       | String | true      |
| content      | content/message of the list  | String | true      |
| note?        | Note object                  | Object | false     |
| note.content | add a note/edit note content | String | true      |

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

### completeListItem(channelID, itemID)

Complete (checkmark will show up) a specific item from a list channel.

| Properties | Description            | Type   | Required? |
| ---------- | ---------------------- | ------ | --------- |
| channelID  | 'List' channel id.     | String | true      |
| itemID     | ID of the target item. | String | true      |

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

### uncompleteListItem(channelID, itemID)

Uncomplete (checkmark will disappear) a specific item from a list channel.

| Properties | Description            | Type   | Required? |
| ---------- | ---------------------- | ------ | --------- |
| channelID  | 'List' channel id.     | String | true      |
| itemID     | ID of the target item. | String | true      |

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

### addGuildMemberGroup(groupID, memberID)

Add a Guild Member to a Guild group.

| Properties | Description              | Type   | Required? |
| ---------- | ------------------------ | ------ | --------- |
| groupID    | Guild group id           | String | true      |
| memberID   | ID of the target member. | String | true      |

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

### removeGuildMemberGroup(groupID, memberID)

Remove a Guild Member from a Guild group.

| Properties | Description              | Type   | Required? |
| ---------- | ------------------------ | ------ | --------- |
| groupID    | Guild group id           | String | true      |
| memberID   | ID of the target member. | String | true      |

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

### addGuildMemberRole(guildID, memberID, roleID)

Add a role to a guild member.

| Properties | Description              | Type   | Required? |
| ---------- | ------------------------ | ------ | --------- |
| groupID    | Guild group id           | String | true      |
| memberID   | ID of the target member. | String | true      |
| roleID     | Role to add              | Number | true      |

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

### removeGuildMemberRole(guildID, memberID, roleID)

Remove a role from a guild member.

| Properties | Description              | Type   | Required? |
| ---------- | ------------------------ | ------ | --------- |
| groupID    | Guild group id           | String | true      |
| memberID   | ID of the target member. | String | true      |
| roleID     | Role to add              | Number | true      |

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

### createGuildWebhook(guildID, channelID, name)

Create a new guild channel webhook.

| Properties | Description             | Type   | Required? |
| ---------- | ----------------------- | ------ | --------- |
| guildID    | id of the guild/server  | String | true      |
| channelID  | id of the channel       | String | true      |
| name       | name of the new webhook | String | true      |

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

### editGuildWebhook(guildID, webhookID, options)

Edit a guild webhook.

| Properties         | Description                    | Type   | Required? |
| ------------------ | ------------------------------ | ------ | --------- |
| guildID            | id of the guild/server         | String | true      |
| webhookID          | id of the webhook              | String | true      |
| options            | edit options                   | Object | true      |
| options.name       | new webhook's name             | String | true      |
| options.channelID? | new webhook's channel location | String | false     |

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

### deleteGuildWebhook(guildID, webhookID)

Delete a guild webhok.

| Properties | Description              | Type   | Required? |
| ---------- | ------------------------ | ------ | --------- |
| guildID    | id of the guild/server   | String | true      |
| webhookID  | id of the target webhook | String | true      |

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

### awardMember(guildID, memberID, xpAmount)

Awards a member using the built-in EXP system. (Returns the 'total' experience)

| Properties | Description                                               | Type   |
| ---------- | --------------------------------------------------------- | ------ |
| guildID    | the guild/server id                                       | String |
| memberID   | the guild member id                                       | String |
| xpAmount   | the amount of xp you'd like to give the specified member. | Number |

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

### setMemberXP(guildID, memberID, xpAmount)

Sets a member's xp using the built-in EXP system. (Returns the 'total' experience)

| Properties | Description                                | Type   |
| ---------- | ------------------------------------------ | ------ |
| guildID    | the guild/server id                        | String |
| memberID   | the guild member id                        | String |
| xpAmount   | the new amount of xp the member will have. | Number |

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

### awardRole(guildID, roleID, xpAmount)

Awards all members having a role using the built-in EXP system.

| Properties | Description                                                                 | Type   |
| ---------- | --------------------------------------------------------------------------- | ------ |
| guildID    | the guild/server id                                                         | String |
| roleID     | the role id                                                                 | Number |
| xpAmount   | the amount of xp you'd like to give to everybody having the specified role. | Number |

> 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/client.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.
