Represents the payload for creating or updating a Discord channel. This class encapsulates all the parameters needed to create or update a channel in Discord.

Constructors

  • Creates a new ChannelPayload instance.

    Parameters

    • Optionaldata: {
          available_tags?: any[];
          bitrate?: number;
          default_auto_archive_duration?: number;
          default_forum_layout?: number;
          default_reaction_emoji?: any;
          default_sort_order?: number;
          default_thread_rate_limit_per_user?: number;
          name?: string;
          nsfw?: boolean;
          parent_id?: string;
          permission_overwrites?: any[];
          position?: number;
          rate_limit_per_user?: number;
          rtc_region?: string;
          topic?: string;
          type?: number;
          user_limit?: number;
          video_quality_mode?: number;
      }

      Optional initial data to set in the payload.

      • Optionalavailable_tags?: any[]
      • Optionalbitrate?: number
      • Optionaldefault_auto_archive_duration?: number
      • Optionaldefault_forum_layout?: number
      • Optionaldefault_reaction_emoji?: any
      • Optionaldefault_sort_order?: number
      • Optionaldefault_thread_rate_limit_per_user?: number
      • Optionalname?: string
      • Optionalnsfw?: boolean
      • Optionalparent_id?: string
      • Optionalpermission_overwrites?: any[]
      • Optionalposition?: number
      • Optionalrate_limit_per_user?: number
      • Optionalrtc_region?: string
      • Optionaltopic?: string
      • Optionaltype?: number
      • Optionaluser_limit?: number
      • Optionalvideo_quality_mode?: number

    Returns ChannelPayload

Accessors

  • get defaultAutoArchiveDuration(): number
  • Gets the default auto-archive duration for threads in the channel.

    Returns number

    The default auto-archive duration in minutes.

  • set defaultAutoArchiveDuration(value): void
  • Sets the default auto-archive duration for threads in the channel.

    Parameters

    • value: number

      The auto-archive duration in minutes.

    Returns void

  • get defaultForumLayout(): number
  • Gets the default forum layout for the channel.

    Returns number

    The default forum layout.

  • set defaultForumLayout(value): void
  • Sets the default forum layout for the channel.

    Parameters

    • value: number

      The default forum layout.

    Returns void

  • get defaultReactionEmoji(): any
  • Gets the default reaction emoji for messages in the channel.

    Returns any

    The default reaction emoji object.

  • set defaultReactionEmoji(value): void
  • Sets the default reaction emoji for messages in the channel.

    Parameters

    • value: any

      The default reaction emoji object.

    Returns void

  • get defaultSortOrder(): number
  • Gets the default sort order for forum posts.

    Returns number

    The default sort order.

  • set defaultSortOrder(value): void
  • Sets the default sort order for forum posts.

    Parameters

    • value: number

      The default sort order.

    Returns void

  • get defaultThreadRateLimitPerUser(): number
  • Gets the default rate limit for threads in the channel.

    Returns number

    The rate limit in seconds.

  • set defaultThreadRateLimitPerUser(value): void
  • Sets the default rate limit for threads in the channel.

    Parameters

    • value: number

      The rate limit in seconds.

    Returns void

  • get name(): string
  • Gets the name of the channel.

    Returns string

    The channel name.

  • set name(value): void
  • Sets the name of the channel.

    Parameters

    • value: string

      The name of the channel. Must be between 1 and 100 characters.

    Returns void

    Error if the name is not between 1 and 100 characters.

  • get nsfw(): boolean
  • Gets the NSFW status of the channel.

    Returns boolean

    True if the channel is NSFW.

  • set nsfw(value): void
  • Sets the NSFW status of the channel.

    Parameters

    • value: boolean

      True if the channel should be marked NSFW.

    Returns void

  • get parentId(): string
  • Gets the parent ID of the channel (for categories).

    Returns string

    The parent channel ID.

  • set parentId(value): void
  • Sets the parent ID of the channel (for categories).

    Parameters

    • value: string

      The parent channel ID.

    Returns void

  • get permissionOverwrites(): any[]
  • Gets the permission overwrites for the channel.

    Returns any[]

    An array of permission overwrites.

  • set permissionOverwrites(value): void
  • Sets the permission overwrites for the channel.

    Parameters

    • value: any[]

      An array of permission overwrites.

    Returns void

  • get rateLimitPerUser(): number
  • Gets the rate limit per user for a text channel.

    Returns number

    The rate limit in seconds.

  • set rateLimitPerUser(value): void
  • Sets the rate limit per user for a text channel.

    Parameters

    • value: number

      The rate limit in seconds (0 to 21600).

    Returns void

    Error if the value is out of range.

  • get topic(): string
  • Gets the topic of the channel.

    Returns string

    The channel topic.

  • set topic(value): void
  • Sets the topic of the channel.

    Parameters

    • value: string

      The topic of the channel. Must be up to 1024 characters.

    Returns void

    Error if the topic exceeds 1024 characters.

  • get videoQualityMode(): number
  • Gets the video quality mode for a voice channel.

    Returns number

    The video quality mode.

  • set videoQualityMode(value): void
  • Sets the video quality mode for a voice channel.

    Parameters

    • value: number

      The video quality mode.

    Returns void

Methods

  • Converts the payload to a JSON-serializable object.

    Returns any

    A JSON-serializable representation of the payload.