# Get started

This page is deprecated.

<figure><img src="https://1452565314-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlOPMbaW5t7rQZWQ9C6lG%2Fuploads%2FhqO3NOQkW1uN78swBCZa%2Ftouchguild-cradius.png?alt=media&amp;token=66322b7d-702a-4f0a-a0b4-35aaef1075df" alt=""><figcaption></figcaption></figure>

## This page is an archive and features legacy versions of TouchGuild

## Installation

NodeJS **16.16.0** or higher is required.

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

```bash
npm install touchguild@latest
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn add touchguild@latest
```

{% endtab %}

{% tab title="ppm" %}

```bash
pnpm add touchguild@latest
```

{% endtab %}
{% endtabs %}

## Get started

```javascript
const TouchGuild = require('touchguild'); // import for CommonJS
// import * as TouchGuild from 'touchguild' // import for ESM & TS

const client = new TouchGuild.Client({token: 'insert token here'});

client.on('ready', ()=> {
   console.log(`Logged as ${client.user.username}`);
});

client.on('error', (err)=> {
   console.error("Whoops, somethin' went wrong..", err);
});

client.connect();
```

{% hint style="info" %}
Note: CommonJS, ESM & Typescript are supported.
{% endhint %}

## Development builds (Nightly)

Nightly builds are pre-release builds, they're having new features in real time. Once there's enough features, we're releasing them as a brand new 'stable build'.

<figure><img src="https://1452565314-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlOPMbaW5t7rQZWQ9C6lG%2Fuploads%2FX2VQ3Vhw61pUhdsWjitw%2Ftouchguild%20nightly.png?alt=media&amp;token=b76779ea-203a-4158-92c4-cc5aa6e1fc41" alt=""><figcaption></figcaption></figure>

## Install Nightly builds

You can get new features before the stable release.

### Install the latest Nightly build automatically:

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

```bash
npm install touchguild@nightly
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn add touchguild@nightly
```

{% endtab %}

{% tab title="ppm" %}

```bash
pnpm add touchguild@nightly
```

{% endtab %}
{% endtabs %}

### Install the latest Nightly build manually:

```bash
npm install dinographicpixels/touchguild#nightly
```

1. Run the command
2. Go to `node_modules/touchguild`
3. Run: `npm run build` inside the touchguild folder
4. &#x20;Now, it's ready.

You need to reproduce those steps everytime you update to a newer nightly build.

{% hint style="warning" %}
Be aware that Nightly builds aren't stable and can have still have major bugs. If you face issues, feel free to report it by creating an issue on TouchGuild's GitHub, please specify that you're using a Nightly build.
{% endhint %}

{% hint style="info" %}
You can check [Nightly Features here.](broken://pages/2y3YMGez8os3mIxiaryq)
{% endhint %}

## Additional links:

#### Repository & NPM

* [NPM Package](https://www.npmjs.com/package/touchguild)
* [GitHub](https://github.com/Dinographic/TouchGuild)

#### Guide & documentation

* [Guide](https://guide.touchguild.dinographicpixels.com)
* [Documentation](/documentation/select-version)

#### Additional links

* [Our vision of the project](https://docs.touchguild.dinographicpixels.com/misc/our-vision)
* [FAQ](https://docs.touchguild.dinographicpixels.com/misc/faq)
* [Get started, youtube video](https://www.youtube.com/watch?v=AUaiQRMjJZo)

#### Our servers

* [Our Discord server](https://discord.gg/UgPRaGRkrQ)
* [Our Guilded server](https://www.guilded.gg/i/ExPXPrwE)


# Select version

Select the TouchGuild version you have installed.


# v.0.1.7

Major TouchGuild update, a wide amount of improvement & much more. This update is a big step to the library's development.


# What's new?

Check out what's new.

## New

* **Added** [Lock & unlock forum topic features.](https://github.com/DinographicPixels/TouchGuild/pull/7)
* **All in one** type file, **reorganized types** (does not affect user experience)
* [Guild XP #14](https://github.com/DinographicPixels/TouchGuild/pull/14): Managing Guild Member's XP, including set/award.
* [Adding DevTools to the TouchGuild's index.](https://github.com/DinographicPixels/TouchGuild/pull/15)
* [Added Client.user & Updated WebSocket.](https://github.com/DinographicPixels/TouchGuild/pull/18)
* **Major change:** Integrated API Types into TouchGuild. (affects the whole library, makes the user-experience even better when using Non-REST methods)
* **Added** 'Invalid token' error.
* **Added** TouchGuild's http header
* **Made** scripts better with ESLint.
* **Added** `pkgconfig.ts`, this file provides every information about your current TouchGuild version.
* **Added** `ForumTopicComment` component, this component provides three methods: createTopicComment, edit & delete.
* **Added** a new Client method: `createTopicComment`
* **Added** a new Client method: `editTopicComment`
* **Added** a new Client method: `deleteTopicComment`
* **Added** a new Client method: `getRESTTopicComment`
* **Added** a new Client method: `getRESTTopicComments`
* **Added** a new Client method: `getTopicComments`
* **Added** a new Client method: `addTopicReaction`
* **Added** a new Client method: `removeTopicReaction`
* **Added** a new ForumTopic method: `addReaction`
* **Added** a new ForumTopic method: `removeReaction`
* **Added** a new gateway event: `guildCreate` (fired when bot joins a guild)
* **Added** a new gateway event: `forumTopicCommentCreate`
* **Added** a new gateway event: `forumTopicCommentUpdate`
* **Added** a new gateway event: `forumTopicCommentDelete`
* **Added** a new gateway event: `forumTopicReactionAdd`
* **Added** a new gateway event: `forumTopicReactionRemove`
* **Added** `GuildCreateInfo` types for the `guildCreate` event.
* Cache now **supports** ForumTopic & stores those components when needed.
* Now, every requests uses API Typings, it makes the library more accurate.
* **Added** the following exports: `ForumTopicComment` and `APITypes`

## Updated

* **Fixed**: [messageDelete event: cannot get message.content after deletion. #10](https://github.com/DinographicPixels/TouchGuild/issues/10)
* **Improved**: [Dev to Nightly: Improved web socket. #13](https://github.com/DinographicPixels/TouchGuild/pull/13)
* **Removed** unused imports (does not affect user experience)
* **Fixed**: [Issue while importing TouchGuild on repl.it or other services. (import error) #12](https://github.com/DinographicPixels/TouchGuild/issues/12)
* **Fixed** [ForumTopic.edit() does not work.](https://github.com/DinographicPixels/TouchGuild/issues/26)
* **Fixed** some component typings.
* **Fixed** `replayMissedEvents` not working.
* **Removed** `Types.ts`, replaced by `lib/tg-types/types.ts`
* **Updated** `target` from `ES6` to `ES2022`
* **Reduced** dependencies from 16 to 7!
* **Fixed** circular imports issues caused by Utils (calls).
* **Deleted** `UserClientInfo` (types), replaced by `UserClient` (component).
* **Updated** DevTools, supports retry when server response equals 429.
* **Fixed** `WSManagerParams` typings.
* **Deleted** reactionInfo, **replaced** by **messageReactionInfo** and **forumTopicReactionInfo**
* **Updated** endpoints & **fixed** typos.
* **Updated** identifiers by adding the new gateway events.


# Components

Components are also called Structures in the GitHub repository.


# Client

The Guilded Bot's client, where everything's happen and where the Guilded bot interacts with guilds/servers.

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

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

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


# Channel

The 'Channel' component is a 'GuildChannel' component as for now. This can change in the future by moving some data into an extension of 'Channel'.

## Properties

| Property     | Description                                                                              | Type                                                              |
| ------------ | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| data         | Original channel data.                                                                   | Object                                                            |
| client       | the client that receives the channel data                                                | [Client](/documentation/select-version/v.0.1.7/components/client) |
| id           | id of the channel                                                                        | String                                                            |
| type         | type of the channel                                                                      | String                                                            |
| name         | the name of the channel                                                                  | String                                                            |
| topic        | the topic/description of the channel                                                     | String                                                            |
| \_createdAt  | timestamp that the channel was created at                                                | Number                                                            |
| memberID     | id of the user that created the channel                                                  | String                                                            |
| \_updatedAt  | timestamp that the channel was updated at                                                | Number\|null                                                      |
| guildID      | the id of the server                                                                     | String                                                            |
| parentID     | ID of the parent channel or parent thread, if present. Only relevant for server channels | String                                                            |
| categoryID   | id of the category the channel is in                                                     | String                                                            |
| groupID      | id of the group the channel is in                                                        | String                                                            |
| isPublic     | is the channel public?                                                                   | Boolean                                                           |
| archivedBy   | id of the user that archived the channel                                                 | String                                                            |
| \_archivedAt | timestamp that the channel was archived at                                               | Number                                                            |
| createdAt    | string representation of the \_createdAt timestamp.                                      | Date                                                              |
| updatedAt    | string representation of the \_updatedAt timestamp.                                      | Date\|null                                                        |
| archivedAt   | string representation of the \_archivedAt timestamp.                                     | Date\|null                                                        |

## Constructor

```javascript
new Channel(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) | 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

### createMessage(options)

Create a message in the channel.

| Properties              | Description                                                | Type           | Required? |
| ----------------------- | ---------------------------------------------------------- | -------------- | --------- |
| 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)>

### edit(options)

Update the channel.

| Properties       | Description                    | Type    | Required? |
| ---------------- | ------------------------------ | ------- | --------- |
| options          | edit options                   | Object  | false     |
| options.name     | new channel name               | String  | false     |
| options.topic    | new channel topic/description. | String  | false     |
| options.isPublic | is the channel public?         | Boolean | false     |

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

### delete()

Delete the channel.

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


# Message

The 'Message' component is a 'GuildMessage' component as for now. This can change in the future by moving some data into an extension of 'Message'.

## Properties

| Property              | Description                                                                                                         | Type                                                                                                                                                                                  |
| --------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \_data                | Original message data.                                                                                              | Object                                                                                                                                                                                |
| \_client              | the client that receives the channel data                                                                           | [Client](/documentation/select-version/v.0.1.7/components/client)                                                                                                                     |
| id                    | id of the message                                                                                                   | String                                                                                                                                                                                |
| type                  | type of message ('user' or 'system')                                                                                | String                                                                                                                                                                                |
| channel               | channel where the message has been sent                                                                             | [Channel](/documentation/select-version/v.0.1.7/components/channel)                                                                                                                   |
| member                | message author                                                                                                      | [Member](/documentation/select-version/v.0.1.7/components/member)                                                                                                                     |
| guildID               | id of the message's server                                                                                          | String                                                                                                                                                                                |
| channelID             | id of the message's channel                                                                                         | String                                                                                                                                                                                |
| content               | message content                                                                                                     | String                                                                                                                                                                                |
| embeds                | message's embed(s)                                                                                                  | Array\<Object>                                                                                                                                                                        |
| isPrivate             | is message private? true/false                                                                                      | Boolean                                                                                                                                                                               |
| isSilent              | if the message doesn't notify a user                                                                                | Boolean                                                                                                                                                                               |
| mentions              | Message mentions object                                                                                             | 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 that the message was created at                                                                           | Number                                                                                                                                                                                |
| memberID              | id of the message author                                                                                            | String                                                                                                                                                                                |
| \_updatedAt           | timestamp that the message was updated at                                                                           | Number\|null                                                                                                                                                                          |
| \_deletedAt           | Timestamp (unix epoch time) of the message's deletion.                                                              | Number\|null                                                                                                                                                                          |
| webhookID             | The ID of the webhook who created this message, if it was created by a webhook                                      | String                                                                                                                                                                                |
| replyMessageIds       | List of ids mentioned in the message                                                                                | Array                                                                                                                                                                                 |
| \_lastMessageID       | last message sent with the message itself (cache)                                                                   | String                                                                                                                                                                                |
| \_originalMessageID   | Original message, used to reply this one (cache)                                                                    | String                                                                                                                                                                                |
| \_originalMessageBool | Used by the system to detect if the original message id has been transfered                                         | Boolean                                                                                                                                                                               |
|                       |                                                                                                                     |                                                                                                                                                                                       |
| oldContent            | old message content if edited                                                                                       | String                                                                                                                                                                                |
| createdAt             | string representation of the \_createdAt timestamp.                                                                 | Date                                                                                                                                                                                  |
| updatedAt             | string representation of the \_updatedAt timestamp.                                                                 | Date\|void                                                                                                                                                                            |
| deletedAt             | string representation of the \_deletedAt timestamp.                                                                 | Date\|void                                                                                                                                                                            |
| member                | Get the member component, which returns Member when message guildID and memberID is defined or if Member is cached. | Member\|undefined                                                                                                                                                                     |
| guild                 | Guild component where the message has been sent                                                                     | Guild                                                                                                                                                                                 |
| channel               | Channel component where the message has been sent on                                                                | [Channel](/documentation/select-version/v.0.1.7/components/channel)                                                                                                                   |

## Constructor

```javascript
new Message(rawData, client, params)
```

| 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)   | true      |
| params?                   | Object of params                                    | Object                                                              | false     |
| params.oldMessage?        | old message component, if cached.                   | [Message](/documentation/select-version/v.0.1.7/components/message) | false     |
| params.originalMessageID? | ID of the transfered original message. If existant. | String                                                              | false     |

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

### createMessage(options)

Create a message in the message's channel.

| Properties              | Description                                                | Type           | Required? |
| ----------------------- | ---------------------------------------------------------- | -------------- | --------- |
| 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)>

### edit(newMessage)

Update/edit the message.

| Properties         | Description      | Type   | Required? |
| ------------------ | ---------------- | ------ | --------- |
| newMessage         | edit options     | Object | true      |
| newMessage.content | message content  | String | false     |
| newMessage.embeds  | message's embeds | Object | false     |

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

### delete()

Delete the message.

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

### editLastMessage(newMessage)

Edit the last message sent with the message itself.

| Properties         | Description      | Type   | Required? |
| ------------------ | ---------------- | ------ | --------- |
| newMessage         | edit options     | Object | true      |
| newMessage.content | message content  | String | false     |
| newMessage.embeds  | message's embeds | Object | false     |

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

### deleteLastMessage()

Delete the last message sent with he message itself.

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

### editOriginalMessage(newMessage)

Edit the message's original message, if existant.

| Properties         | Description      | Type   | Required? |
| ------------------ | ---------------- | ------ | --------- |
| newMessage         | edit options     | Object | true      |
| newMessage.content | message content  | String | false     |
| newMessage.embeds  | message's embeds | Object | false     |

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

### deleteOriginalMessage()

Delete the message's original message, if existant.

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

### addReaction(reaction)

Add a reaction to the message.

| Properties | Description | Type   | Required? |
| ---------- | ----------- | ------ | --------- |
| reaction   | reaction id | Number | true      |

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

### removeReaction(reaction)

Remove a specific reaction from the message.

| Properties | Description | Type   | Required? |
| ---------- | ----------- | ------ | --------- |
| reaction   | reaction id | Number | true      |

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


# Guild

The Guild is also known as 'server', it's where everything happen, and where the bot interacts with people/the environment.

## Properties

| Property         | Description                                         | Type         |
| ---------------- | --------------------------------------------------- | ------------ |
| client           | Client                                              | Client       |
| id               | ID of the Guild/server.                             | String       |
| ownerID          | The owner of the guild                              | String       |
| type             | The guild's type                                    | String       |
| name             | Guild name                                          | String       |
| url              | URL of the guild                                    | String       |
| about            | 'About' of the guild (description)                  | String       |
| description      | The guild's description                             | String       |
| about            | Same as 'description'.                              | String       |
| iconURL          | the url of the guild's icon                         | String\|null |
| bannerURL        | the url of the guild's banner                       | String\|null |
| timezone         | the timezone of the guild                           | String       |
| defaultChannelID | the id of the default channel of the guild          | String       |
| \_createdAt      | Timestamp (unix epoch time) of the guild's creation | Number       |
| createdAt        | string representation of the \_createdAt timestamp. | Date         |

## Constructor

```javascript
new Message(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) | 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 %}


# 🙇♂ User

It is the default component for a 'user', it contains every basic information about the user, those can be seen by anyone.

## Properties

| Property    | Description                                         | Type                                                              |
| ----------- | --------------------------------------------------- | ----------------------------------------------------------------- |
| \_client    | Client                                              | [Client](/documentation/select-version/v.0.1.7/components/client) |
| id          | User id                                             | String                                                            |
| type        | Type of user, bot or user                           | String                                                            |
| username    | User's username                                     | String                                                            |
| \_createdAt | Timestamp of the user's creation.                   | Number                                                            |
| avatarURL   | user's avatar url                                   | String\|null                                                      |
| bannerURL   | user's banner url                                   | String\|null                                                      |
| createdAt   | string representation of the \_createdAt timestamp. | Date                                                              |
| bot         | Boolean that shows if the user is a bot or not.     | Boolean                                                           |

## Constructor

```javascript
new User(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) | 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 %}


# UserClient

It is the 'user' of the logged bot, it has every information about the connected bot.

## Properties

| Property    | Description                                         | Type                                                              |
| ----------- | --------------------------------------------------- | ----------------------------------------------------------------- |
| \_client    | Client                                              | [Client](/documentation/select-version/v.0.1.7/components/client) |
| id          | Bot user id                                         | String                                                            |
| botID       | Bot ID                                              | String                                                            |
| type        | Type of user, `bot` or `user`                       | String                                                            |
| username    | User's username                                     | String                                                            |
| \_createdAt | Timestamp of the user's creation.                   | Number                                                            |
| createdAt   | string representation of the \_createdAt timestamp. | Date                                                              |
| createdBy   | ID of the bot's owner.                              | String                                                            |
| bot         | Boolean that shows if the user is a bot or not.     | Boolean                                                           |

## Constructor

```javascript
new UserClient(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) | 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 %}


# Member

The Member component extends the User component. (Member is a Guild Member or Server Member)

## Properties

| Property   | Description                                        | Type                                                            |
| ---------- | -------------------------------------------------- | --------------------------------------------------------------- |
| roles      | Member's roles                                     | Array\|null                                                     |
| nickname   | Member's guild nickname                            | String\|null                                                    |
| \_joinedAt | Timestamp of when the user joined the guild.       | Number\|null                                                    |
| isOwner    | If the member is the guild's owner or not.         | Boolean                                                         |
| guildID    | The ID of the guild.                               | String                                                          |
| guild      | Guild component                                    | [Guild](/documentation/select-version/v.0.1.7/components/guild) |
| joinedAt   | string representation of the \_joinedAt timestamp. | Date                                                            |
| user       | User component with less information.              | [User](/documentation/select-version/v.0.1.7/components/user)   |

## Constructor

```javascript
new Member(rawData, client, guildID)
```

| 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) | true      |
| guildID    | Guild id                                        | String                                                            | 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

### getSocialLink(socialMediaName)

Get a specific social link from member.

| Properties      | Description                                              | Type   | Required? |
| --------------- | -------------------------------------------------------- | ------ | --------- |
| socialMediaName | The name of the social you'd like to get from the member | String | true      |

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

### addToGroup(groupID)

Add member to a guild group.

| Properties | Description               | Type   | Required? |
| ---------- | ------------------------- | ------ | --------- |
| groupID    | the id of the guild group | String | true      |

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

### removeFromGroup(groupID)

Remove member from a guild group.

| Properties | Description               | Type   | Required? |
| ---------- | ------------------------- | ------ | --------- |
| groupID    | the id of the guild group | String | true      |

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

### addRole(roleID)

Add a role to member.

| Properties | Description        | Type   | Required? |
| ---------- | ------------------ | ------ | --------- |
| roleID     | the id of the role | Number | true      |

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

### removeRole(roleID)

Remove a role from member.

| Properties | Description        | Type   | Required? |
| ---------- | ------------------ | ------ | --------- |
| roleID     | the id of the role | Number | true      |

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

### award(xpAmount)

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

| Properties | Description  | Type   | Required? |
| ---------- | ------------ | ------ | --------- |
| xpAmount   | amount of xp | Number | true      |

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

### setXP(xpAmount)

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

| Properties | Description  | Type   | Required? |
| ---------- | ------------ | ------ | --------- |
| xpAmount   | amount of xp | Number | true      |

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


# BannedMember

BannedMember is a component that extends the User component.

## Properties

| Property      | Description                                 | Type                                                            |
| ------------- | ------------------------------------------- | --------------------------------------------------------------- |
| guildID       | ID of the Guild                             | String                                                          |
| ban           | ban information                             | Object                                                          |
| ban.reason    | reason of the ban                           | String                                                          |
| ban.createdAt | timestamp of when the user has been banned. | Number\|null                                                    |
| ban.createdBy | Banned Member ID.                           | String                                                          |
| user          | Banned member information.                  | Object                                                          |
| user.id       | Banned member id                            | String                                                          |
| user.type     | Banned member type                          | String                                                          |
| user.username | Banned member username                      | String                                                          |
| guild         | Guild/server component                      | [Guild](/documentation/select-version/v.0.1.7/components/guild) |

## Constructor

```javascript
new BannedMember(guildID, rawData, client)
```

| Properties | Description                                     | Type                                                              | Required? |
| ---------- | ----------------------------------------------- | ----------------------------------------------------------------- | --------- |
| guildID    | raw data's guild id                             | String                                                            | true      |
| rawData    | raw data received from ws and converted to JSON | Object                                                            | true      |
| client     | Client                                          | [Client](/documentation/select-version/v.0.1.7/components/client) | 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 %}


# CalendarEvent

Calendar Event is a specific event from a calendar channel, so obvious.

## Properties

| Property                | Description                                         | Type                                                                                                                 |
| ----------------------- | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| data                    | raw data                                            | Object                                                                                                               |
| client                  | client                                              | [Client](/documentation/select-version/v.0.1.7/components/client)                                                    |
| id                      | event id                                            | String                                                                                                               |
| guildID                 | guild id                                            | String                                                                                                               |
| channelID               | id of the channel                                   | String                                                                                                               |
| name                    | event name                                          | String                                                                                                               |
| description             | event description                                   | String                                                                                                               |
| location                | event location set by member                        | String                                                                                                               |
| url                     | event url set by member                             | String                                                                                                               |
| color                   | event color                                         | Number                                                                                                               |
| rsvpLimit               | attendant/entry limit                               | Number                                                                                                               |
| \_startsAt              | timestamp of when the event starts.                 | Number\|null                                                                                                         |
| duration                | duration in ms of the event                         | Number                                                                                                               |
| isPrivate               | //                                                  | Boolean                                                                                                              |
| mentions                | event's mentions                                    | Object ([<mark style="color:purple;">MentionsType</mark>](/documentation/select-version/v.0.1.6/types/mentionstype)) |
| \_createdAt             | timestamp of the event's creation.                  | Number\|null                                                                                                         |
| memberID                | id of the member who created the event.             | String                                                                                                               |
| cancelation             | cancelation info (if canceled)                      | Object\|null                                                                                                         |
| cancelation.description | cancelation description                             | String                                                                                                               |
| cancelation.createdBy   | id of the member who canceled the event.            | String                                                                                                               |
| member                  | Member that created the event.                      | [Member](/documentation/select-version/v.0.1.7/components/member)                                                    |
| createdAt               | string representation of the \_createdAt timestamp. | Date                                                                                                                 |

## Constructor

```javascript
new CalendarEvent(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) | 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 calendar event.

| Properties           | Description               | Type    | Required? |
| -------------------- | ------------------------- | ------- | --------- |
| options              | edit options              | Object  | true      |
| options.name?        | new event's name          | String  | false     |
| options.description? | new event's description   | String  | false     |
| options.location?    | new event's location      | String  | false     |
| options.startsAt?    | date-time string          | String  | false     |
| options.url?         | new event's url           | String  | false     |
| options.color?       | new event's color         | Number  | false     |
| options.rsvpLimit?   | new event's entry limit   | Number  | false     |
| options.duration?    | new event's duration      | Number  | false     |
| options.isPrivate?   | new event's private param | Boolean | false     |

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

### delete()

Delete the calendar event.

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


# CalendarEventRSVP

## Properties

| Property    | Description                                                                     | Type                                                              |
| ----------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| data        | raw data                                                                        | Object                                                            |
| client      | Client                                                                          | [Client](/documentation/select-version/v.0.1.7/components/client) |
| id          | Calendar Event RSVP ID                                                          | Number                                                            |
| guildID     | Guild/server ID                                                                 | String                                                            |
| channelID   | Calendar channel id                                                             | String                                                            |
| memberID    | RSVP member id                                                                  | String                                                            |
| status      | Status of the RSVP (going, maybe, declined, invited, waitlisted, not responded) | String                                                            |
| \_createdAt | Timestamp (unix epoch time) of the rsvp's creation.                             | Number\|null                                                      |
| createdBy   | ID of the member that created the rsvp.                                         | String                                                            |
| updatedBy   | ID of the member that updated the rsvp (if updated)                             | String                                                            |
| member      | Member that created the rsvp.                                                   | [Member](/documentation/select-version/v.0.1.7/components/member) |
| createdAt   | string representation of the \_createdAt timestamp                              | Date\|null                                                        |

## Constructor

```javascript
new CalendarEventRSVP(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) | 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 calendar rsvp.

| Properties     | Description                                                              | Type   | Required? |
| -------------- | ------------------------------------------------------------------------ | ------ | --------- |
| options        | Edit 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)<mark style="color:purple;">></mark>

### delete()

Delete the calendar rsvp.

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


# ForumTopic

Component coming from a 'Forum' channel.

## Properties

| Property         | Description                                                                | Type                                                                                                                                                                                   |
| ---------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \_client         | Client                                                                     | Client                                                                                                                                                                                 |
| id               | Forum topic id                                                             | Number                                                                                                                                                                                 |
| guildID          | Guild/server id                                                            | String                                                                                                                                                                                 |
| channelID        | Forum channel id                                                           | String                                                                                                                                                                                 |
| name             | Topic name/title                                                           | String                                                                                                                                                                                 |
| title            | Topic name/title                                                           | String                                                                                                                                                                                 |
| \_createdAt      | Timestamp (unix epoch time) of the topic's creation.                       | Number                                                                                                                                                                                 |
| memberID         | ID of the member who created the topic                                     | String                                                                                                                                                                                 |
| webhookID        | ID of the webhook that created the topic (if created by webhook)           | String                                                                                                                                                                                 |
| \_updatedAt      | Timestamp (unix epoch time) of when the topic got updated. (if updated)    | Number\|null                                                                                                                                                                           |
| bumpedAt         | Timestamp (unix epoch time) that the forum topic was bumped at.            | String                                                                                                                                                                                 |
| content          | Content of the topic                                                       | String                                                                                                                                                                                 |
| mentions         | Topic mentions                                                             | Object ([<mark style="color:purple;">MentionsTypes</mark>](https://github.com/DinographicPixels/touchguild-docs/blob/main/documentation/select-version/v.0.1.7/types/mentionstype.md)) |
| guild            | Guild/server the topic is in                                               | Guild                                                                                                                                                                                  |
| member           | Member who created the topic                                               | Member                                                                                                                                                                                 |
| channel          | The forum channel, where the topic is in                                   | Channel                                                                                                                                                                                |
| createdAt        | string representation of the \_createdAt timestamp                         | Date                                                                                                                                                                                   |
| updatedAt        | string representation of the \_updatedAt timestamp                         | Date\|null                                                                                                                                                                             |
| createdByWebhook | Boolean that tells you if the forum topic was created by a webhook or not. | Boolean                                                                                                                                                                                |

## Constructor

```javascript
new ForumTopic(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) | 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 forum topic.

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

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

### delete()

Delete the forum topic.

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

### pin()

Pin the forum topic.

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

### unpin()

Unpin the forum topic.

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

### lock()

Lock the forum topic.

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

### unlock()

Unlock the forum topic

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

### addReaction(emoteID)

Add a reaction to the forum topic.

| Properties | Description     | Type   | Required? |
| ---------- | --------------- | ------ | --------- |
| emoteID    | id of the emote | Number | true      |

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

### removeReaction(emoteID)

Remove a reaction from a forum topic.

| Properties | Description     | Type   | Required? |
| ---------- | --------------- | ------ | --------- |
| emoteID    | id of the emote | Number | true      |

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


# ForumTopicComment

Component assigned to a ForumTopic, similar to Message.

## Properties

| Property   | Description                                                                                                                                                                                                                         | Type                                                              |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| \_client   | Client                                                                                                                                                                                                                              | [Client](/documentation/select-version/v.0.1.7/components/client) |
| id         | The ID of the forum topic comment                                                                                                                                                                                                   | Number                                                            |
| content    | The content of the forum topic comment                                                                                                                                                                                              | String                                                            |
| createdAt  | The ISO 8601 timestamp that the forum topic comment was created at                                                                                                                                                                  | String                                                            |
| updatedAt? | The ISO 8601 timestamp that the forum topic comment was updated at, if relevant                                                                                                                                                     | String                                                            |
| topicID    | The ID of the forum topic                                                                                                                                                                                                           | Number                                                            |
| createdBy  | The ID of the user who created this forum topic comment (Note: If this event has createdByWebhookId present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA) | String                                                            |
| guildID    | ID of the forum topic's server, if somehow provided.                                                                                                                                                                                | String                                                            |
| channelID  | ID of the forum channel, if somehow provided.                                                                                                                                                                                       | String                                                            |

## Constructor

```javascript
new ForumTopicComment(rawData, client, options?)
```

| 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) | true      |
| options?            | additional information we can give to a ForumTopicComment | Object                                                            | false     |
| options?.guildID?   | id of the comment's server, not provided by Guilded       | String \| null                                                    | false     |
| options?.channelID? | id of the comment's channel, not provided by Guilded      | String \| null                                                    | false     |

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

### createTopicComment(channelID, options)

Add a comment to the same forum topic as this comment.

| Properties      | Description                                                                         | Type   | Required? |
| --------------- | ----------------------------------------------------------------------------------- | ------ | --------- |
| channelID       | id of the forum channel (needed since Guilded does not provide us this information) | String | true      |
| options         | create options                                                                      | Object | true      |
| options.content | content of the comment                                                              | String | true      |

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

### edit(channelID, options?)

Edit this forum topic's comment.

| Properties      | Description                                                                         | Type   | Required? |
| --------------- | ----------------------------------------------------------------------------------- | ------ | --------- |
| channelID       | id of the forum channel (needed since Guilded does not provide us this information) | String | true      |
| options?        | create options                                                                      | Object | false     |
| options.content | content of the comment                                                              | String | false     |

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

### delete(channelID)

Delete this forum topic comment.

| Properties | Description                                                                         | Type   | Required? |
| ---------- | ----------------------------------------------------------------------------------- | ------ | --------- |
| channelID  | id of the forum channel (needed since Guilded does not provide us this information) | String | true      |

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


# Doc

Doc is component coming from a 'docs' channel.

## Properties

| Property    | Description                                                           | Type                                                                                                                                                                                  |
| ----------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| data        | Raw data                                                              | Object                                                                                                                                                                                |
| client      | Client                                                                | [Client](/documentation/select-version/v.0.1.7/components/client)                                                                                                                     |
| 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)                                                                                                                     |
| 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) | 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)<mark style="color:purple;">></mark>

### delete()

Delete the doc.

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


# ListItem

ListItem is a 'list channel' component. It has his own properties and methods.

## Properties

| Property         | Description                                                                                             | Type                                                                                                                                                                                  |
| ---------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \_data           | raw data                                                                                                | Object                                                                                                                                                                                |
| \_client         | client                                                                                                  | [Client](/documentation/select-version/v.0.1.7/components/client)                                                                                                                     |
| id               | item id                                                                                                 | String                                                                                                                                                                                |
| guildID          | id of the guild                                                                                         | String                                                                                                                                                                                |
| channelID        | id of the list channel                                                                                  | String                                                                                                                                                                                |
| content          | content of the item                                                                                     | String                                                                                                                                                                                |
| mentions         | mentions contained in the item                                                                          | 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 of item's creation                                                                            | Number                                                                                                                                                                                |
| memberID         | id of the member who created the item                                                                   | String                                                                                                                                                                                |
| webhookID        | id of the webhook who created/updated the item.                                                         | String                                                                                                                                                                                |
| \_updatedAt      | timestamp of when the item got updated                                                                  | Number                                                                                                                                                                                |
| updatedBy        | id of the member that updated the item, if updated.                                                     | String                                                                                                                                                                                |
| parentListItemID | The ID of the parent list item if this list item is nested                                              | String                                                                                                                                                                                |
| \_completedAt    | timestamp of the item's completion                                                                      | Number                                                                                                                                                                                |
| completedBy      | set to completed by'?'                                                                                  | String                                                                                                                                                                                |
| note             | note object provided by guilded, with all the note information.                                         | Object                                                                                                                                                                                |
| member           | Member component of the the owner of the item or the user who updated the item (depends on the action). | [Member](/documentation/select-version/v.0.1.7/components/member)\|void                                                                                                               |
| createdAt        | string representation of the \_createdAt timestamp.                                                     | Date                                                                                                                                                                                  |
| updatedAt        | string representation of the \_updatedAt timestamp.                                                     | Date                                                                                                                                                                                  |
| completedAt      | string representation of the \_completedAt timestamp.                                                   | Date                                                                                                                                                                                  |

## Constructor

```javascript
new ListItem(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) | 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(content, note?)

Edit the list item.

| Properties    | Description              | Type   | Required? |
| ------------- | ------------------------ | ------ | --------- |
| content       | New content of the item. | String | true      |
| note?         | Item's additional note   | Object | false     |
| note?.content | note's 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)<mark style="color:purple;">></mark>

### delete()

Delete the list item.

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

### complete()

Set the item to 'complete'.

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

### uncomplete()

Set the item to 'uncomplete'.

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


# Webhook

## Properties

| Property    | Description                                            | Type                                                              |
| ----------- | ------------------------------------------------------ | ----------------------------------------------------------------- |
| \_client    | Client                                                 | [Client](/documentation/select-version/v.0.1.7/components/client) |
| id          | ID of the webhook                                      | String                                                            |
| guildID     | ID of the guild the webhook got sent on.               | String                                                            |
| channelID   | ID of the channel the webhook got sent on.             | String                                                            |
| username    | Webhook username.                                      | String                                                            |
| \_createdAt | Timestamp (unix epoch time) of the webhook's creation. | Number                                                            |
| \_deletedAt | Timestamp (unix epoch time) of the webhook's deletion. | Number\|null                                                      |
| createdBy   | ID of the webhook's owner.                             | String                                                            |
| token       | Webhook token                                          | String\|null                                                      |
| createdAt   | String representation of the \_createdAt timestamp.    | Date                                                              |
| deletedAt   | String representation of the \_deletedAt timestamp.    | Date\|null                                                        |

## Constructor

```javascript
new Webhook(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) | 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()

Edit the webhook.

| Properties         | Description                      | Type   | Required? |
| ------------------ | -------------------------------- | ------ | --------- |
| options            | Edit options.                    | Object | true      |
| options.name       | New webhook's name.              | String | true      |
| options.channelID? | Move webhook to another channel. | String | false     |

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

### delete()

Delete the webhook.

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


# TouchGuild.DevTools

TouchGuild's Developer Tools, made accessible to everyone.

## call

Make requests to the Guilded API, communicate like TouchGuild does.

## Constructor

```typescript
new TouchGuild.DevTools.call();
```

## Asynchronous methods

### get(endpoint: string, token: string, queryParams?: string|object, crashOnRejection?: boolean)

Make a GET request.

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

### post(endpoint: string, token: string, data: string|object, crashOnRejection?: boolean)

Make a POST request.

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

### put(endpoint: string, token: string, data: string|object, crashOnRejection?: boolean)

Make a PUT request.

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

### patch(endpoint: string, token: string, data: string|object, crashOnRejection?: boolean)

Make a PATCH request.

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

### delete(endpoint: string, token:string, crashOnRejection?: boolean)

Make a DELETE request.

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

## Synchronous methods

### syncGetChannel(channelID:string, client: Client)

Get a synchronously a channel.

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

### syncGetMember(guildID: string, memberID: string, client:Client)

Get a synchronously a member.

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

### syncGetGuild(guildID: string, client: Client)

Get a synchronously a guild.

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

## Deprecated methods.

{% hint style="danger" %}
We do not recommend to use deprecated methods, they're may be very buggy & we do not plan to fix them.
{% endhint %}

#### FETCH(method: string, endpoint: string, TOKEN: any, BODY:string|any)

Make an HTTP request. (asynchronous)

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

### SYNCFETCH(method: string, endpoint: string, TOKEN: any, BODY:string|any)

Make an HTPP request. (synchronous)

Returns: <mark style="color:purple;">object|void</mark>


# Examples

Simple examples of what you can do with this version of TouchGuild.


# Snipe & editsnipe

Get last deleted/edited message content.

### Usage:

* !snipe (snipes the last deleted message of the current channel)
* !editsnipe (editsnipes the last edited message of the current channel)
* !snipe CHANNELID (same as snipe but custom channel id)
* !editsnipe CHANNELID (same as editsnipe but custom channel id)

```typescript
// Importing TouchGuild.
import * as TouchGuild from 'touchguild';

// Creating client & connecting.
const client = new TouchGuild.Client({token: 'token here', REST: true});
client.connect();

// Declaring deleted & edited message maps.
var lastDeletedMessage = new Map();
var lastEditedMessage = new Map();

// Standard command handler, message detection.
client.on('messageCreate', (message)=> {
    let args = message.content?.split(' '); // array of args.

    message.content = message.content?.toLowerCase();

    if (message.content?.startsWith('!snipe') && args?.[1]){
        if (!lastDeletedMessage.has(args?.[1])) return message.createMessage({content: `No deleted message detected for: *${args?.[1]}*`});
        return message.createMessage({content: `Last deleted message content: ${lastDeletedMessage.get(args?.[1])}`});
    }else if (message.content == '!snipe'){
        if (!lastDeletedMessage.has(message.channelID)) return message.createMessage({content: 'No deleted message detected for the moment.'});
        return message.createMessage({content: `Last deleted message content: ${lastDeletedMessage.get(message.channelID)}`});
    }

    if (message.content?.startsWith('!editsnipe') && args?.[1]){
        if (!lastEditedMessage.has(args?.[1])) return message.createMessage({content: `No edited message detected for: *${args?.[1]}*`});
        return message.createMessage({content: `Last edited message content: ${lastEditedMessage.get(args?.[1])}`});
    }else if (message.content == '!editsnipe'){
        if (!lastEditedMessage.has(message.channelID)) return message.createMessage({content: 'No edited message detected for the moment.'});
        return message.createMessage({content: `Last edited message content: ${lastEditedMessage.get(message.channelID)}`});
    }
})

// Detect when message is updated/deleted & save their content.
client.on('messageUpdate', (message)=> {
    if (!message.oldContent) return; // return if message oldContent not cached.
    lastEditedMessage.set(message.channelID, message.oldContent);
})

client.on('messageDelete', (message)=> {
    if (!message.oldContent) return; // return if message oldContent not cached.
    lastDeletedMessage.set(message.channelID, message.oldContent);
})
```

{% hint style="info" %}
Examples that are in the Nightly category may not work on stable builds, if it's the case, wait for the next stable build to release.
{% endhint %}


# Get bot's information

Learn more about your bot's user.

## Log bot's username when ready.

```javascript
client.on('ready', ()=> {
   console.log('Logged as', client.user.username);
});
```

## Log every information about the logged bot.

```javascript
client.on('ready', ()=> {
   console.log(client.user);
});
```

Output (example):

<pre class="language-json"><code class="lang-json"><strong>UserClient {
</strong>  _client: Client,
  id: "AQbXpB84",
  botID: "c06b6d42-05db-4af7-8a28-faae65b53e7a",
  type: "bot",
  username: "touchguild testing bot",
  _createdAt: 1666429419806,
  createdBy: "4kR9QRVA"
}
</code></pre>

You can use the information like the one above to do whatever you want with it.


# XP Awards

You can now use the built-in XP system to award members.

## Award every member sending messages

```javascript
client.on('messageCreate', (message)=> {
   if (message.member.bot == true) return;
   message.member.award(5);
});
```

## Stop member from getting XP if they have a specific role

```javascript
client.on('messageCreate', (message)=> {
   if (message.member.bot == true) return;
   if (message.member.roles.includes(32870988)) return;
   message.member.award(5);
});
```

## Remove XP when a member removes their message

```javascript
client.on('messageDelete', (message)=> {
   if (message.member.bot == true) return;
   message.member.award(-5);
});
```

## Set member's XP to 5

```javascript
Member.setXP(5);
```

## Set every member's XP in possession of a role

```javascript
Client.awardRole(guildID, roleID);

// E.g:
Client.awardRole('8jya38Wj', 30103378);
```


# List of available events

Events are the key to make your bot alive & feel more active. Here, you'll find every events we're supporting, as for now.

<details>

<summary>Too lazy to scroll? Click me, haha!</summary>

### [Message events](#message)

### [Channel events](#channel)

### [Forum Topic events](#forum-topic)

### [Guild events](#guild)

### [Docs events](#docs)

### [Calendar events](#calendar)

### [List events](#list)

### [Webhook events](#webhook)

</details>

## Message

### messageCreate

Fired when a message is created.

### messageUpdate

Fired when a message is updated/edited.

### messageDelete

Fired when a message is deleted.

### messageReactionAdd

Fired when a reaction is added to a message.

### messageReactionRemove

Fired when a reaction is removed from a message.

## Channel

### channelCreate

Fired when a channel is created.

### channelUpdate

Fired when when a channel is updated.

### channelDelete

Fired when a channel is deleted.

## Forum Topic

### forumTopicCreate

Fired when a Forum topic is created.

### forumTopicUpdate

Fired when a Forum topic is updated/edited.

### forumTopicDelete

Fired when a Forum topic is deleted.

### forumTopicPin

Fired when a Forum topic is pinned.

### forumTopicUnpin

Fired when a Forum topic is unpinned.

### forumTopicReactionAdd

Fired when a reaction is added to a forum topic.

### forumTopicReactionRemove

Fired when a reaction is removed from a forum topic.

### forumTopicCommentCreate

Fired when a comment is added to a forum topic.

### forumTopicCommentUpdate

Fired when a forum topic comment has been updated.

### forumTopicCommentDelete

Fired when a forum topic comment has been deleted.

## Guild

### guildCreate

Fired when the bot joins a guild.

### guildBanAdd

Fired when a guild member is banned.

### guildBanRemove

Fired when a guild member is unbanned.

### guildMemberAdd

Fired when a user join a guild.

### guildMemberRemove

Fired when a guild member leave a guild.

### guildMemberUpdate

Fired when the member profile (ex: guild nickname) is updated.

### guildMemberRoleUpdate

Fired when a role has been added/removed from a member.

## Docs

### docCreate

Fired when a doc is created inside a docs channel.

### docUpdate

Fired when a doc is edited/updated inside a docs channel.

### docDelete

Fired when a doc is deleted inside a docs channel.

## Calendar

### calendarEventCreate

Fired when an event is created inside a calendar channel.

### calendarEventUpdate

Fired when an event is updated/edited inside a calendar channel.

### calendarEventDelete

Fired when an event is deleted inside a calendar channel.

### calendarEventRsvpUpdate

Fired when an event RSVP has been updated/edited.

### calendarEventRsvpDelete

Fired when a calendar event rsvp is deleted.

## List

### listItemCreate

Fired when an item has been created inside a list channel.

### listItemUpdate

Fired when an item has been updated/edited inside a list channel.

### listItemDelete

Fired when an item has been deleted inside a list channel.

### listItemComplete

Fired when an item has been completed (checkmark, ya know) inside a list channel.

### listItemUncomplete

Fired when an item has been uncompleted inside a list channel.

## Webhook

### webhooksCreate

Fired when a webhook has been created.

### webhooksUpdate

Fired when a webhook has been updated/edited.


# v.0.1.6

Docs | First official version of TouchGuild, where everything started.


# Home

Using a library includes reading docs.

#### TouchGuild brings you closer to the Guilded API and comes with:

* Simpler names for events such as 'messageCreate' and not 'TeamMessageCreated' like Guilded does.
* Easy & predictable types which makes everything's easier to understand
* Methods, properties to help you be more productive.
* Strongly typed Client event emitter which allows you to don't 'read docs' when you need a specific 'event' or property of a component.
* Wisely chosen method names, named to be accurate to what they're actually doing.
* Those are some of the advantages by using TouchGuild as a Guilded library.
* Get raw data that directly comes from the Guilded API with Non-REST methods
* Communicate with the Guilded API with TouchGuild's DevTools, improving the library's durability and let you some time before switching to another library (if deprecation happen).

and even, more..

## Need to get started?

### [Click here](https://legacy.docs.touchguild.com/documentation/select-version/v.0.1.6/pages/rRXIXdOrAoEHI2PsMIUp#get-started-its-easy.).


# Components

Components are also called Structures in the GitHub repo.


# Client

The Guilded Bot's client, where everything's happen and where the Guilded bot interacts with guilds/servers.

## 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       |
| token       | The bot's inserted token.                                                     | String    |

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

### getRESTChannel(channelID)

Get a specific channel's information.

<table><thead><tr><th width="218">Properties</th><th>Description</th><th>Type</th></tr></thead><tbody><tr><td>channelID</td><td>id of the channel you'd like to get.</td><td>String</td></tr></tbody></table>

> Returns: <mark style="color:purple;">Promise<</mark>[<mark style="color:purple;">Channel</mark>](/documentation/select-version/v.0.1.6/components/channel)<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.6/components/member)<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.6/components/guild)<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.6/components/message)<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.6/components/doc)<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.6/components/doc)<mark style="color:purple;">></mark>

### getRESTForumTopics(channelID, filter?)

Get a list of ForumTopic component.

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

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

### getRESTForumTopic(channelID, topicID)

Get a specific ForumTopic component

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

> Returns: <mark style="color:purple;">Promise<</mark>[<mark style="color:purple;">ForumTopic</mark>](/documentation/select-version/v.0.1.6/components/forumtopic)<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.6/components/calendarevent)<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.6/components/calendarevent)<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.6/components/calendareventrsvp)<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.6/components/calendareventrsvp)<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.6/components/listitem)<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.6/components/listitem)<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.6/components/webhook)<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.6/components/webhook)<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 %}

### 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.6/components/channel)<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.6/components/message)>

### 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.6/components/message)<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\<ForumTopic></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.6/components/forumtopic)<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>

### 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.6/components/doc)<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.6/components/doc)<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.6/components/calendarevent)<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.6/components/calendarevent)<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.6/components/calendareventrsvp)<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.6/components/listitem)<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.6/components/listitem)<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.6/components/webhook)<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.6/components/webhook)<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>


# Channel

The 'Channel' component is a 'GuildChannel' component as for now. This can change in the future by moving some data into an extension of 'Channel'.

## Properties

| Property     | Description                                                                              | Type                                                              |
| ------------ | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| data         | Original channel data.                                                                   | Object                                                            |
| client       | the client that receives the channel data                                                | [Client](/documentation/select-version/v.0.1.6/components/client) |
| id           | id of the channel                                                                        | String                                                            |
| type         | type of the channel                                                                      | String                                                            |
| name         | the name of the channel                                                                  | String                                                            |
| topic        | the topic/description of the channel                                                     | String                                                            |
| \_createdAt  | timestamp that the channel was created at                                                | Number                                                            |
| memberID     | id of the user that created the channel                                                  | String                                                            |
| \_updatedAt  | timestamp that the channel was updated at                                                | Number\|null                                                      |
| guildID      | the id of the server                                                                     | String                                                            |
| parentID     | ID of the parent channel or parent thread, if present. Only relevant for server channels | String                                                            |
| categoryID   | id of the category the channel is in                                                     | String                                                            |
| groupID      | id of the group the channel is in                                                        | String                                                            |
| isPublic     | is the channel public?                                                                   | Boolean                                                           |
| archivedBy   | id of the user that archived the channel                                                 | String                                                            |
| \_archivedAt | timestamp that the channel was archived at                                               | Number                                                            |
| createdAt    | string representation of the \_createdAt timestamp.                                      | Date                                                              |
| updatedAt    | string representation of the \_updatedAt timestamp.                                      | Date\|null                                                        |
| archivedAt   | string representation of the \_archivedAt timestamp.                                     | Date\|null                                                        |

## Constructor

```javascript
new Channel(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.6/components/client) | 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

### createMessage(options)

Create a message in the channel.

| Properties              | Description                                                | Type           | Required? |
| ----------------------- | ---------------------------------------------------------- | -------------- | --------- |
| 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.6/components/message)>

### edit(options)

Update the channel.

| Properties       | Description                    | Type    | Required? |
| ---------------- | ------------------------------ | ------- | --------- |
| options          | edit options                   | Object  | false     |
| options.name     | new channel name               | String  | false     |
| options.topic    | new channel topic/description. | String  | false     |
| options.isPublic | is the channel public?         | Boolean | false     |

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

### delete()

Delete the channel.

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


# Message

The 'Message' component is a 'GuildMessage' component as for now. This can change in the future by moving some data into an extension of 'Message'.

## Properties

| Property              | Description                                                                                                         | Type                                                                                                                 |
| --------------------- | ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| \_data                | Original message data.                                                                                              | Object                                                                                                               |
| \_client              | the client that receives the channel data                                                                           | [Client](/documentation/select-version/v.0.1.6/components/client)                                                    |
| id                    | id of the message                                                                                                   | String                                                                                                               |
| type                  | type of message ('user' or 'system')                                                                                | String                                                                                                               |
| channel               | channel where the message has been sent                                                                             | [Channel](/documentation/select-version/v.0.1.6/components/channel)                                                  |
| member                | message author                                                                                                      | [Member](/documentation/select-version/v.0.1.6/components/member)                                                    |
| guildID               | id of the message's server                                                                                          | String                                                                                                               |
| channelID             | id of the message's channel                                                                                         | String                                                                                                               |
| content               | message content                                                                                                     | String                                                                                                               |
| embeds                | message's embed(s)                                                                                                  | Array\<Object>                                                                                                       |
| isPrivate             | is message private? true/false                                                                                      | Boolean                                                                                                              |
| isSilent              | if the message doesn't notify a user                                                                                | Boolean                                                                                                              |
| mentions              | Message mentions object                                                                                             | Object ([<mark style="color:purple;">MentionsType</mark>](/documentation/select-version/v.0.1.6/types/mentionstype)) |
| \_createdAt           | timestamp that the message was created at                                                                           | Number                                                                                                               |
| memberID              | id of the message author                                                                                            | String                                                                                                               |
| \_updatedAt           | timestamp that the message was updated at                                                                           | Number\|null                                                                                                         |
| \_deletedAt           | Timestamp (unix epoch time) of the message's deletion.                                                              | Number\|null                                                                                                         |
| webhookID             | The ID of the webhook who created this message, if it was created by a webhook                                      | String                                                                                                               |
| replyMessageIds       | List of ids mentioned in the message                                                                                | Array                                                                                                                |
| \_lastMessageID       | last message sent with the message itself (cache)                                                                   | String                                                                                                               |
| \_originalMessageID   | Original message, used to reply this one (cache)                                                                    | String                                                                                                               |
| \_originalMessageBool | Used by the system to detect if the original message id has been transfered                                         | Boolean                                                                                                              |
|                       |                                                                                                                     |                                                                                                                      |
| oldContent            | old message content if edited                                                                                       | String                                                                                                               |
| createdAt             | string representation of the \_createdAt timestamp.                                                                 | Date                                                                                                                 |
| updatedAt             | string representation of the \_updatedAt timestamp.                                                                 | Date\|void                                                                                                           |
| deletedAt             | string representation of the \_deletedAt timestamp.                                                                 | Date\|void                                                                                                           |
| member                | Get the member component, which returns Member when message guildID and memberID is defined or if Member is cached. | Member\|undefined                                                                                                    |
| guild                 | Guild component where the message has been sent                                                                     | Guild                                                                                                                |
| channel               | Channel component where the message has been sent on                                                                | [Channel](/documentation/select-version/v.0.1.6/components/channel)                                                  |

## Constructor

```javascript
new Message(rawData, client, params)
```

| 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.6/components/client)   | true      |
| params?                   | Object of params                                    | Object                                                              | false     |
| params.oldMessage?        | old message component, if cached.                   | [Message](/documentation/select-version/v.0.1.6/components/message) | false     |
| params.originalMessageID? | ID of the transfered original message. If existant. | String                                                              | false     |

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

### createMessage(options)

Create a message in the message's channel.

| Properties              | Description                                                | Type           | Required? |
| ----------------------- | ---------------------------------------------------------- | -------------- | --------- |
| 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.6/components/message)>

### edit(newMessage)

Update/edit the message.

| Properties         | Description      | Type   | Required? |
| ------------------ | ---------------- | ------ | --------- |
| newMessage         | edit options     | Object | true      |
| newMessage.content | message content  | String | false     |
| newMessage.embeds  | message's embeds | Object | false     |

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

### delete()

Delete the message.

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

### editLastMessage(newMessage)

Edit the last message sent with the message itself.

| Properties         | Description      | Type   | Required? |
| ------------------ | ---------------- | ------ | --------- |
| newMessage         | edit options     | Object | true      |
| newMessage.content | message content  | String | false     |
| newMessage.embeds  | message's embeds | Object | false     |

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

### deleteLastMessage()

Delete the last message sent with he message itself.

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

### editOriginalMessage(newMessage)

Edit the message's original message, if existant.

| Properties         | Description      | Type   | Required? |
| ------------------ | ---------------- | ------ | --------- |
| newMessage         | edit options     | Object | true      |
| newMessage.content | message content  | String | false     |
| newMessage.embeds  | message's embeds | Object | false     |

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

### deleteOriginalMessage()

Delete the message's original message, if existant.

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

### addReaction(reaction)

Add a reaction to the message.

| Properties | Description | Type   | Required? |
| ---------- | ----------- | ------ | --------- |
| reaction   | reaction id | Number | true      |

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

### removeReaction(reaction)

Remove a specific reaction from the message.

| Properties | Description | Type   | Required? |
| ---------- | ----------- | ------ | --------- |
| reaction   | reaction id | Number | true      |

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


# Guild

The Guild is also known as 'server', it's where everything happen, and where the bot interacts with people/the environment.

## Properties

| Property         | Description                                         | Type         |
| ---------------- | --------------------------------------------------- | ------------ |
| client           | Client                                              | Client       |
| id               | ID of the Guild/server.                             | String       |
| ownerID          | The owner of the guild                              | String       |
| type             | The guild's type                                    | String       |
| name             | Guild name                                          | String       |
| url              | URL of the guild                                    | String       |
| about            | 'About' of the guild (description)                  | String       |
| description      | The guild's description                             | String       |
| about            | Same as 'description'.                              | String       |
| iconURL          | the url of the guild's icon                         | String\|null |
| bannerURL        | the url of the guild's banner                       | String\|null |
| timezone         | the timezone of the guild                           | String       |
| defaultChannelID | the id of the default channel of the guild          | String       |
| \_createdAt      | Timestamp (unix epoch time) of the guild's creation | Number       |
| createdAt        | string representation of the \_createdAt timestamp. | Date         |

## Constructor

```javascript
new Message(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.6/components/client) | 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 %}


# 🙇♂ User

It is the default component for a 'user', it contains every basic information about the user, those can be seen by anyone.

## Properties

| Property    | Description                                         | Type                                                              |
| ----------- | --------------------------------------------------- | ----------------------------------------------------------------- |
| \_client    | Client                                              | [Client](/documentation/select-version/v.0.1.6/components/client) |
| id          | User id                                             | String                                                            |
| type        | Type of user, bot or user                           | String                                                            |
| username    | User's username                                     | String                                                            |
| \_createdAt | Timestamp of the user's creation.                   | Number                                                            |
| avatarURL   | user's avatar url                                   | String\|null                                                      |
| bannerURL   | user's banner url                                   | String\|null                                                      |
| createdAt   | string representation of the \_createdAt timestamp. | Date                                                              |

## Constructor

```javascript
new User(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.6/components/client) | 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 %}


# Member

The Member component extends the User component. (Member is a Guild Member or Server Member)

## Properties

| Property   | Description                                        | Type                                                            |
| ---------- | -------------------------------------------------- | --------------------------------------------------------------- |
| roles      | Member's roles                                     | Array\|null                                                     |
| nickname   | Member's guild nickname                            | String\|null                                                    |
| \_joinedAt | Timestamp of when the user joined the guild.       | Number\|null                                                    |
| isOwner    | If the member is the guild's owner or not.         | Boolean                                                         |
| guildID    | The ID of the guild.                               | String                                                          |
| guild      | Guild component                                    | [Guild](/documentation/select-version/v.0.1.6/components/guild) |
| joinedAt   | string representation of the \_joinedAt timestamp. | Date                                                            |
| user       | User component with less information.              | [User](/documentation/select-version/v.0.1.6/components/user)   |

## Constructor

```javascript
new Member(rawData, client, guildID)
```

| 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.6/components/client) | true      |
| guildID    | Guild id                                        | String                                                            | 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

### getSocialLink(socialMediaName)

Get a specific social link from member.

| Properties      | Description                                              | Type   | Required? |
| --------------- | -------------------------------------------------------- | ------ | --------- |
| socialMediaName | The name of the social you'd like to get from the member | String | true      |

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

### addToGroup(groupID)

Add member to a guild group.

| Properties | Description               | Type   | Required? |
| ---------- | ------------------------- | ------ | --------- |
| groupID    | the id of the guild group | String | true      |

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

### removeFromGroup(groupID)

Remove member from a guild group.

| Properties | Description               | Type   | Required? |
| ---------- | ------------------------- | ------ | --------- |
| groupID    | the id of the guild group | String | true      |

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

### addRole(roleID)

Add a role to member.

| Properties | Description        | Type   | Required? |
| ---------- | ------------------ | ------ | --------- |
| roleID     | the id of the role | Number | true      |

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

### removeRole(roleID)

Remove a role from member.

| Properties | Description        | Type   | Required? |
| ---------- | ------------------ | ------ | --------- |
| roleID     | the id of the role | Number | true      |

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


# BannedMember

BannedMember is a component that extends the User component.

## Properties

| Property      | Description                                 | Type                                                            |
| ------------- | ------------------------------------------- | --------------------------------------------------------------- |
| guildID       | ID of the Guild                             | String                                                          |
| ban           | ban information                             | Object                                                          |
| ban.reason    | reason of the ban                           | String                                                          |
| ban.createdAt | timestamp of when the user has been banned. | Number\|null                                                    |
| ban.createdBy | Banned Member ID.                           | String                                                          |
| user          | Banned member information.                  | Object                                                          |
| user.id       | Banned member id                            | String                                                          |
| user.type     | Banned member type                          | String                                                          |
| user.username | Banned member username                      | String                                                          |
| guild         | Guild/server component                      | [Guild](/documentation/select-version/v.0.1.6/components/guild) |

## Constructor

```javascript
new BannedMember(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.6/components/client) | 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 %}


# CalendarEvent

Calendar Event is a specific event from a calendar channel, so obvious.

## Properties

| Property                | Description                                         | Type                                                                                                                 |
| ----------------------- | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| data                    | raw data                                            | Object                                                                                                               |
| client                  | client                                              | [Client](/documentation/select-version/v.0.1.6/components/client)                                                    |
| id                      | event id                                            | String                                                                                                               |
| guildID                 | guild id                                            | String                                                                                                               |
| channelID               | id of the channel                                   | String                                                                                                               |
| name                    | event name                                          | String                                                                                                               |
| description             | event description                                   | String                                                                                                               |
| location                | event location set by member                        | String                                                                                                               |
| url                     | event url set by member                             | String                                                                                                               |
| color                   | event color                                         | Number                                                                                                               |
| rsvpLimit               | attendant/entry limit                               | Number                                                                                                               |
| \_startsAt              | timestamp of when the event starts.                 | Number\|null                                                                                                         |
| duration                | duration in ms of the event                         | Number                                                                                                               |
| isPrivate               | //                                                  | Boolean                                                                                                              |
| mentions                | event's mentions                                    | Object ([<mark style="color:purple;">MentionsType</mark>](/documentation/select-version/v.0.1.6/types/mentionstype)) |
| \_createdAt             | timestamp of the event's creation.                  | Number\|null                                                                                                         |
| memberID                | id of the member who created the event.             | String                                                                                                               |
| cancelation             | cancelation info (if canceled)                      | Object\|null                                                                                                         |
| cancelation.description | cancelation description                             | String                                                                                                               |
| cancelation.createdBy   | id of the member who canceled the event.            | String                                                                                                               |
| member                  | Member that created the event.                      | [Member](/documentation/select-version/v.0.1.6/components/member)                                                    |
| createdAt               | string representation of the \_createdAt timestamp. | Date                                                                                                                 |

## Constructor

```javascript
new CalendarEvent(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.6/components/client) | 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 calendar event.

| Properties           | Description               | Type    | Required? |
| -------------------- | ------------------------- | ------- | --------- |
| options              | edit options              | Object  | true      |
| options.name?        | new event's name          | String  | false     |
| options.description? | new event's description   | String  | false     |
| options.location?    | new event's location      | String  | false     |
| options.startsAt?    | date-time string          | String  | false     |
| options.url?         | new event's url           | String  | false     |
| options.color?       | new event's color         | Number  | false     |
| options.rsvpLimit?   | new event's entry limit   | Number  | false     |
| options.duration?    | new event's duration      | Number  | false     |
| options.isPrivate?   | new event's private param | Boolean | false     |

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

### delete()

Delete the calendar event.

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


# CalendarEventRSVP

## Properties

| Property    | Description                                                                     | Type                                                              |
| ----------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| data        | raw data                                                                        | Object                                                            |
| client      | Client                                                                          | [Client](/documentation/select-version/v.0.1.6/components/client) |
| id          | Calendar Event RSVP ID                                                          | Number                                                            |
| guildID     | Guild/server ID                                                                 | String                                                            |
| channelID   | Calendar channel id                                                             | String                                                            |
| memberID    | RSVP member id                                                                  | String                                                            |
| status      | Status of the RSVP (going, maybe, declined, invited, waitlisted, not responded) | String                                                            |
| \_createdAt | Timestamp (unix epoch time) of the rsvp's creation.                             | Number\|null                                                      |
| createdBy   | ID of the member that created the rsvp.                                         | String                                                            |
| updatedBy   | ID of the member that updated the rsvp (if updated)                             | String                                                            |
| member      | Member that created the rsvp.                                                   | [Member](/documentation/select-version/v.0.1.6/components/member) |
| createdAt   | string representation of the \_createdAt timestamp                              | Date\|null                                                        |

## Constructor

```javascript
new CalendarEventRSVP(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.6/components/client) | 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 calendar rsvp.

| Properties     | Description                                                              | Type   | Required? |
| -------------- | ------------------------------------------------------------------------ | ------ | --------- |
| options        | Edit 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.6/components/calendareventrsvp)<mark style="color:purple;">></mark>

### delete()

Delete the calendar rsvp.

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


# ForumTopic

Component coming from a 'Forum' channel.

## Properties

| Property         | Description                                                                | Type                                                                                                                  |
| ---------------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| \_client         | Client                                                                     | Client                                                                                                                |
| id               | Forum topic id                                                             | Number                                                                                                                |
| guildID          | Guild/server id                                                            | String                                                                                                                |
| channelID        | Forum channel id                                                           | String                                                                                                                |
| name             | Topic name/title                                                           | String                                                                                                                |
| title            | Topic name/title                                                           | String                                                                                                                |
| \_createdAt      | Timestamp (unix epoch time) of the topic's creation.                       | Number                                                                                                                |
| memberID         | ID of the member who created the topic                                     | String                                                                                                                |
| webhookID        | ID of the webhook that created the topic (if created by webhook)           | String                                                                                                                |
| \_updatedAt      | Timestamp (unix epoch time) of when the topic got updated. (if updated)    | Number\|null                                                                                                          |
| bumpedAt         | Timestamp (unix epoch time) that the forum topic was bumped at.            | String                                                                                                                |
| content          | Content of the topic                                                       | String                                                                                                                |
| mentions         | Topic mentions                                                             | Object ([<mark style="color:purple;">MentionsTypes</mark>](/documentation/select-version/v.0.1.6/types/mentionstype)) |
| guild            | Guild/server the topic is in                                               | Guild                                                                                                                 |
| member           | Member who created the topic                                               | Member                                                                                                                |
| channel          | The forum channel, where the topic is in                                   | Channel                                                                                                               |
| createdAt        | string representation of the \_createdAt timestamp                         | Date                                                                                                                  |
| updatedAt        | string representation of the \_updatedAt timestamp                         | Date\|null                                                                                                            |
| createdByWebhook | Boolean that tells you if the forum topic was created by a webhook or not. | Boolean                                                                                                               |

## Constructor

```javascript
new ForumTopic(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.6/components/client) | 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 forum topic.

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

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

### delete()

Delete the forum topic.

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

### pin()

Pin the forum topic.

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

### unpin()

Unpin the forum topic.

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


# Doc

Doc is component coming from a 'docs' channel.

## Properties

| Property    | Description                                                           | Type                                                                                                                 |
| ----------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| data        | Raw data                                                              | Object                                                                                                               |
| client      | Client                                                                | [Client](/documentation/select-version/v.0.1.6/components/client)                                                    |
| 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>](/documentation/select-version/v.0.1.6/types/mentionstype)) |
| \_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.6/components/member)                                                    |
| 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.6/components/client) | 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.6/components/doc)<mark style="color:purple;">></mark>

### delete()

Delete the doc.

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


# ListItem

ListItem is a 'list channel' component. It has his own properties and methods.

## Properties

| Property         | Description                                                                                             | Type                                                                                                                 |
| ---------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| \_data           | raw data                                                                                                | Object                                                                                                               |
| \_client         | client                                                                                                  | [Client](/documentation/select-version/v.0.1.6/components/client)                                                    |
| id               | item id                                                                                                 | String                                                                                                               |
| guildID          | id of the guild                                                                                         | String                                                                                                               |
| channelID        | id of the list channel                                                                                  | String                                                                                                               |
| content          | content of the item                                                                                     | String                                                                                                               |
| mentions         | mentions contained in the item                                                                          | Object ([<mark style="color:purple;">MentionsType</mark>](/documentation/select-version/v.0.1.6/types/mentionstype)) |
| \_createdAt      | timestamp of item's creation                                                                            | Number                                                                                                               |
| memberID         | id of the member who created the item                                                                   | String                                                                                                               |
| webhookID        | id of the webhook who created/updated the item.                                                         | String                                                                                                               |
| \_updatedAt      | timestamp of when the item got updated                                                                  | Number                                                                                                               |
| updatedBy        | id of the member that updated the item, if updated.                                                     | String                                                                                                               |
| parentListItemID | The ID of the parent list item if this list item is nested                                              | String                                                                                                               |
| \_completedAt    | timestamp of the item's completion                                                                      | Number                                                                                                               |
| completedBy      | set to completed by'?'                                                                                  | String                                                                                                               |
| note             | note object provided by guilded, with all the note information.                                         | Object                                                                                                               |
| member           | Member component of the the owner of the item or the user who updated the item (depends on the action). | [Member](/documentation/select-version/v.0.1.6/components/member)\|void                                              |
| createdAt        | string representation of the \_createdAt timestamp.                                                     | Date                                                                                                                 |
| updatedAt        | string representation of the \_updatedAt timestamp.                                                     | Date                                                                                                                 |
| completedAt      | string representation of the \_completedAt timestamp.                                                   | Date                                                                                                                 |

## Constructor

```javascript
new ListItem(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.6/components/client) | 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(content, note?)

Edit the list item.

| Properties    | Description              | Type   | Required? |
| ------------- | ------------------------ | ------ | --------- |
| content       | New content of the item. | String | true      |
| note?         | Item's additional note   | Object | false     |
| note?.content | note's content           | String | true      |

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

### delete()

Delete the list item.

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

### complete()

Set the item to 'complete'.

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

### uncomplete()

Set the item to 'uncomplete'.

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


# Webhook

## Properties

| Property    | Description                                            | Type                                                              |
| ----------- | ------------------------------------------------------ | ----------------------------------------------------------------- |
| \_client    | Client                                                 | [Client](/documentation/select-version/v.0.1.6/components/client) |
| id          | ID of the webhook                                      | String                                                            |
| guildID     | ID of the guild the webhook got sent on.               | String                                                            |
| channelID   | ID of the channel the webhook got sent on.             | String                                                            |
| username    | Webhook username.                                      | String                                                            |
| \_createdAt | Timestamp (unix epoch time) of the webhook's creation. | Number                                                            |
| \_deletedAt | Timestamp (unix epoch time) of the webhook's deletion. | Number\|null                                                      |
| createdBy   | ID of the webhook's owner.                             | String                                                            |
| token       | Webhook token                                          | String\|null                                                      |
| createdAt   | String representation of the \_createdAt timestamp.    | Date                                                              |
| deletedAt   | String representation of the \_deletedAt timestamp.    | Date\|null                                                        |

## Constructor

```javascript
new Webhook(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.6/components/client) | 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()

Edit the webhook.

| Properties         | Description                      | Type   | Required? |
| ------------------ | -------------------------------- | ------ | --------- |
| options            | Edit options.                    | Object | true      |
| options.name       | New webhook's name.              | String | true      |
| options.channelID? | Move webhook to another channel. | String | false     |

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

### delete()

Delete the webhook.

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


# List of available events

Events are the key to make your bot alive & feel more active. Here, you'll find every events we're supporting, as for now.

<details>

<summary>Too lazy to scroll? Click me, haha!</summary>

### [Message events](#message)

### [Channel events](#channel)

### [Forum Topic events](#forum-topic)

### [Guild events](#guild)

### [Docs events](#docs)

### [Calendar events](#calendar)

### [List events](#list)

### [Webhook events](#webhook)

</details>

## Message

### messageCreate

When a message is created.

### messageUpdate

When a message is updated/edited.

### messageDelete

When a message is deleted.

### messageReactionAdd

When a reaction is added to a message.

### messageReactionRemove

When a reaction is removed from a message.

## Channel

### channelCreate

When a channel is created.

### channelUpdate

When a channel is updated.

### channelDelete

When a channel is deleted.

## Forum Topic

### forumTopicCreate

When a Forum topic is created.

### forumTopicUpdate

When a Forum topic is updated/edited.

### forumTopicDelete

When a Forum topic is deleted.

### forumTopicPin

When a Forum topic is pinned.

### forumTopicUnpin

When a Forum topic is unpinned.

## Guild

### guildBanAdd

When a guild member is banned.

### guildBanRemove

When a guild member is unbanned.

### guildMemberAdd

When a user join a guild.

### guildMemberRemove

When a guild member leave a guild.

### guildMemberUpdate

When the member profile (ex: guild nickname) is updated.

### guildMemberRoleUpdate

When a role has been added/removed from a member.

## Docs

### docCreate

When a doc is created inside a docs channel.

### docUpdate

When a doc is edited/updated inside a docs channel.

### docDelete

When a doc is deleted inside a docs channel.

## Calendar

### calendarEventCreate

When an event is created inside a calendar channel.

### calendarEventUpdate

When an event is updated/edited inside a calendar channel.

### calendarEventDelete

When an event is deleted inside a calendar channel.

### calendarEventRsvpUpdate

When an event RSVP has been updated/edited.

### calendarEventRsvpDelete

When a calendar event rsvp is deleted.

## List

### listItemCreate

When an item has been created inside a list channel.

### listItemUpdate

When an item has been updated/edited inside a list channel.

### listItemDelete

When an item has been deleted inside a list channel.

### listItemComplete

When an item has been completed (checkmark, ya know) inside a list channel.

### listItemUncomplete

When an item has been uncompleted inside a list channel.

## Webhook

### webhooksCreate

When a webhook has been created.

### webhooksUpdate

When a webhook has been updated/edited.


# Types

Get to know what's in objects without console logging.

## Registered types

It means that not every types are in this category, only registered types  (Types.d.ts) are displayed in this category..

### Support us.

#### Since TouchGuild is an early access library, we can't provide everything you'd like to get. We're doing our best to release helpful articles & documentation, such as this one.

You can make pull requests and participate to its development, and that's what we want, after all. A library powered by you, the community. Guilded API is still in early access and things can evolve faster. We're making our possible to stay up to date.


# MentionsType

| Properties | Description                                | Type           |
| ---------- | ------------------------------------------ | -------------- |
| users?     | Array of object including mentioned users. | Array\<Object> |
| channels?  | List of mentioned channels                 | Array\<Object> |
| roles?     | List of mentioned roles                    | Array\<Object> |
| everyone?  | mention/ping type                          | Boolean        |
| here?      | mention/ping type                          | Boolean        |


# ListItemNoteTypes

| Properties | Description                                                        | Type                                                                                                        |
| ---------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| createdAt  | Timestamp of the note's creation.                                  | Number                                                                                                      |
| createdBy  | ID of the note's owner.                                            | String                                                                                                      |
| updatedAt? | Timestamp of when the note has been updated, if updated.           | Number                                                                                                      |
| updatedBy? | ID of the user that updated the note if the note has been updated. | String                                                                                                      |
| mentions?  | Mentions included in the list item note                            | [<mark style="color:purple;">MentionsType</mark>](/documentation/select-version/v.0.1.6/types/mentionstype) |
| content    | List item note content                                             | String                                                                                                      |


# ChannelEditTypes

Types needed when editing a channel with an edit method.

| Properties | Description                                        | Type    |
| ---------- | -------------------------------------------------- | ------- |
| name?      | Channel name                                       | String  |
| topic?     | Channel's topic/description, what's talkin' about? | String  |
| isPublic?  | is the channel public????                          | Boolean |


# ChannelCategories

Channel types/categories

String types:

* announcement
* chat
* calendar
* forums
* media
* docs
* voice
* list
* scheduling
* stream


# messageReactionRawTypes

Raw types coming from the API itself. Helpful for the lib devs.

| Properties         | Description     | Type           |
| ------------------ | --------------- | -------------- |
| serverId           | guild id        | String         |
| reaction           | reaction object | Object         |
| reaction.channelId | channel id      | String         |
| reaction.messageId | message id      | String         |
| reaction.createdBy | user id         | String         |
| emote              | emote object    | Object         |
| emote.id           | emote id        | Number\|String |
| emote.name         | emote name      | String         |
| emote.url          | emote url       | String         |


# messageReactionTypes

TouchGuild's message reaction types.

| Properties        | Description                        | Type                                                                                                           |
| ----------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| message           | Message component or raw object.   | [<mark style="color:purple;">Message</mark>](/documentation/select-version/v.0.1.6/components/message)\|Object |
| message.id        | Raw message ID                     | String (part of Object)                                                                                        |
| message.guild     | Guild component or raw object.     | [<mark style="color:purple;">Guild</mark>](/documentation/select-version/v.0.1.6/components/guild)\|Object     |
| message.guild.id  | Raw guild id                       | String (part of Object)                                                                                        |
| message.channelID | Raw channel id                     | String (part of Object)                                                                                        |
| emoji             | Emoji types including all its data | [<mark style="color:purple;">emojiTypes</mark>](/documentation/select-version/v.0.1.6/types/emojitypes)        |
| reactor           | Member component or raw object.    | [<mark style="color:purple;">Member</mark>](/documentation/select-version/v.0.1.6/components/member)\|Object   |
| reactor.id        | Raw member id                      | String (part of Object)                                                                                        |


# emojiTypes

| Properties | Description | Type           |
| ---------- | ----------- | -------------- |
| id         | Emoji id    | Number\|String |
| name       | Emoji name  | String         |
| url        | Emoji url   | String         |


# socialLinkTypes

| Properties     | Description       | Type   |
| -------------- | ----------------- | ------ |
| memberUsername | Member username   | String |
| serviceID      | ID of the service | String |
| type           | social link type  | String |


# UserClientTypes

| Properties | Description                                        | Type   |
| ---------- | -------------------------------------------------- | ------ |
| id         | Logged bot's user ID.                              | String |
| botID      | Logged bot ID of the bot.                          | String |
| username   | Logged bot's username                              | String |
| createdAt  | Timestamp (unix epoch time) of the bot's creation. | Number |
| createdBy  | Logged bot's owner id.                             | Number |


# FAQ

Frequently asked questions.

## This page is an archive and features legacy versions of TouchGuild. Any information coming from it is outdated.

<details>

<summary>Why is TouchGuild in early access?</summary>

TouchGuild is deploying slowly, we tested every methods, events.. but we're sure there is hidden bugs. It's up to you to tell us the bugs, as you use the library!

[If you find a bug, make sure to report it by clicking here.](https://github.com/DinographicPixels/TouchGuild/issues)

When we'll see that the library is stable, we'll switch to a 'B.E.T.A' branch since the Guilded API is still in early access.

</details>

<details>

<summary>How to collaborate to the library's development?</summary>

You can make [pull requests](https://github.com/DinographicPixels/TouchGuild/pulls) through our [GitHub repository](https://github.com/DinographicPixels/TouchGuild/pulls). We're enabling everyone to collaborate to your library, because it is yours.

[You don't know how pull requests works? Click here.](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository)

</details>

<details>

<summary>"I don't get why I should use TouchGuild over guilded.js"</summary>

#### TouchGuild has a different approach about how you use a library.

While creating TouchGuild, we thought about how it should be used & how to make the library durable & even if deprecation happen.

We built TouchGuild to be durable, if deprecation happens you can still use it by importing 'DevTools' and send requests to the Guilded API, we also made proper methods to use less ram & get data that directly comes from the API itself. (those methods are called Non-REST methods)

We also built our cache to be simple but useful. The TouchGuild's cache stores message, guild & member components when message sent, so you can get information about them when you'd like, and even more. You can also get the whole cache by using 'Client.cache'.

We're making interfacing with the API accessible, and easier. Everything's related to this is gonna be managed by us. You have to build everything on your own, except the communcation layer between you & Guilded.

</details>

<details>

<summary>Is TouchGuild for beginners?</summary>

TouchGuild requires advanced development skills, the basis are understandable by beginners.

The TouchGuild library does not include helpful constructors to:

* easily make embeds
* collect messages

It still can be used for beginners if they're able to create message collectors & more, if they need to.

</details>

<details>

<summary>Why types are weird compared to other libraries?</summary>

Types are inspired of Eris & Oceanic.js (Discord libraries). Every methods, properties are named wisely to be accurate about what they're actually doing.

For example, a REST method will be named 'getRESTChannelMessages' and the Non-REST method will be named 'getChannelMessages'

</details>

More frequently asked questions coming soon, as they're asked, haha!


# Our vision

Our vision, perspective about the TouchGuild library.

## This page is an archive and features legacy versions of TouchGuild. Any information coming from it is outdated.

## A library built by you, for you.

### Pull requests

We wanted to make a library where every bot developers collaborate to the project. By choosing the community, you, we're making what you like the most.

[Get started by making pull requests.](https://github.com/DinographicPixels/TouchGuild/pulls)

### Feature requests & bug report

If you know you won't collaborate to your library, you can still request features, they're helpful and they're representative of what the community would like to get.

You can also report bugs, they can be very important. By reporting you're enabling everyone to get back features that doesn't work anymore, or just issues with properties.

[You can create issues here. (issues includes feature requests & bugs, and even more).](https://github.com/DinographicPixels/TouchGuild/issues)

## TouchGuild Library Branding

### We introduce you the TouchGuild icons

<figure><img src="https://1452565314-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlOPMbaW5t7rQZWQ9C6lG%2Fuploads%2FXJ5CZrGMaAQ87ABCPhNC%2Ftouchguild-icon.png?alt=media&amp;token=69d6e395-e43f-49ae-b0f7-800ce0855369" alt="TouchGuild Icon (mini)"><figcaption></figcaption></figure>

<figure><img src="https://1452565314-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlOPMbaW5t7rQZWQ9C6lG%2Fuploads%2FvpLbn9Cjt2Qfkd2TMPFJ%2Ftouchguild-fullicon.png?alt=media&amp;token=f90293b0-fddb-42df-95f2-51464b0d9ce3" alt="TouchGuild full icon, made to be pleasant to look at."><figcaption></figcaption></figure>

## Innovation works when secrets are revealed.

### How the library works, how it treats Guilded API calls?

The library is receiving Guilded API calls through a WebSocket (WSManager.ts), this WebSocket is invoked when you use the 'connect()' method from [Client](/documentation/select-version/v.0.1.6/components/client). The Guilded API messages which are 'packets' and are converted to JSON then sent and received in the [Client](/documentation/select-version/v.0.1.6/components/client), the message is filtered and redirected to a message handler that treats and emit the component.

Every components are constructors, they delivers you the necessary methods, properties, and even cached properties, that helps you to be more productive.

We note that the library is licensed under[ Apache-2.0 license](https://github.com/DinographicPixels/TouchGuild/blob/main/LICENSE) .


# Features

New features included on Nightly builds.

## This page is an archive and features legacy versions of TouchGuild. Any information coming from it is outdated.

## v.0.1.7 has released.

The current Nightly build has been merged to the main branch, every features you have in TouchGuild v.0.1.7 are available on Nightly.

The current Nightly build does not have new features for now.

Documentation:&#x20;

{% content-ref url="/pages/wj7dH9sKxhsJOkejIAvi" %}
[v.0.1.7](/documentation/select-version/v.0.1.7)
{% endcontent-ref %}


# Examples

### Those examples can be used properly on Nightly builds.


# Snipe & editsnipe

Get last deleted/edited message content.

## This page is an archive and features legacy versions of TouchGuild. Any information coming from it is outdated.

### Usage:

* !snipe (snipes the last deleted message of the current channel)
* !editsnipe (editsnipes the last edited message of the current channel)
* !snipe CHANNELID (same as snipe but custom channel id)
* !editsnipe CHANNELID (same as editsnipe but custom channel id)

```typescript
// Importing TouchGuild.
import * as TouchGuild from 'touchguild';

// Creating client & connecting.
const client = new TouchGuild.Client({token: 'token here', REST: true});
client.connect();

// Declaring deleted & edited message maps.
var lastDeletedMessage = new Map();
var lastEditedMessage = new Map();

// Standard command handler, message detection.
client.on('messageCreate', (message)=> {
    let args = message.content?.split(' '); // array of args.

    message.content = message.content?.toLowerCase();

    if (message.content?.startsWith('!snipe') && args?.[1]){
        if (!lastDeletedMessage.has(args?.[1])) return message.createMessage({content: `No deleted message detected for: *${args?.[1]}*`});
        return message.createMessage({content: `Last deleted message content: ${lastDeletedMessage.get(args?.[1])}`});
    }else if (message.content == '!snipe'){
        if (!lastDeletedMessage.has(message.channelID)) return message.createMessage({content: 'No deleted message detected for the moment.'});
        return message.createMessage({content: `Last deleted message content: ${lastDeletedMessage.get(message.channelID)}`});
    }

    if (message.content?.startsWith('!editsnipe') && args?.[1]){
        if (!lastEditedMessage.has(args?.[1])) return message.createMessage({content: `No edited message detected for: *${args?.[1]}*`});
        return message.createMessage({content: `Last edited message content: ${lastEditedMessage.get(args?.[1])}`});
    }else if (message.content == '!editsnipe'){
        if (!lastEditedMessage.has(message.channelID)) return message.createMessage({content: 'No edited message detected for the moment.'});
        return message.createMessage({content: `Last edited message content: ${lastEditedMessage.get(message.channelID)}`});
    }
})

// Detect when message is updated/deleted & save their content.
client.on('messageUpdate', (message)=> {
    if (!message.oldContent) return; // return if message oldContent not cached.
    lastEditedMessage.set(message.channelID, message.oldContent);
})

client.on('messageDelete', (message)=> {
    if (!message.oldContent) return; // return if message oldContent not cached.
    lastDeletedMessage.set(message.channelID, message.oldContent);
})
```

{% hint style="info" %}
Examples that are in the Nightly category may not work on stable builds, if it's the case, wait for the next stable build to release.
{% endhint %}


