Hierarchy

  • ChannelsService

Constructors

Properties

httpRequest: BaseHttpRequest

Methods

  • Create a channel Only server channels are supported at this time (coming soon™: DM Channels!)

    Throws

    ApiError

    Parameters

    • options: {
          requestBody: {
              categoryId?: number;
              groupId?: string;
              isPublic?: boolean;
              messageId?: string;
              name: string;
              parentId?: string;
              serverId?: string;
              topic?: string;
              type: "announcements" | "calendar" | "chat" | "docs" | "forums" | "list" | "media" | "scheduling" | "stream" | "voice";
              visibility?: null | "private" | "public";
          };
      }
      • requestBody: {
            categoryId?: number;
            groupId?: string;
            isPublic?: boolean;
            messageId?: string;
            name: string;
            parentId?: string;
            serverId?: string;
            topic?: string;
            type: "announcements" | "calendar" | "chat" | "docs" | "forums" | "list" | "media" | "scheduling" | "stream" | "voice";
            visibility?: null | "private" | "public";
        }
        • Optional categoryId?: number

          The category that the channel exists in. Only relevant for server channels. If not provided, channel will be a top-level channel. Optional if providing a parentId or messageId

        • Optional groupId?: string

          The ID of the group. If not provided, channel will be created in the "Server home" group from serverId or in the group that corresponds to the categoryId parameter. Optional if providing a groupId, categoryId, parentId or messageId

        • Optional isPublic?: boolean

          [DEPRECATED - use visibility instead] Whether the channel can be accessed from users who are not member of the server. Not applicable to threads

        • Optional messageId?: string

          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

        • Optional parentId?: string

          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. Optional if providing a messageId

        • Optional serverId?: string

          The ID of the server. Optional if providing a groupId, categoryId, parentId or messageId

        • Optional topic?: string

          The topic of the channel. Not applicable to threads

        • type: "announcements" | "calendar" | "chat" | "docs" | "forums" | "list" | "media" | "scheduling" | "stream" | "voice"

          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. For threads, this must be "chat" for now

        • Optional visibility?: 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

    Returns CancelablePromise<{
        channel: ServerChannelPayload;
    }>

    any Success

  • Update a channel Only server channels are supported at this time (coming soon™: DM Channels!)

    Throws

    ApiError

    Parameters

    • options: {
          channelId: string;
          requestBody: {
              isPublic?: boolean;
              name?: string;
              topic?: null | string;
              visibility?: null | "public";
          };
      }
      • channelId: string
      • requestBody: {
            isPublic?: boolean;
            name?: string;
            topic?: null | string;
            visibility?: null | "public";
        }
        • Optional isPublic?: boolean

          [DEPRECATED - use visibility instead] Whether the channel can be accessed from users who are not member of the server. Not applicable to threads

        • Optional name?: string

          The name of the channel or thread

        • Optional topic?: null | string

          The topic of the channel. Not applicable to threads

        • Optional visibility?: null | "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. At this time, you cannot update the visibility on a channel to private; this must be set at creation

    Returns CancelablePromise<{
        channel: ServerChannelPayload;
    }>

    any Success

Generated using TypeDoc