Skip to main content
Version: 0.9.1

Class: Server

The base class for all structures.

Extends​

Constructors​

Constructor​

new Server(client, data): Server

Parameters​

ParameterType
clientClient
data{ }

Returns​

Server

Overrides​

Base.constructor

Properties​

analytics​

analytics: boolean = false


banner: Attachment | null = null


bans​

bans: ServerBanManager


cachedAt​

cachedAt: number

Inherited from​

Base.cachedAt


categories​

categories: object[] | null = null


channelIds​

channelIds: string[] = []


channels​

channels: ServerChannelManager


client​

protected readonly client: Client

Inherited from​

Base.client


createdAt​

createdAt: Date


createdTimestamp​

createdTimestamp: number


defaultPermissions​

defaultPermissions: bigint


description​

description: string | null = null


discoverable​

discoverable: boolean = false


emojis​

emojis: EmojiManager


flags​

flags: number = 0


icon​

icon: Attachment | null = null


id​

readonly id: string

Inherited from​

Base.id


invites​

invites: ServerInviteManager


members​

members: MemberManager


name​

name: string


nsfw​

nsfw: boolean = false


ownerId​

ownerId: string


roles​

roles: RoleManager

Methods​

_clone()​

_clone(): this

Helper to quickly clone a structure

Returns​

this

Inherited from​

Base._clone


_patch()​

_patch(data, clear?): void

Updates the server instance with new data without losing the object reference.

Parameters​

ParameterType
data{ }
clear?("Description" | "Icon" | "Categories" | "SystemMessages" | "Banner")[]

Returns​

void


edit()​

edit(options): Promise<Server>

Edits this server.

Parameters​

ParameterTypeDescription
optionsServerEditOptionsThe fields to update.

Returns​

Promise<Server>


equals()​

equals(other): boolean

Compares this object with another to see if they represent the same entity.

Parameters​

ParameterType
otherstring | Base

Returns​

boolean

Inherited from​

Base.equals


fetchAuditLogs()​

fetchAuditLogs(options?): Promise<Collection<string, AuditLogEntry>>

Fetch audit logs for this server

Parameters​

ParameterTypeDescription
options?FetchAuditLogsOptionsQuery params

Returns​

Promise<Collection<string, AuditLogEntry>>


fetchMembers()​

fetchMembers(options?): Promise<Collection<string, Member>>

Fetches multiple members from this server.

Parameters​

ParameterTypeDescription
options?FetchMembersOptionsFilter options for the fetch request.

Returns​

Promise<Collection<string, Member>>

A Collection of the fetched members.


leave()​

leave(): Promise<never>

Leaves the server

Returns​

Promise<never>


toString()​

toString(): string

Returns the UUID string when the object is cast to a string.

Returns​

string

Inherited from​

Base.toString