GuildBan

class GuildBan

A guild ban record containing the banned user and the audit-log reason, when available.

Properties

Property

Type

Description

guildId

string

Guild ID this ban applies to.

reason

string | null

Reason for the ban, or null when Discord did not provide one.

user

User

The banned user.

Methods

async GuildBan.delete(reason: string) → Promise<void>

Unban the user.

Parameters:
  • reason: Audit-log reason for removing the ban.

Returns:

A promise that resolves when the unban is complete.

async GuildBan.fetchGuild() → Promise<Guild>

Fetch the guild for this ban from Discord.

Returns:

The guild this ban belongs to.