diff --git a/lib/routes/Guilds.ts b/lib/routes/Guilds.ts index 1b0846c..a5f3656 100644 --- a/lib/routes/Guilds.ts +++ b/lib/routes/Guilds.ts @@ -326,7 +326,7 @@ export class Guilds { async setMemberXP(guildID: string, memberID: string, amount: PUTGuildMemberXPBody["total"]): Promise{ if (typeof amount !== "number") throw new TypeError("amount must be an integer/number."); return this.#manager.authRequest({ - method: "POST", + method: "PUT", path: endpoints.GUILD_MEMBER_XP(guildID, memberID), json: { total: amount } }).then(data => Number(data.total)); diff --git a/lib/structures/Guild.ts b/lib/structures/Guild.ts index efa2a80..fd1f0f7 100644 --- a/lib/structures/Guild.ts +++ b/lib/structures/Guild.ts @@ -237,4 +237,28 @@ export class Guild extends Base { async deleteCategory(categoryID: number): Promise { return this.client.rest.guilds.deleteCategory(this.id as string, categoryID); } + + /** Award a member using the built-in EXP system. + * @param memberID ID of the member to award. + * @param amount Amount of experience to give. + */ + async awardMember(memberID: string, amount: number): Promise{ + return this.client.rest.guilds.awardMember(this.id as string, memberID, amount); + } + + /** Set member's experience using the built-in EXP system. + * @param memberID ID of the member to award. + * @param amount Amount of experience to set. + */ + async setMemberXP(memberID: string, amount: number): Promise{ + return this.client.rest.guilds.setMemberXP(this.id as string, memberID, amount); + } + + /** Award every members of a guild having a role using the built-in EXP system. + * @param roleID ID of a role. + * @param amount Amount of experience. + */ + async awardRole(roleID: number, amount: number): Promise { + return this.client.rest.guilds.awardRole(this.id as string, roleID, amount); + } }