Represents a server ban on Guilded.

Example

new ServerBan(server, rawBan);

Hierarchy

Constructors

  • Parameters

    • server: Server

      The server the ban belongs to.

    • raw: APIServerBan

      The raw data of the server ban.

    • Optional cache: boolean

      Whether to cache the server ban.

    Returns ServerBan

Properties

client: Client
createdAt: Date

The date the ban was created.

createdBy: string

The ID of the user that created the ban.

id: string
reason?: string

The reason of the ban.

server: Server
user: User

The user the ban belongs to.

Accessors

  • get author(): undefined | User
  • The user that created the server ban.

    Returns undefined | User

  • get createdTimestamp(): number
  • The timestamp the ban was created.

    Returns number

  • get isCached(): boolean
  • Whether the server ban is cached.

    Returns boolean

Methods

  • Fetch the server ban.

    Returns

    The fetched server ban.

    Example

    ban.fetch();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the server ban with.

    Returns Promise<ServerBan>

  • Fetch the server member that created the ban.

    Returns

    The fetched server member.

    Example

    ban.fetchAuthor();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the server member with.

    Returns Promise<ServerMember>

  • Remove the server ban from the server.

    Example

    ban.remove();
    

    Returns Promise<void>