# 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.md) |
| joinedAt   | string representation of the \_joinedAt timestamp. | Date                                                               |
| user       | User component with less information.              | [User](/documentation/select-version/v.0.1.7/components/user.md)   |

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://legacy.docs.touchguild.com/documentation/select-version/v.0.1.7/components/member.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
