Represents a Guild, also called server.

Hierarchy (view full)

Constructors

  • Parameters

    • data: {
          about?: string;
          avatar?: string;
          banner?: string;
          createdAt: string;
          defaultChannelId?: string;
          id: string;
          isVerified?: boolean;
          name: string;
          ownerId: string;
          timezone?: string;
          type?: ServerType;
          url?: string;
      }

      raw data.

      • Optionalabout?: string

        Description

        The description associated with the server

      • Optionalavatar?: string

        Avatar Format: media-uri

        The avatar image associated with the server

      • Optionalbanner?: string

        Banner Format: media-uri

        The banner image associated with the server

      • createdAt: string

        Created at Format: date-time

        The ISO 8601 timestamp that the server was created at

      • OptionaldefaultChannelId?: string

        Channel ID Format: uuid

        The channel ID of the default channel of the server. This channel is defined as the first chat or voice channel in the left sidebar of a server in our UI. This channel is useful for sending welcome messages, though note that a bot may not have permissions to interact with this channel depending on how the server is configured.

      • id: string

        Server ID

        The ID of the server

      • OptionalisVerified?: boolean

        Is verified

        The verified status of the server

      • name: string

        Server name

        The name given to the server

      • ownerId: string

        Created by

        The ID of the user who created this server

      • Optionaltimezone?: string

        Timezone

        The timezone associated with the server

      • Optionaltype?: ServerType

        Server type

        The type of server designated from the server's settings page

      • Optionalurl?: string

        Server URL

        The URL that the server can be accessible from. For example, a value of "Guilded-Official" means the server can be accessible from https://www.guilded.gg/Guilded-Official

    • client: Client

      client.

    Returns Guild

Properties

bannerURL?: null | string

Guild banner URL.

channels: TypedCollection<string, {
    archivedAt?: string;
    archivedBy?: string;
    categoryId?: number;
    createdAt: string;
    createdBy: string;
    groupId: string;
    id: string;
    messageId?: string;
    name: string;
    parentId?: string;
    priority?: number;
    rootId?: string;
    serverId: string;
    topic?: string;
    type: ServerChannelType;
    updatedAt?: string;
    visibility?: null | "private" | "public";
}, AnyChannel, []>

Cached guild channels.

Type declaration

  • OptionalarchivedAt?: string

    Archived at Format: date-time

    The ISO 8601 timestamp that the channel was archived at, if relevant

  • OptionalarchivedBy?: string

    Archived by

    The ID of the user who archived this channel

  • OptionalcategoryId?: number

    The category that the channel exists in. Only relevant for server channels

  • createdAt: string

    Created at Format: date-time

    The ISO 8601 timestamp that the channel was created at

  • createdBy: string

    Created by

    The ID of the user who created this channel

  • groupId: string

    Group ID

    The ID of the group

  • id: string

    Channel ID Format: uuid

    The ID of the channel

  • OptionalmessageId?: string

    Message ID Format: uuid

    The ID of the message that this channel was created off of. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present

  • name: string

    The name of the channel

  • OptionalparentId?: string

    Channel ID Format: uuid

    ID of the immediate parent channel or thread in the channel hierarchy. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present

  • Optionalpriority?: number

    Priority

    The priority of the channel will determine its position relative to other categories in the group. The higher the value, the higher up it will be displayed in the UI. Returned values can be null, in which case sorting will be done by createdAt in ascending order. Due to legacy issues, sending a null value is not possible

  • OptionalrootId?: string

    Channel ID Format: uuid

    ID of the root channel or thread in the channel hierarchy. Only applicable to "chat", "voice", and "stream" channels and indicates that this channel is a thread, if present

  • serverId: string

    Server ID

    The ID of the server

  • Optionaltopic?: string

    The topic of the channel. Not applicable to threads

  • type: ServerChannelType

    The type of channel. This will determine what routes to use for creating content in a channel. For example, if this "chat", then one must use the routes for creating channel messages

  • OptionalupdatedAt?: string

    Updated at Format: date-time

    The ISO 8601 timestamp that the channel was updated at, if relevant

  • Optionalvisibility?: null | "private" | "public"

    What users can access the channel. Only applicable to server channels. If not present, this channel will respect normal permissions. public is accessible to everyone, even those who aren't of the server. private is only accessible to explicitly mentioned users. Currently, threads cannot be public and other channels cannot be private. Additionally, private threads can only exist with an associated messageId that is for a private message

client: Client

App's client.

createdAt: Date

When this guild was created.

defaultChannelID?: string

Default channel of the guild.

description?: string

Guild description.

groups: TypedCollection<string, {
    archivedAt?: string;
    archivedBy?: string;
    avatar?: string;
    createdAt: string;
    createdBy: string;
    description?: string;
    emoteId?: number;
    id: string;
    isHome?: boolean;
    isPublic: boolean;
    name: string;
    serverId: string;
    updatedAt?: string;
    updatedBy?: string;
}, Group, []>

Cached guild groups

Type declaration

  • OptionalarchivedAt?: string

    Archived at Format: date-time

    The ISO 8601 timestamp that the group was archived at, if relevant

  • OptionalarchivedBy?: string

    Archived by

    The ID of the user who archived this group

  • Optionalavatar?: string

    Avatar Format: media-uri

    The avatar image associated with the group

  • createdAt: string

    Created at Format: date-time

    The ISO 8601 timestamp that the group was created at

  • createdBy: string

    Created by

    The ID of the user who created this group

  • Optionaldescription?: string

    Description

    The description associated with the group

  • OptionalemoteId?: number

    The emote to associate with the group

  • id: string

    Group ID

    The ID of the group

  • OptionalisHome?: boolean

    Is home

    If true, this is the server's home group

  • isPublic: boolean

    Is public

    Is this group open for anyone to join?

    false
    
  • name: string

    The name of the group

  • serverId: string

    Server ID

    The ID of the server

  • OptionalupdatedAt?: string

    Updated at Format: date-time

    The ISO 8601 timestamp that the group was updated at, if relevant

  • OptionalupdatedBy?: string

    Updated by

    The ID of the user who updated this group

iconURL?: null | string

Guild icon URL.

id: string

Item ID

members: TypedCollection<string, {
    isOwner: boolean;
    joinedAt: string;
    nickname?: string;
    roleIds: number[];
    user: {
        avatar?: string;
        banner?: string;
        createdAt: string;
        id: string;
        name: string;
        status?: {
            content?: string;
            emoteId: number;
        };
        type?: UserType;
    };
}, Member, [guildID: string]>

Cached guild members.

Type declaration

  • isOwner: boolean

    Is owner

    false
    
  • joinedAt: string

    Created at Format: date-time

    The ISO 8601 timestamp that the member was created at

  • Optionalnickname?: string

    Nickname

  • roleIds: number[]

    Role IDs

  • user: {
        avatar?: string;
        banner?: string;
        createdAt: string;
        id: string;
        name: string;
        status?: {
            content?: string;
            emoteId: number;
        };
        type?: UserType;
    }
    • Optionalavatar?: string

      Avatar Format: media-uri

      The avatar image associated with the user

    • Optionalbanner?: string

      Banner Format: media-uri

      The banner image associated with the user

    • createdAt: string

      Created at Format: date-time

      The ISO 8601 timestamp that the user was created at

    • id: string

      User ID Format: user-id

      The ID of the user

    • name: string

      User name

      The user's name

    • Optionalstatus?: {
          content?: string;
          emoteId: number;
      }
      • Optionalcontent?: string

        Content Format: status markdown

        The content of the user status. The supported markdown for this content only includes reactions and plaintext for now

      • emoteId: number

        Emote ID

    • Optionaltype?: UserType

      User type

      The type of user. If this property is absent, it can assumed to be of type user

name: string

The name of the guild.

ownerID: string

ID of the guild owner.

roles: TypedCollection<number, {
    botUserId?: string;
    colors?: number[];
    createdAt: string;
    icon?: string;
    id: number;
    isBase: boolean;
    isDisplayedSeparately: boolean;
    isMentionable: boolean;
    isSelfAssignable: boolean;
    name: string;
    permissions: string[];
    priority?: number;
    serverId: string;
    updatedAt?: string;
}, Role, []>

Cached guild roles.

Type declaration

  • OptionalbotUserId?: string

    Bot user ID Format: user-id

    The bot user ID this role has been defined for. Roles with this populated can only be deleted by kicking the bot

  • Optionalcolors?: number[]

    An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient

  • createdAt: string

    Created at Format: date-time

    The ISO 8601 timestamp that the role was created at

  • Optionalicon?: string

    Role icon URL Format: media-uri

    The URL of the role icon

  • id: number

    Role ID

    The ID of the role

  • isBase: boolean

    Is Base

    The default role users are given when joining the server. Base roles are tied directly to the server and cannot be created or deleted

    false
    
  • isDisplayedSeparately: boolean

    Display Separately

    If set, the role will be displayed separately in the channel member list

    false
    
  • isMentionable: boolean

    Mentionable

    If set, this role can be mentioned

    false
    
  • isSelfAssignable: boolean

    Self Assignable

    If set, this roll will be self assigned

    false
    
  • name: string

    Role name

    The role's name

  • permissions: string[]

    Permissions must be a collection of valid permissions as defined in the Enums/Permissions section

  • Optionalpriority?: number

    Priority

    The priority the role will be in relation to other roles in the server. The higher the value, the more precedence the role has over lower priority roles, and the higher up it will be displayed in the UI. Values can be zero or negative!

  • serverId: string

    Server ID

    The ID of the server

  • OptionalupdatedAt?: string

    Updated at Format: date-time

    The ISO 8601 timestamp that the role was updated at, if relevant

timezone?: string

Guild's timezone.

type?: string

Guild type.

url?: string

The URL of the guild.

verified: boolean

If true, the guild is verified.

Accessors

  • get owner(): User | Member | Promise<Member>
  • Retrieve cached or rest guild's owner.

    Returns User | Member | Promise<Member>

Methods

  • Award a member using the built-in EXP system.

    Parameters

    • memberID: string

      ID of the member to award.

    • amount: number

      Amount of experience to give.

    Returns Promise<number>

  • Award every member of a guild having a role using the built-in EXP system.

    Parameters

    • roleID: number

      ID of a role.

    • amount: number

      Amount of experience.

    Returns Promise<void>

  • Bulk Award XP Members

    Parameters

    • options: BulkXPOptions

      Members to award XP and amount of XP to award.

    Returns Promise<{
        totalsByUserId: {
            [key: string]: number;
        };
    }>

  • Bulk set XP Members

    Parameters

    • options: BulkXPOptions

      Members to set XP and amount of XP to set.

    Returns Promise<{
        totalsByUserId: {
            [key: string]: number;
        };
    }>

  • Ban a member.

    Parameters

    • memberID: string

      ID of the member to ban.

    • Optionalreason: string

      The reason of the ban.

    Returns Promise<BannedMember>

  • Create a category

    Parameters

    • options: {
          groupId?: string;
          name: string;
      }

      Create options.

      • OptionalgroupId?: string

        Group ID

        The ID of the group. If not provided, the category will be created in the "Server home" group from serverId.

      • name: string

        Name of the category

    Returns Promise<Category>

  • Delete a category.

    Parameters

    • categoryID: number

      ID of the category you want to read.

    Returns Promise<Category>

  • Edit a category.

    Parameters

    • categoryID: number

      ID of the category you want to read.

    • options: {
          name?: string;
          priority?: number;
      }

      Options to update a category.

      • Optionalname?: string

        Name of the category

      • Optionalpriority?: number

        Priority

        The priority of the category will determine its position relative to other categories in the group. The higher the value, the higher up it will be displayed in the UI. Returned values can be null, in which case sorting will be done by createdAt in descending order. Due to legacy issues, sending a null value is not possible

    Returns Promise<Category>

  • Read a guild category.

    Parameters

    • categoryID: number

      ID of the category you want to read.

    Returns Promise<Category>

  • Get a channel from this guild, if cached.

    Parameters

    • channelID: string

      The ID of the channel to get from cache.

    Returns undefined | Channel

  • Get a member from this guild, if cached.

    Parameters

    • memberID: string

      The ID of the member to get.

    Returns undefined | Member

  • Get Subscription

    Parameters

    • subscriptionID: string

      ID of the subscription to get.

    Returns Promise<Subscription>

  • Get Subscriptions

    Returns Promise<Subscription[]>

  • Unban a member.

    Parameters

    • memberID: string

      ID of the member to unban.

    Returns Promise<void>

  • Set member's experience using the built-in EXP system.

    Parameters

    • memberID: string

      ID of the member to award.

    • amount: number

      Amount of experience to set.

    Returns Promise<number>