> For the complete documentation index, see [llms.txt](https://guide.touchguild.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.touchguild.com/managing-members/award-experience-to-server-members.md).

# Award experience to server members

### Award a specific member

```javascript
// Detect when an interaction is created.
client.on('interactionCreate', async interaction => {
    if (interaction instanceof CommandInteraction) {
        const member = await interaction.member;
        // Award the author of the message 1000 EXP.
        // The amount of EXP is limited to 1000.
        await member?.award(1000);
    
        // OR
        await client.rest.guilds.awardMember(interaction.guildID, member?.id, 1000);
    }
})
```

### Award multiple members

```javascript
// Detect when an interaction is created.
client.on('interactionCreate', async interaction => {
    if (interaction instanceof CommandInteraction) {
        const member = await interaction.member;
        
        // Award 2 members of the guild 1000 EXP.
        // The amount of EXP is limited to 1000.
        (await interaction.guild)?.bulkAwardXP({
            amount: 1000,
            userIDs: ["dOW30kPd", "ArbX9wnA"]
        });
    
        // OR
        (await client.rest.guilds)?.bulkAwardXP(interaction.guildID, {
            amount: 1000,
            userIDs: ["dOW30kPd", "ArbX9wnA"]
        });
    }
})
```

### Award a specific role

```javascript
// Detect when an interaction is created.
client.on('interactionCreate', async interaction => {
    if (interaction instanceof CommandInteraction) {
        const member = await interaction.member;
        const roleID = 35447832; // constant: your role ID that you want to award.
    
        // Award the role that is declared as roleID.
        await client.rest.guilds.awardRole(interaction.guildID, roleID, 1000);
    }
})
```

### Set the XP of a specific member

<pre class="language-javascript"><code class="lang-javascript">// Detect when an interaction is created.
<strong>client.on('interactionCreate', async interaction => {
</strong><strong>    const member = await interaction.member;
</strong>    // Set the EXP of the author to 1000000000.
    // The amount of EXP is limited to 1000000000 (Guilded API limitations).
    await message.guild.setMemberXP(interaction.memberID, 1000000000);
})
</code></pre>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://guide.touchguild.com/managing-members/award-experience-to-server-members.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
