Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a guild from the API

Hierarchy

Index

Constructors

  • new Guild(data: Object, params: Object): Guild

Properties

apiVersion: `${number}.${number}.${number}`

The version of the requested API route

banner: BannerData

The banner data of the guild

created: Date

The creation date of the guild

createdTimestamp: number

The creation date of the guild as a unix timestamp

hasAdditionalStats: boolean

Indicates whether the object has the data returned if GuildRequestOptions.fetchAdditionalStats=true during request

This is used to determine whether `Guild#fetchAdditionalStats()` has an effect.
level: number

The level of the guild

levelProgression: number

The progress of the guild to the next level as a number between 0 and 1

libVersion: `${number}.${number}.${number}`

The version of the representation of the data by the wrapper

memberSlots: number

The maximum member count of the guild (currently uses outdated data)

members: GuildMember[]

The members of the guild

name: string

The name of the guild

requestedAt: number

The unix timestamp indicating when this request started executing

respondedAt: number

The unix timestamp indicating when this request was responded to

You can use this value in combination with timestamp to see how old the data is
If the response was returned from cache or the response took a long time to transmit, then this isn't a reliable way to determine the age of data.

The route used to request the data for this object

This is the value used to identify cache entries. API results with the same source can use the cache.
stars: number

The amount of guild stars displayed in front of the guild's tag in chat

tag: string

The tag of the guild

territories: number | Territory[]

The amount of territories the guild currently holds

If hasAdditionalStats=true, this is an array of Territories instead.
timestamp: number

The unix timestamp indicating when the data of this request was last updated

This stat does not reflect the time this data was created, but when the API frontend last synced this data. The PvP leaderboard, for instance, updates once per hour. Yet this timestamp will update once every 30 seconds.
xp: number

The XP percentage of the guilds current level; Usually a number between 0 and 1

This number may be more than 1 as levelling up takes a couple minutes. Use Guild#levelprogression instead to get a safe percentage factor.

Some data that was extracted from the guild level

Make sure Guild#xpFriendly.isSafe is true, the data will only be present on guild levels up to 150.
deprecated

will be removed in the next major release

xpRaw: number

The raw amount of xp the guild has towards the next level; this amount is not exact, refer to Guild.xpRawLower and Guild.xpRawLower for the lower and upper bound

xpRawLower: number

The lower bound of raw xp the guild has

xpRawUpper: number

The upper bound of raw xp the guild has

xpRequired: number

The total amount of XP required for the guild's current level

Methods

  • Mutates the object as if the fetchAdditionalStats property was true when this guild was requested

    This method causes API requests.

    Parameters

    • Optional options: GuildRequestOptions

      The options for the request; the guild field has no effect

    Returns Promise<Guild>

Generated using TypeDoc