From bc324f5d29670dd1e211dcc1904597eb012498d4 Mon Sep 17 00:00:00 2001 From: Yuzu Date: Fri, 1 Jul 2022 11:16:22 -0500 Subject: [PATCH] feat: Guild.unbanMember --- structures/Guild.ts | 11 +++++++++++ structures/Member.ts | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/structures/Guild.ts b/structures/Guild.ts index 80742ca..2f12982 100644 --- a/structures/Guild.ts +++ b/structures/Guild.ts @@ -264,6 +264,17 @@ export class Guild extends BaseGuild implements Model { ); } + /* + * Unbans the member + * */ + async unbanMember(memberId: Snowflake) { + await this.session.rest.runMethod( + this.session.rest, + "DELETE", + Routes.GUILD_BAN(this.id, memberId), + ); + } + async editMember(memberId: Snowflake, options: ModifyGuildMember) { const member = await this.session.rest.runMethod( this.session.rest, diff --git a/structures/Member.ts b/structures/Member.ts index f19a192..4603599 100644 --- a/structures/Member.ts +++ b/structures/Member.ts @@ -68,6 +68,10 @@ export class Member implements Model { return this; } + async unban() { + await Guild.prototype.unbanMember.call({ id: this.guildId, session: this.session }, this.user.id); + } + async edit(options: ModifyGuildMember): Promise { const member = await Guild.prototype.editMember.call({ id: this.guildId, session: this.session }, this.user.id, options);