Represents a Guild, also called server.

Hierarchy (View Summary)

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.

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

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.

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.

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

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 } }>

  • 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>

  • 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>

  • 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

  • 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>