Represents a guild announcement channel.

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 AnnouncementChannel

Properties

announcements: TypedCollection<string, {
    channelId: string;
    content: string;
    createdAt: string;
    createdBy: string;
    groupId: string;
    id: string;
    mentions?: {
        channels?: {
            id: string;
        }[];
        everyone?: boolean;
        here?: boolean;
        roles?: {
            id: number;
        }[];
        users?: {
            id: string;
        }[];
    };
    serverId: string;
    title: string;
}, Announcement, []>

Cached announcements.

Type declaration

  • channelId: string

    Channel ID Format: uuid

    The ID of the channel

  • content: string

    Content Format: long-form markdown

    The content of the announcement

  • createdAt: string

    Created at Format: date-time

    The ISO 8601 timestamp that the announcement was created at

  • createdBy: string

    Created by

    The ID of the user who created this announcement

  • groupId: string

    Group ID

    The ID of the group

  • id: string

    Announcement ID

    The ID of the announcement

  • 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

  • serverId: string

    Server ID

    The ID of the server

  • title: string

    Title

    The title of the announcement

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

isPublic: boolean

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

name: string

Channel name

parentID: null | string

ID of the parent category.

type: string

Channel type

visibility: string

Channel visibility

Methods

  • Archive the channel

    Returns Promise<void>

  • Delete the channel.

    Returns Promise<void>

  • Restore the archived channel

    Returns Promise<void>