# 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: 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://guide.touchguild.com/managing-members/award-experience-to-server-members.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.
