Represents a guild channel where you can chat with others.

Hierarchy (view full)

Constructors

  • Parameters

    • data: {
          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";
      }

      raw data

      • 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

      client

    Returns TextChannel

Properties

archivedAt: null | Date

When the channel was last archived.

archivedBy: null | string

ID of the member that archived the channel (if archived)

categoryID: null | number

ID of the category the channel is in.

client: Client

App's client.

createdAt: Date

When this channel was created.

creatorID: string

ID of the member who created this channel.

description: null | string

Channel description

editedTimestamp: null | Date

Timestamp at which this channel was last edited.

groupID: string

ID of the group the channel is in.

guildID: string

Guild ID

id: string

Item ID

Cached interactions.

isPublic: boolean

If the channel is public, this boolean is set to true.

messages: TypedCollection<string, {
    channelId: string;
    content?: string;
    createdAt: string;
    createdBy: string;
    createdByWebhookId?: string;
    embeds?: {
        author?: {
            icon_url?: string;
            name?: string;
            url?: string;
        };
        color?: number;
        description?: string;
        fields?: {
            inline: boolean;
            name: string;
            value: string;
        }[];
        footer?: {
            icon_url?: string;
            text: string;
        };
        image?: {
            url?: string;
        };
        thumbnail?: {
            url?: string;
        };
        timestamp?: string;
        title?: string;
        url?: string;
    }[];
    groupId?: string;
    hiddenLinkPreviewUrls?: string[];
    id: string;
    isPinned: boolean;
    isPrivate?: boolean;
    isSilent: boolean;
    mentions?: {
        channels?: {
            id: string;
        }[];
        everyone?: boolean;
        here?: boolean;
        roles?: {
            id: number;
        }[];
        users?: {
            id: string;
        }[];
    };
    replyMessageIds?: string[];
    serverId?: string;
    type: ChatMessageType;
    updatedAt?: string;
}, Message<TextChannel>, [params?: MessageConstructorParams]>

Cached messages.

Type declaration

  • channelId: string

    Channel ID Format: uuid

    The ID of the channel

  • Optionalcontent?: string

    Content Format: chat markdown

    The content of the message

  • createdAt: string

    Created at Format: date-time

    The ISO 8601 timestamp that the message was created at

  • createdBy: string

    Created by

    The ID of the user who created this message (Note: If this event has createdByWebhookId present, this field will still be populated, but can be ignored. In this case, the value of this field will always be Ann6LewA)

  • OptionalcreatedByWebhookId?: string

    Created by Webhook ID

    The ID of the webhook who created this message, if it was created by a webhook

  • Optionalembeds?: {
        author?: {
            icon_url?: string;
            name?: string;
            url?: string;
        };
        color?: number;
        description?: string;
        fields?: {
            inline: boolean;
            name: string;
            value: string;
        }[];
        footer?: {
            icon_url?: string;
            text: string;
        };
        image?: {
            url?: string;
        };
        thumbnail?: {
            url?: string;
        };
        timestamp?: string;
        title?: string;
        url?: string;
    }[]
  • OptionalgroupId?: string

    Group ID

    The ID of the group

  • OptionalhiddenLinkPreviewUrls?: string[]

    Hidden content link preview URLs

    Links in content to prevent unfurling as a link preview when displaying in Guilded

  • id: string

    Message ID Format: uuid

    The ID of the message

  • isPinned: boolean

    Is pinned

    false
    
  • OptionalisPrivate?: boolean

    Is private

    If set, this message will only be seen by those mentioned or replied to

  • isSilent: boolean

    Is silent

    If set, this message did not notify mention or reply recipients

    false
    
  • Optionalmentions?: {
        channels?: {
            id: string;
        }[];
        everyone?: boolean;
        here?: boolean;
        roles?: {
            id: number;
        }[];
        users?: {
            id: string;
        }[];
    }
    • Optionalchannels?: {
          id: string;
      }[]

      Channels

      Info on mentioned channels

    • Optionaleveryone?: boolean

      Everyone

      If

      was mentioned

    • Optionalhere?: boolean

      Here

      If

      was mentioned

    • Optionalroles?: {
          id: number;
      }[]

      Roles

      Info on mentioned roles

    • Optionalusers?: {
          id: string;
      }[]

      Users

      Info on mentioned users

  • OptionalreplyMessageIds?: string[]

    Message IDs that were replied to

  • OptionalserverId?: string

    Server ID

    The ID of the server

  • type: ChatMessageType

    Type

    The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated.

  • OptionalupdatedAt?: string

    Updated at Format: date-time

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

name: string

Channel name

parentID: null | string

ID of the parent category.

type: string

Channel type

visibility: string

Channel visibility

Methods

  • Create Channel Role Permissions

    Parameters

    • targetID: string | number

      ID of the target object (role or user) to assign the permission to.

    • options: {
          permissions: Record<string, never>;
      }

      Create options.

      Warning: targetID must have the correct type (number=role, string=user).

      • permissions: Record<string, never>

        A JSON object of Enums/Permissions with true, false or null values. Permission list can only contain relevant permissions for the channel type

    Returns Promise<Permission>

  • Delete a message from this channel.

    Parameters

    • messageID: string

      ID of the message to delete.

    Returns Promise<void>

  • Delete an existing permission set on this channel.

    Parameters

    • targetID: string | number

      ID of the target object (role or user) the permission is assigned to.

      Warning: targetID must have the correct type (number=role, string=user).

    Returns Promise<void>

  • Edit a channel permission.

    Parameters

    • targetID: string | number

      ID of the target object (role or user) the permission is assigned to.

    • options: {
          permissions: Record<string, never>;
      }

      Edit options

      Warning: targetID must have the correct type (number=role, string=user).

      • permissions: Record<string, never>

        A JSON object of Enums/Permissions with true, false or null values. Permission list can only contain relevant permissions for the channel type

    Returns Promise<Permission>