feat: Guild.unbanMember

This commit is contained in:
Yuzu 2022-07-01 11:16:22 -05:00
parent ea5f3d53a8
commit bc324f5d29
2 changed files with 15 additions and 0 deletions

View File

@ -264,6 +264,17 @@ export class Guild extends BaseGuild implements Model {
);
}
/*
* Unbans the member
* */
async unbanMember(memberId: Snowflake) {
await this.session.rest.runMethod<undefined>(
this.session.rest,
"DELETE",
Routes.GUILD_BAN(this.id, memberId),
);
}
async editMember(memberId: Snowflake, options: ModifyGuildMember) {
const member = await this.session.rest.runMethod<DiscordMemberWithUser>(
this.session.rest,

View File

@ -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<Member> {
const member = await Guild.prototype.editMember.call({ id: this.guildId, session: this.session }, this.user.id, options);