On This Page

Channels

65 symbols from @neontechspace/fluxerly

Functions#

isThreadChannel#

Whether a community channel is a thread of any type

Any other value, including undefined, returns false

isThreadChannel(
    channel: GuildChannel | undefined
): channel is GuildThreadChannelisThreadChannel(
  channel: GuildChannel | undefined
): channel is GuildThreadChannel

Parameters

channel
GuildChannel | undefined
Returns
channel is GuildThreadChannel
import { isThreadChannel } from "@neontechspace/fluxerly"
export function parentOf(channel) {
    return isThreadChannel(channel) ? channel.parentId : undefined
}
import { isThreadChannel, type GuildChannel } from "@neontechspace/fluxerly"
export function parentOf(channel: GuildChannel) {
    return isThreadChannel(channel) ? channel.parentId : undefined
}

Variables#

ChannelFlags#

Known bits in the flags of a thread, forum channel or media channel

Test a bit with bitwise AND, such as ((channel.flags ?? 0) & ChannelFlags.RequireTag) !== 0. Received flags keep bits this SDK version does not name

const ChannelFlags: Readonly<{ … }>
HideMediaDownloadOptions#

On a media channel only: Clients hide the media download options

32768
Pinned#

On a forum or media post: The post is pinned at the top of its channel

A channel holds at most one pinned post, and archiving the post clears this bit

2
RequireTag#

On a forum or media channel: A new post, or a change to a post's tags, needs at least one tag

16

ChannelType#

Choose what a new community channel does: Text messages, announcements, voice calls, a category that groups channels, or a link

Received channels use the same constants in GuildChannel.type, including threads, forum channels and media channels. A future Fluxer type that this SDK version does not know arrives as a GuildUnknownChannel, whose type is "unknown" and whose rawType keeps the number

const ChannelType: Readonly<{ … }>
Announcement#

A community announcement channel whose published messages can reach following channels

5
AnnouncementThread#

A thread inside an announcement channel, visible to everyone who can view that channel

10
Category#

A grouping parent for community channels

4
Forum#

A channel that holds posts, each a public thread with its own first message, and no messages of its own

15
Media#

A forum channel that can also hide media download options

16
PrivateThread#

A thread inside a text channel, visible only to its members and to members who can manage threads

12
PublicThread#

A thread inside a text, forum or media channel, visible to everyone who can view that channel

Every post in a forum or media channel is a public thread

11
Text#

A community text conversation

0
Voice#

A community voice-call channel

2

ForumLayout#

Layouts in which clients show the posts of a forum channel by default

Media channels have no layout setting. A received defaultForumLayout keeps a value this SDK version does not name

const ForumLayout: Readonly<{ … }>
Default#

No layout chosen, so each client uses its own default

0
Grid#

Posts as a grid of previews

2
List#

Posts as a list

1

ForumSortOrder#

Orders in which clients list the posts of a forum or media channel by default

A received defaultSortOrder keeps a value this SDK version does not name

const ForumSortOrder: Readonly<{ … }>
CreationTime#

Newest post first

1
LatestActivity#

Newest activity first

0

ThreadAutoArchiveMinutes#

Inactivity periods, in minutes, after which Fluxer archives a thread

The period counts from the later of the thread's last message and its archiveTimestamp. A new thread uses ThreeDays unless its creation sets another value, and Fluxer does not apply a parent channel's defaultAutoArchiveMinutes to it

const ThreadAutoArchiveMinutes: Readonly<{ … }>const ThreadAutoArchiveMinutes: Readonly<
  { … }
>
OneDay#

Archive after one day without activity

1440
OneHour#

Archive after one hour without activity

60
OneWeek#

Archive after one week without activity

10080
ThreeDays#

Archive after three days without activity, the default for a new thread

4320

Interfaces#

AnnouncementChannelCreate#

Creates an announcement channel with the same settings as a text channel

interface AnnouncementChannelCreate
    extends ChannelCreateBase, ThreadParentDefaultsinterface AnnouncementChannelCreate
  extends ChannelCreateBase, ThreadParentDefaults
type#

Announcement channel type

5

Inherited from ChannelCreateBase: bitrate, contentWarningLevel, contentWarningText, name, nsfw, nsfwOverride, parentId, permissionOverwrites, rateLimitPerUser, topic, url, userLimit, voiceConnectionLimit

Inherited from ThreadParentDefaults: defaultAutoArchiveMinutes, defaultThreadRateLimitPerUser

ArchivedThreadPage#

One frozen page of archived threads

Each thread the bot joined has membership set

interface ArchivedThreadPage
hasMore#

Whether Fluxer may have more threads after this page

Pass the last thread's archiveTimestamp, or its ID for "joinedPrivate", as before to read the next page

boolean
threads#

Archived threads in the order Fluxer listed them

readonly GuildThreadChannel[]

ArchivedThreadQuery#

Select one page of archived threads of a channel

Unknown keys fail locally

interface ArchivedThreadQuery
before optional#

Start before this cursor, excluding it

For "public" and "private" it is an ISO 8601 timestamp with a timezone, compared with the archive time. For "joinedPrivate" it is a decimal thread ID. Omit it for the first page

string
limit optional#

Maximum threads in the page, an integer from 2 through 100, default 50

number
scope optional#

Threads to list, default "public"

The scopes "private" and "joinedPrivate" work only in a text channel, and "private" needs Manage Threads

ArchivedThreadScope

ChannelCreateBase#

Settings shared by new text, announcement, voice, category and link channels

Supply the matching ChannelCreate type. Fluxer decides which settings apply to that channel type and enforces permissions. Omitted permissionOverwrites inherit from the parent category, while [] requests none. Unknown input keys fail locally. The encoded request body must fit within 4,194,304 bytes

interface ChannelCreateBase
bitrate optional#

Voice audio bitrate in bits per second, integer 8,000–384,000 or null, default 64,000 for voice channels

Fluxer clamps the requested value to the community's enabled bitrate tier. Read the returned channel for the applied value

number | null
contentWarningLevel optional#

0 inherits the content-warning level, 1 requests a channel content warning

number
contentWarningText optional#

Warning shown before viewing content, with 0–200 raw UTF-16 code units and null inheriting

No text normalization is applied before validation

string | null
name#

Channel name

Raw input may contain at most 10,000 UTF-16 code units. For validation, Fluxer's general-name rules remove U+000C and U+202E, trim surrounding whitespace, strip provider-defined invisible characters, normalize whitespace and collapse its runs, then require 1–100 UTF-16 code units. The SDK sends the original string without lowercasing or hyphenating it

string
nsfw optional#

Adult-content setting using Fluxer's older NSFW field

True marks the channel adult-only, while false inherits the parent category or community setting like omission. Use nsfwOverride false to mark it not adult-only. When both are present, nsfwOverride wins

boolean
nsfwOverride optional#

Explicit adult-content override, with null inheriting

boolean | null
parentId optional#

Parent category, with null or omission creating a top-level channel

string | null
permissionOverwrites optional#

Explicit overrides, omitted to inherit a parent category and [] to create no overrides

readonly PermissionOverwrite[]
rateLimitPerUser optional#

Delay between a user's messages in seconds, integer 0–21,600 or null

Zero disables slowmode

number | null
topic optional#

Description shown for the channel, 1–1,024 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming, or null to clear

The original string is sent unchanged

string | null
url optional#

Absolute URL for a link channel, or null to clear

The SDK does not open or fetch the URL

string | null
userLimit optional#

Maximum voice users from 0 through 99, with 0 unlimited and the voice default

number | null
voiceConnectionLimit optional#

Voice connections per user from 1 through 100, default 5 for voice channels

number | null

ChannelEdit#

Change an existing community channel's settings without replacing the channel

Omitted fields stay unchanged. The permissionOverwrites list replaces the whole explicit list, so include entries that must stay. Use channels.reorder to move a channel between categories or change its order. Unknown keys and an empty patch fail locally. Fluxer checks channel-type compatibility and permissions after local validation

interface ChannelEdit
availableTags optional#

Replace the complete tag list of a forum or media channel, at most 20 tags

Fluxer rejects two tags with the same name. Entries with an id keep that tag, entries without one add a tag, and a tag left out is deleted. Use channels.createForumTag, editForumTag and deleteForumTag to change one tag without sending the list. Fluxer ignores this setting for another channel type

readonly ForumTagInput[]
bitrate optional#

Voice bitrate in bits per second, integer 8,000–384,000, or null

Fluxer clamps the requested value to the community's enabled bitrate tier. Read the returned channel for the applied value

number | null
contentWarningLevel optional#

0 inherits the content-warning level, 1 requests a channel content warning

number
contentWarningText optional#

Warning text with 0–200 raw UTF-16 code units, with null inheriting

No text normalization is applied before validation

string | null
defaultAutoArchiveMinutes optional#

Auto-archive period in minutes that a text, announcement, forum or media channel stores for its threads: One of the ThreadAutoArchiveMinutes values, or null to clear it

Fluxer stores the value but does not apply it to a new thread. Fluxer ignores it for another channel type, and on a text or announcement channel in a community where threads are not active

number | null
defaultForumLayout optional#

Default post layout of a forum channel, a ForumLayout value

Null sets ForumLayout.Default. Fluxer ignores it for a media channel and for another channel type

number | null
defaultReactionEmoji optional#

Reaction that clients show on each post of a forum or media channel, or null for none

Fluxer ignores it for another channel type

ForumDefaultReactionInput | null
defaultSortOrder optional#

Default post order of a forum or media channel, a ForumSortOrder value, or null for none

Fluxer ignores it for another channel type

number | null
defaultTagSetting optional#

How a post search of a forum or media channel matches several tags by default: "match_some" finds posts with any of them and "match_all" only posts with all of them

Null sets "match_some". Fluxer ignores it for another channel type

"match_some" | "match_all" | null
defaultThreadRateLimitPerUser optional#

Slowmode delay in seconds that a new thread in a text, announcement, forum or media channel copies when its creation sets none, an integer from 0 through 21,600, or null to clear it

Fluxer ignores it for another channel type, and on a text or announcement channel in a community where threads are not active

number | null
flags optional#

Flags of a forum or media channel, replacing all of them: Include ChannelFlags.RequireTag to keep it required

RequireTag needs at least one tag that is not moderated, and ChannelFlags.HideMediaDownloadOptions is valid on a media channel only. Fluxer checks both against the channel, and any other bit fails locally. Fluxer ignores this setting for another channel type

number
name optional#

Channel name

Raw input may contain at most 10,000 UTF-16 code units. For validation, Fluxer's general-name rules remove U+000C and U+202E, trim surrounding whitespace, strip provider-defined invisible characters, normalize whitespace and collapse its runs, then require 1–100 UTF-16 code units. The SDK sends the original string without lowercasing or hyphenating it

string
nsfw optional#

Adult-content setting using Fluxer's older NSFW field

True marks the channel adult-only, while false and null restore inheritance from the parent category or community. Use nsfwOverride false to mark it not adult-only. When both are present, nsfwOverride wins

boolean | null
nsfwOverride optional#

Explicit adult-content override, with null inheriting

boolean | null
permissionOverwrites optional#

Replace all explicit overwrites, with [] clearing them and omission preserving them

readonly PermissionOverwrite[]
rateLimitPerUser optional#

Delay between a user's messages in seconds, integer 0–21,600, or null

Zero disables slowmode

number | null
rtcRegion optional#

Voice region ID of 1–64 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming, with null selecting automatic routing

The original string is sent unchanged

string | null
topic optional#

Channel description, 1–1,024 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming, or null to clear

A forum or media channel allows up to 4,096 code units, which Fluxer checks against the channel's type. The original string is sent unchanged

string | null
type optional#

Convert between Text (0) and Announcement (5), alone or with other settings

Omission preserves the type. Other values fail locally. Fluxer requires ManageChannels and rejects converting a text channel that receives follows with CHANNEL_HAS_FOLLOWED_CHANNELS. Converting Announcement to Text queues asynchronous follower removal. Fluxer emits a complete Channel Update with the new type, replacing any cached observation before handlers run. The edit does not await that event or follower removal

0 | 5

See https://github.com/fluxerapp/fluxer/blob/597116a0b4bf3a212789bdebe7f284babc33b445/fluxer_api/src/api/channel/services/channel_data/ChannelOperationsService.ts

url optional#

Absolute link-channel URL, or null to clear

No URL is fetched by this request

string | null
userLimit optional#

Maximum voice users, integer 0–99, or null

Zero requests unlimited users

number | null
voiceConnectionLimit optional#

Maximum simultaneous voice connections per user, integer 1–100, or null

number | null

ChannelFollowInput#

Subscribe a text channel to messages published from an announcement channel

Fluxer validates the source, target and permissions without an SDK prefetch

interface ChannelFollowInput
targetChannelId#

Decimal ID of the receiving community text channel, whose type must be ChannelType.Text

string

ChannelFollowerStats#

A frozen count of channels and communities following one announcement channel

Fluxer can cache these counts for up to 60 seconds. They are not live subscriptions

interface ChannelFollowerStats
channelCount#

Number of following channels

number
guildCount#

Number of distinct communities containing following channels

number

ChannelMemberCount#

Visible member totals for one requested channel, with the guild ID supplied by the gateway response

Counts concern this channel's visibility, not the full community membership

interface ChannelMemberCount extends GuildCountinterface ChannelMemberCount
  extends GuildCount
channelId#

Requested channel ID as a positive decimal string with no leading zeroes, no greater than 9223372036854775807

string
memberCount#

Nonnegative visible members Fluxer reported for this channel, not the community total

number
onlineCount#

Nonnegative visible online members Fluxer reported for this channel, not the community total

number

Inherited from GuildCount: guildId

ChannelMemberCountsResult#

Results from one community's requested channel counts, ordered to match the requested channel IDs

The omittedChannelIds field lists requested IDs for which Fluxer returned no count. The SDK does not substitute zero or infer why. A community assigned to an unowned or unready shard fails the call with notConnected instead

interface ChannelMemberCountsResult
counts#

Frozen count entries in the caller's requested channel-ID order

readonly ChannelMemberCount[]
omittedChannelIds#

Frozen requested channel IDs without a returned entry, in caller input order

readonly string[]

ChannelPosition#

Move or reorder one community channel with channels.reorder

Channels left out of the request are not explicit targets. Fluxer applies entries in order, so the requested position may not be the final position if another change happens at the same time

interface ChannelPosition
id#

Decimal channel ID

string
parentId optional#

New parent category, with null moving to the top level and omission preserving the parent

string | null
position optional#

Nonnegative requested sibling position

number
precedingSiblingId optional#

Sibling directly preceding this channel, with null placing it first

string | null
syncPermissionsOnMove optional#

Copy destination overwrites only when moving into a new category, default false and no sync for the same parent

boolean

Channels#

Read, create and change community channels, with optional local cache lookup

Use directMessages for private conversations instead. Most methods use HTTP without a gateway connection. The fetchMemberCounts method requires a ready gateway

interface Channels

Supply decimal community-channel IDs. ID-based writes do not fetch first to verify channel type. Requests share the client's REST or upload slots across assigned shards, four per local shard by default, up to 64 (rest.concurrency). Attachment-download slots are separate, four by default (rest.mediaConcurrency). Both pools together allow 256 waiting requests or 4 MiB of queued JSON by default (rest.maxQueued and rest.queuedJsonMaxBytes). The default deadline, rest.defaultTimeoutMs (30,000 ms unless configured), includes capacity, rate-limit and retry waits. Eligible reads retry transport and HTTP 500, 502, 503 or 504 failures at most twice

Writes retry only confirmed HTTP 429 rejection. Input, permission, not-found and malformed responses do not retry

Inputs are copied when called. Permission values use bigint and are sent as decimal JSON strings. Fluxer enforces permissions and restrictions on granting flags. Targeted role and member overwrites require ManageRoles. A dispatched channel change removes the written channel from the enabled channel cache, with its threads when the change deletes the channel or converts its type, and with the forum posts that apply a tag it removes, as deleteForumTag and an edit with availableTags can, because Fluxer drops removed tags from posts without a thread update. A change to a category, or one that names a community, such as create or reorder, removes that community's cached channels. A change to a channel the cache does not hold removes every cached channel, because its community is unknown. Local input failure before dispatch preserves the cache, and a change rejected after dispatch removes the same entries. No write is followed by an automatic confirmation fetch. The follow, create, edit, delete, reorder, permission-overwrite and forum-tag mutations accept a raw audit reason through AuditedRequestOptions. Read operations reject auditReason instead of sending a meaningless header. Expected failures return ChannelOperationError or ClientClosedError. Abort returns CancelledError after cleanup. Unexpected failures reject with SdkDefect

create#

Create a supported community channel and return its frozen server snapshot

Fluxer chooses the initial position. Omitting permissionOverwrites inherits the selected parent category's overwrites. An empty [] creates no explicit overwrites, which does not make a channel private. Explicit overwrites use Fluxer's required feature opt-in for ViewChannelMembers. Unless the bot has Administrator, each overwrite can allow only permissions the bot has in the parent category, or in the community when there is no parent, and Fluxer answers missingPermissions otherwise. Denies are not checked. Use permissionBits.refusedGrants to see beforehand which bits Fluxer would refuse. Each allow and deny mask must be from 0n through 9_223_372_036_854_775_807n, and invalid masks fail before dispatch. The example denies ViewChannel to everyone and grants access to the named bot. The application manages the created channel afterward. After an unknown outcome, use fetchAll before deciding whether to create again. The result does not confirm gateway delivery

create(
    guildId: string,
    input: ChannelCreate,
    options?: AuditedRequestOptions
): ResultAsync<
    GuildChannel,
    ChannelOperationFailure | ConfigurationError | CancelledError
>create(
  guildId: string,
  input: ChannelCreate,
  options?: AuditedRequestOptions
): ResultAsync<
  GuildChannel,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

ChannelType.Forum and ChannelType.Media create a channel that holds posts instead of messages. Besides the shared settings, they accept availableTags, defaultReactionEmoji, defaultSortOrder, defaultTagSetting, flags and the two thread defaults, and a forum channel also accepts defaultForumLayout. Text and announcement channels accept only the thread defaults defaultAutoArchiveMinutes and defaultThreadRateLimitPerUser. A setting that the channel type does not accept fails locally. Fluxer rejects forum and media channels in a community where threads are not active, and ignores the two thread defaults on text and announcement channels there. The result of a forum or media creation lists the stored tags, whose IDs Fluxer assigns

Parameters

guildId
string
options optional
AuditedRequestOptions
import { ChannelType, Permissions } from "@neontechspace/fluxerly"
export async function channelExample(client, guildId, botId) {
    const result = await client.channels.create(guildId, {
        type: ChannelType.Text,
        name: "private-support",
        permissionOverwrites: [
            { id: guildId, type: "role", allow: 0n, deny: Permissions.ViewChannel },
            { id: botId, type: "member", allow: Permissions.ViewChannel | Permissions.SendMessages, deny: 0n },
        ],
    })
    if (result.isErr())
        throw result.error
    return result.value
}
import { ChannelType, Permissions, type Client } from "@neontechspace/fluxerly"
export async function channelExample(client: Client, guildId: string, botId: string) {
    const result = await client.channels.create(guildId, {
        type: ChannelType.Text,
        name: "private-support",
        permissionOverwrites: [
            { id: guildId, type: "role", allow: 0n, deny: Permissions.ViewChannel },
            { id: botId, type: "member", allow: Permissions.ViewChannel | Permissions.SendMessages, deny: 0n },
        ],
    })
    if (result.isErr()) throw result.error
    return result.value
}

createForumTag#

Add one tag to a forum or media channel and return the frozen updated channel

Fluxer requires ManageChannels, assigns the tag's ID, and rejects a tag whose name another tag of the channel already uses, a custom emoji that the community does not have, and a channel that already has 20 tags. Find the new tag by name in the result's availableTags. Fluxer applies the tag like a channel edit, so it emits a Channel Update and an audit-log entry. The SDK reads nothing first, so a channel that is not a forum or media channel fails with Fluxer's rejection. After an unknown outcome, fetch the channel before adding the tag again, because the name is already taken when the first attempt applied

createForumTag(
    channelId: string,
    input: ForumTagInput,
    options?: AuditedRequestOptions
): ResultAsync<
    GuildForumChannel | GuildMediaChannel,
    ChannelOperationFailure | ConfigurationError | CancelledError
>createForumTag(
  channelId: string,
  input: ForumTagInput,
  options?: AuditedRequestOptions
): ResultAsync<
  | GuildForumChannel
  | GuildMediaChannel,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
options optional
AuditedRequestOptions

delete#

Delete a community channel, succeeding with no value after HTTP 204

No gateway event is awaited and no prior channel existence is proven. The SDK does not fetch the ID first. Fluxer deletes the channel's invites, webhooks, attachments and messages, and detaches a category's children, before it deletes the channel itself. A channel that still exists after a failure may already have lost any of these. A lost response or timeout after dispatch can leave it deleted

delete(
    channelId: string,
    options?: AuditedRequestOptions
): ResultAsync<
    void,
    ChannelOperationFailure | ConfigurationError | CancelledError
>delete(
  channelId: string,
  options?: AuditedRequestOptions
): ResultAsync<
  void,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
options optional
AuditedRequestOptions

deleteForumTag#

Delete one tag from a forum or media channel and return the frozen updated channel

Posts that carried the tag stop showing it. Fluxer requires ManageChannels and rejects a tag ID that the channel does not have, which includes a tag that an earlier call already deleted, and the deletion of the last tag that is not moderated while the channel has ChannelFlags.RequireTag. The call is otherwise an availableTags edit, as createForumTag describes

deleteForumTag(
    channelId: string,
    tagId: string,
    options?: AuditedRequestOptions
): ResultAsync<
    GuildForumChannel | GuildMediaChannel,
    ChannelOperationFailure | ConfigurationError | CancelledError
>deleteForumTag(
  channelId: string,
  tagId: string,
  options?: AuditedRequestOptions
): ResultAsync<
  | GuildForumChannel
  | GuildMediaChannel,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
tagId
string
options optional
AuditedRequestOptions

edit#

Change only the supplied channel settings and return the frozen server snapshot

An empty input or unknown field fails locally. Use reorder to change a parent or position. Supply type to convert between Text and Announcement, alone or with other settings. Fluxer requires ManageChannels and rejects converting a text channel that receives follows with CHANNEL_HAS_FOLLOWED_CHANNELS. Converting Announcement to Text queues asynchronous follower removal. Fluxer emits a complete Channel Update with the new type, which replaces the cached observation before handlers run. This call does not await gateway delivery or follower removal. Omitted permissionOverwrites keeps the old list, and [] clears it. Each replacement allow and deny mask must be from 0n through 9_223_372_036_854_775_807n. Explicit replacement handles setting and clearing ViewChannelMembers through Fluxer's required feature opt-in. Unless the bot has Administrator, each changed overwrite can allow, or stop denying, only permissions the bot has in this channel, and Fluxer answers missingPermissions otherwise. Use permissionBits.refusedGrants to see beforehand which bits Fluxer would refuse. On a category, a permissionOverwrites change also writes each child whose overwrites matched the category's old ones, in separate writes. Fluxer offers no way to leave a child out, and permissionBits.sameOverwrites shows which children match. A failure can leave some children with the old overwrites. A retry may skip them, because Fluxer selects children by comparing with the category's overwrites at the time of that call, so fetch the children again to check. The thread defaults and the forum settings apply to the channel types named on each field. The SDK cannot see the channel's type, so Fluxer ignores a setting that does not belong to it. The availableTags list replaces every tag of a forum or media channel, so channels.createForumTag, editForumTag and deleteForumTag are the safer way to change one tag. Pass a received channel's availableTags back to keep all its tags

edit(
    channelId: string,
    input: ChannelEdit,
    options?: AuditedRequestOptions
): ResultAsync<
    GuildChannel,
    ChannelOperationFailure | ConfigurationError | CancelledError
>edit(
  channelId: string,
  input: ChannelEdit,
  options?: AuditedRequestOptions
): ResultAsync<
  GuildChannel,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
options optional
AuditedRequestOptions

editForumTag#

Replace one tag of a forum or media channel and return the frozen updated channel

This is a full replacement: A moderated value or emoji that the input leaves out becomes false or none instead of keeping its old value, so read the tag first to change only one of its settings. The tag keeps its ID and the posts that carry it. Fluxer requires ManageChannels and rejects a tag ID that the channel does not have, a name that another tag already uses, and a change that would leave a channel with ChannelFlags.RequireTag without a tag that is not moderated. The call is otherwise an availableTags edit, as createForumTag describes

editForumTag(
    channelId: string,
    tagId: string,
    input: ForumTagInput,
    options?: AuditedRequestOptions
): ResultAsync<
    GuildForumChannel | GuildMediaChannel,
    ChannelOperationFailure | ConfigurationError | CancelledError
>editForumTag(
  channelId: string,
  tagId: string,
  input: ForumTagInput,
  options?: AuditedRequestOptions
): ResultAsync<
  | GuildForumChannel
  | GuildMediaChannel,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
tagId
string
options optional
AuditedRequestOptions

fetch#

Fetch a community channel by decimal ID and return a frozen snapshot

The ID can name a thread or a forum post, which returns a thread shape, so compare type or use isThreadChannel before reading fields that only some shapes have. A thread has no permission overwrites of its own. A private-channel response fails with a typed response error. Permission overwrites describe explicit settings, not inherited or effective permissions. This neither connects the gateway nor populates a complete community-channel list

fetch(channelId: string, options?: RequestOptions): ResultAsync<
    GuildChannel,
    ChannelOperationFailure | ConfigurationError | CancelledError
>fetch(
  channelId: string,
  options?: RequestOptions
): ResultAsync<
  GuildChannel,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
options optional
RequestOptions

fetchAll#

Fetch the community channels currently visible to the bot, without pagination

The returned list is a point-in-time snapshot, not a subscription or completeness guarantee. It never includes threads, which Fluxer lists separately: Use threads.fetchActive for the active ones. No members, roles, private channels or missing overwrite targets are fetched

fetchAll(guildId: string, options?: RequestOptions): ResultAsync<
    readonly GuildChannel[],
    ChannelOperationFailure | ConfigurationError | CancelledError
>fetchAll(
  guildId: string,
  options?: RequestOptions
): ResultAsync<
  readonly GuildChannel[],
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

guildId
string
options optional
RequestOptions

fetchFollowerStats#

Fetch frozen channel and distinct community follower counts for a viewable announcement channel

Fluxer can cache these counts for up to 60 seconds, so they need not include the latest follow changes. This does not populate channel caches or subscribe to changes. The auditReason option is not supported

fetchFollowerStats(
    channelId: string,
    options?: RequestOptions
): ResultAsync<
    ChannelFollowerStats,
    ChannelOperationFailure | ConfigurationError | CancelledError
>fetchFollowerStats(
  channelId: string,
  options?: RequestOptions
): ResultAsync<
  ChannelFollowerStats,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
options optional
RequestOptions

fetchMemberCounts#

Request fresh member counts for 1–25 channels in one community over the connected gateway

Use distinct positive decimal channel IDs without leading zeros, no greater than "9223372036854775807". The community ID must satisfy the same bound. The IDs are copied when execution starts

fetchMemberCounts(
    guildId: string,
    channelIds: readonly string[],
    options?: RequestOptions
): ResultAsync<
    ChannelMemberCountsResult,
    ConfigurationError | CountOperationFailure | CancelledError
>fetchMemberCounts(
  guildId: string,
  channelIds: readonly string[],
  options?: RequestOptions
): ResultAsync<
  ChannelMemberCountsResult,
  | ConfigurationError
  | CountOperationFailure
  | CancelledError
>

The community must have a ready shard assigned to this client, or the call fails with notConnected instead of listing omitted channels. Fluxer requires ViewChannel and ViewChannelMembers. The result has frozen counts and omittedChannelIds in requested order. Omission means unavailable, not zero, and does not explain access or other causes

The guilds.fetchCounts method's four shared gateway slots, default 30,000 ms deadline and failure rules apply. There is no waiting queue for request slots, implicit connection, REST fallback, cache write or retry. Commands may wait for gateway pacing, and a full internal command queue fails with busy. Only a gap on this community's shard fails the request. Counts are separate visibility-filtered observations, not a subscription or a cross-channel snapshot. Cancellation or deadline expiry withdraws an unsent command and releases local request capacity. Work already sent to Fluxer cannot be withdrawn

Parameters

guildId
string
channelIds
readonly string[]
options optional
RequestOptions

follow#

Follow an announcement channel into the supplied community text channel and return frozen source and webhook IDs

The source must be viewable, have type Announcement and belong to a community with announcements enabled. The target must have type Text, with ViewChannel and ManageWebhooks on that channel plus community-level ManageWebhooks. Fluxer enforces webhook capacity and rejects duplicate source-to-target follows

follow(
    channelId: string,
    input: ChannelFollowInput,
    options?: AuditedRequestOptions
): ResultAsync<
    FollowedChannel,
    ChannelOperationFailure | ConfigurationError | CancelledError
>follow(
  channelId: string,
  input: ChannelFollowInput,
  options?: AuditedRequestOptions
): ResultAsync<
  FollowedChannel,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

An adult source requires an adult target. A content-warning source requires an adult or content-warning target. These settings include inherited category and community restrictions, checked by Fluxer without an SDK prefetch. Success creates a channel-follower webhook and emits Webhooks Update for the target. Fluxer also attempts a ChannelFollowAdd notice in the target, but a notice failure does not fail the follow. Neither gateway delivery nor notice creation is confirmed by this result. Use client.webhooks.delete with the returned webhookId to stop following

The auditReason option is consumed by the created webhook's audit entry. A lost or malformed response can leave the follow created and is never resent automatically. Inspect the target's webhooks before retrying an unknown outcome

Parameters

channelId
string
options optional
AuditedRequestOptions

get#

Look up a community channel in the enabled cache, without an HTTP request or a connection

The result is undefined when caching is disabled or the entry is absent, expired or evicted. The result can be a thread, forum channel or media channel, so compare type or use isThreadChannel before reading fields that only some shapes have. A hit may be stale and becomes more recently used without extending expiry. Use fetch for a remote read. An invalid ID is misuse: The default API throws ChannelOperationError with reason input and the native API dies with it. A closing or closed client has no cache, so the result is undefined

get(channelId: string): GuildChannel | undefinedget(
  channelId: string
): GuildChannel | undefined

Parameters

channelId
string
Returns
GuildChannel | undefined

Returns the value synchronously. Unexpected failures throw SdkDefect

removePermissionOverwrite#

Remove one explicit permission overwrite by decimal role or member target ID

Other overwrites remain unchanged. HTTP 204 succeeds with no value. Fluxer requires ManageRoles. Unless the bot has Administrator, it can remove an overwrite only when it has every permission that the overwrite denies in this channel, and Fluxer answers missingPermissions otherwise. To check beforehand, call permissionBits.refusedGrants with the overwrite as current and undefined as next. On a category, Fluxer writes the category first and then each child whose overwrites matched the category's old ones, in separate writes. Fluxer offers no way to leave a child out, and permissionBits.sameOverwrites shows which children match. A failure can leave some children with the old overwrites. A retry may skip them, because Fluxer selects children by comparing with the category's overwrites at the time of that call, so fetch the children again to check. An unknown outcome needs an explicit follow-up read

removePermissionOverwrite(
    channelId: string,
    targetId: string,
    options?: AuditedRequestOptions
): ResultAsync<
    void,
    ChannelOperationFailure | ConfigurationError | CancelledError
>removePermissionOverwrite(
  channelId: string,
  targetId: string,
  options?: AuditedRequestOptions
): ResultAsync<
  void,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
targetId
string
options optional
AuditedRequestOptions

reorder#

Submit community-channel moves, succeeding with no value after HTTP 204

Fluxer applies moves sequentially and may normalize positions. The syncPermissionsOnMove option copies the destination category's overwrites, and applies only to a move into another category. Fluxer copies them after each move, so a failed copy leaves that channel moved without them. Unless the bot has Administrator, the copied overwrites can allow, or stop denying, only permissions the bot has in the moved channel, and the copy fails with missingPermissions otherwise. Use permissionBits.refusedGrants to see beforehand which bits Fluxer would refuse. A bulk channel event can arrive before that copy finishes. Failures can leave partial movement because this is not a transaction, and the error does not list the moves that finished. Use fetchAll afterward when final order matters, and after a failure to read the actual order and parents before sending moves again. The Communities & permissions guide shows how to keep the failure while reading them. Fluxer currently accepts auditReason on this route without retaining it in an audit entry. No reordered list is invented locally

reorder(
    guildId: string,
    positions: readonly ChannelPosition[],
    options?: AuditedRequestOptions
): ResultAsync<
    void,
    ChannelOperationFailure | ConfigurationError | CancelledError
>reorder(
  guildId: string,
  positions:
    readonly ChannelPosition[],
  options?: AuditedRequestOptions
): ResultAsync<
  void,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

guildId
string
positions
readonly ChannelPosition[]
options optional
AuditedRequestOptions

setPermissionOverwrite#

Replace one explicit role or member permission overwrite

Supply the target ID and raw bigint allow and deny flags. Each mask must be from 0n through 9_223_372_036_854_775_807n, and larger received masks cannot be written unchanged. HTTP 204 succeeds with no value. Fluxer requires ManageRoles and uses a feature opt-in to set or clear ViewChannelMembers. Unless the bot has Administrator, the overwrite can allow, or stop denying, only permissions the bot has in this channel, and Fluxer answers missingPermissions otherwise. To see beforehand which bits Fluxer would refuse, pass permissionBits.refusedGrants the current overwrite, the new one and the bot's bits in this channel, from permissions.fetch with a channelId or from permissions.fetchChannels. On a category, Fluxer writes the category first and then each child whose overwrites matched the category's old ones, in separate writes. Fluxer offers no way to leave a child out, and permissionBits.sameOverwrites shows which children match. A failure can leave some children with the old overwrites. A retry may skip them, because Fluxer selects children by comparing with the category's overwrites at the time of that call, so fetch the children again to check. No target fetch or inherited-permission calculation is performed

setPermissionOverwrite(
    channelId: string,
    input: PermissionOverwrite,
    options?: AuditedRequestOptions
): ResultAsync<
    void,
    ChannelOperationFailure | ConfigurationError | CancelledError
>setPermissionOverwrite(
  channelId: string,
  input: PermissionOverwrite,
  options?: AuditedRequestOptions
): ResultAsync<
  void,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
options optional
AuditedRequestOptions

FollowedChannel#

A confirmed announcement-channel follow, returned as a frozen value

Delete webhookId through client.webhooks.delete to stop following

interface FollowedChannel
channelId#

Decimal ID of the followed announcement channel, not the receiving channel

string
webhookId#

Decimal ID of the channel-follower webhook created in the receiving channel

string

ForumChannelCreate#

Creates a forum channel, which holds posts instead of messages

interface ForumChannelCreate extends ForumChannelCreateBaseinterface ForumChannelCreate
  extends ForumChannelCreateBase
defaultForumLayout optional#

Default post layout, a ForumLayout value

Null sets ForumLayout.Default

number | null
type#

Forum channel type

15

Inherited from ForumChannelCreateBase: availableTags, bitrate, contentWarningLevel, contentWarningText, defaultAutoArchiveMinutes, defaultReactionEmoji, defaultSortOrder, defaultTagSetting, defaultThreadRateLimitPerUser, flags, name, nsfw, nsfwOverride, parentId, permissionOverwrites, rateLimitPerUser, topic, url, userLimit, voiceConnectionLimit

ForumChannelCreateBase#

Settings shared by new forum and media channels

Supply ForumChannelCreate or MediaChannelCreate. The tags, default reaction, sort order, tag setting and flags are the same as the matching ChannelEdit fields. Fluxer rejects creating a forum or media channel in a community where threads are not active (GuildListSummary.threadsActive is false)

interface ForumChannelCreateBase
    extends ChannelCreateBase, ThreadParentDefaultsinterface ForumChannelCreateBase
  extends ChannelCreateBase, ThreadParentDefaults
availableTags optional#

Tags that posts can carry, at most 20

Fluxer rejects two tags with the same name. Omission creates none

readonly ForumTagInput[]
defaultReactionEmoji optional#

Reaction that clients show on each post, or null for none

ForumDefaultReactionInput | null
defaultSortOrder optional#

Default post order, a ForumSortOrder value, or null for none

number | null
defaultTagSetting optional#

How a post search matches several tags by default: "match_some" finds posts with any of them and "match_all" only posts with all of them

Null and omission leave "match_some"

"match_some" | "match_all" | null
flags optional#

Channel flags

Supply ChannelFlags.RequireTag to make every new post carry a tag, which needs at least one tag that is not moderated. On a media channel, add ChannelFlags.HideMediaDownloadOptions to hide the download options. Any other bit fails locally

number
topic optional#

Posting guidelines, 1–4,096 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming, or null for none

The original string is sent unchanged

string | null

Inherited from ChannelCreateBase: bitrate, contentWarningLevel, contentWarningText, name, nsfw, nsfwOverride, parentId, permissionOverwrites, rateLimitPerUser, url, userLimit, voiceConnectionLimit

Inherited from ThreadParentDefaults: defaultAutoArchiveMinutes, defaultThreadRateLimitPerUser

ForumDefaultReaction#

The reaction that clients show on each post of a forum or media channel

interface ForumDefaultReaction
emojiId#

Decimal ID of a custom emoji of this community, or null for a Unicode emoji

string | null
emojiName#

A Unicode emoji, or null for a custom emoji

string | null

ForumDefaultReactionInput#

The reaction that clients show on each post of a forum or media channel

Set at most one of emojiId and emojiName. A received ForumDefaultReaction is also valid input

interface ForumDefaultReactionInput
emojiId optional#

Decimal ID of a custom emoji of this community, or null

Fluxer rejects an emoji that the community does not have

string | null
emojiName optional#

A single Unicode emoji, or null, up to 64 UTF-16 code units

Fluxer rejects other text

string | null

ForumPostCreate#

A new post in a forum or media channel, created with threads.createPost

Each post is a public thread with its own first message. Unknown keys fail locally

interface ForumPostCreate
appliedTagIds optional#

IDs of the channel's forum tags to apply, at most 5 decimal strings

A channel with ChannelFlags.RequireTag needs at least one, and a moderated tag needs Manage Threads

readonly string[]
autoArchiveMinutes optional#

Inactivity period in minutes after which Fluxer archives the post, one of the ThreadAutoArchiveMinutes values, default ThreadAutoArchiveMinutes.ThreeDays

number
message#

The post's first message

Its files are uploaded in the same request as multipart form data

ForumPostMessage
name#

Post name, 1–100 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming

The original string is sent unchanged

string
rateLimitPerUser optional#

Slowmode delay in seconds, an integer from 0 through 21,600

Omission copies the channel's defaultThreadRateLimitPerUser

number

ForumTag#

A tag that posts in a forum or media channel can carry

interface ForumTag
emojiId#

Decimal ID of a custom emoji of this community, or null when the tag has none

string | null
emojiName#

A Unicode emoji, or null when the tag has none

At most one of emojiId and emojiName is set

string | null
id#

Decimal tag ID

string
moderated#

Whether only members who can manage threads may apply or remove the tag

boolean
name#

Tag name, unique within its channel

string

ForumTagInput#

Settings of one tag that posts in a forum or media channel can carry

Fluxer rejects a name that another tag of the channel already uses. A received ForumTag is also valid input

interface ForumTagInput
emojiId optional#

Decimal ID of a custom emoji of this community, or null for none

Fluxer rejects an emoji that the community does not have. Set at most one of emojiId and emojiName

string | null
emojiName optional#

A single Unicode emoji, or null for none, up to 64 UTF-16 code units

Fluxer rejects other text. Set at most one of emojiId and emojiName

string | null
id optional#

Decimal ID of an existing tag, which only an entry of a channel edit's availableTags uses: The entry keeps that tag and replaces its settings, while an entry without an ID adds a tag

Fluxer rejects an ID that the channel does not have, and an ID that appears twice in the list. A new channel has no tags, so its availableTags fail locally with an ID. The single-tag operations never send an ID, so createForumTag ignores one, and editForumTag fails locally unless it equals the tagId argument

string
moderated optional#

Whether only members who can manage threads may apply or remove the tag

Omission means false

boolean
name#

Tag name, 1–50 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming

The original string is sent unchanged

string

GuildAnnouncementChannel#

A community announcement channel, selected by type === ChannelType.Announcement

It has the same message and topic fields as a text channel

interface GuildAnnouncementChannel extends GuildTextChannelBaseinterface GuildAnnouncementChannel
  extends GuildTextChannelBase

Inherited from GuildTextChannelBase: contentWarningLevel, contentWarningText, defaultAutoArchiveMinutes, defaultThreadRateLimitPerUser, guildId, id, lastMessageId, lastPinTimestamp, name, nsfw, nsfwOverride, parentId, permissionOverwrites, position, rateLimitPerUser, topic

GuildAnnouncementThreadChannel#

A thread inside an announcement channel, selected by type === ChannelType.AnnouncementThread

interface GuildAnnouncementThreadChannel
    extends GuildThreadChannelBaseinterface GuildAnnouncementThreadChannel
  extends GuildThreadChannelBase

Inherited from GuildThreadChannelBase: archived, archiveTimestamp, autoArchiveMinutes, contentWarningLevel, contentWarningText, createdAt, flags, guildId, id, lastMessageId, lastPinTimestamp, locked, memberCount, membership, messageCount, name, nsfw, nsfwOverride, ownerId, parentId, permissionOverwrites, position, rateLimitPerUser, totalMessageSent

GuildChannelBase#

Fields every community channel shares, whatever its type

interface GuildChannelBase
contentWarningLevel optional#

Channel content-warning override, when supplied

number
contentWarningText optional#

Custom content-warning text, with null inheriting

string | null
guildId#

Decimal community ID

string
id#

Decimal channel ID

string
name optional#

Channel name, when Fluxer supplies one

string
nsfw optional#

Effective adult-content setting from Fluxer's older NSFW field, when supplied

boolean
nsfwOverride optional#

Channel adult-content override, with null inheriting from its category then community

boolean | null
parentId optional#

Parent category ID, with null meaning top-level and omission meaning unavailable

string | null
permissionOverwrites optional#

Explicit channel overwrites, not inherited or effective permissions

readonly PermissionOverwrite[]
position optional#

Server ordering position, not an immutable ordering guarantee

number
type#

A ChannelType constant, or "unknown" for a type this SDK version does not know

Compare it to select the matching channel shape

0 | "unknown" | 2 | 4 | 16 | 5 | 10 | 12 | 11 | 15 | 998| 0 | "unknown" | 2 | 4 | 16 | 5 | 10
| 12 | 11 | 15 | 998

GuildForumChannel#

A forum channel, selected by type === ChannelType.Forum

interface GuildForumChannel extends GuildForumChannelBaseinterface GuildForumChannel
  extends GuildForumChannelBase
defaultForumLayout optional#

Default post layout, such as ForumLayout.List

number
type#
15

Inherited from GuildForumChannelBase: availableTags, contentWarningLevel, contentWarningText, defaultAutoArchiveMinutes, defaultReactionEmoji, defaultSortOrder, defaultTagSetting, defaultThreadRateLimitPerUser, flags, guildId, id, lastMessageId, name, nsfw, nsfwOverride, parentId, permissionOverwrites, position, rateLimitPerUser, topic

GuildForumChannelBase#

Fields shared by forum and media channels, which hold posts and no messages of their own

Fluxer leaves the post settings out of some payloads, such as the guildChannelDelete event, so each of them is optional and absence means unavailable rather than a default

interface GuildForumChannelBase extends GuildChannelBaseinterface GuildForumChannelBase
  extends GuildChannelBase
availableTags optional#

Tags that posts can carry, at most 20

readonly ForumTag[]
defaultAutoArchiveMinutes optional#

Stored default auto-archive period for posts, in minutes, with null meaning none is set

Fluxer does not apply it to a new post

number | null
defaultReactionEmoji optional#

Reaction that clients show on each post, with null meaning none

ForumDefaultReaction | null
defaultSortOrder optional#

Default post order, such as ForumSortOrder.LatestActivity, with null meaning none is set

number | null
defaultTagSetting optional#

Default tag matching of a post search, "match_some" or "match_all"

Another string Fluxer adds later is kept

string
defaultThreadRateLimitPerUser optional#

Slowmode delay in seconds that a new post copies when its creation sets none

number
flags optional#

Channel flags, such as ChannelFlags.RequireTag

Unrecognized bits are kept

number
lastMessageId optional#

ID of the newest post, with null meaning the channel never had one

string | null
rateLimitPerUser optional#

Delay in seconds between one member's new posts

number
topic optional#

Posting guidelines, with null meaning none

string | null
type#

Forum or media channel type

Each received shape has its own literal discriminant

15 | 16

Inherited from GuildChannelBase: contentWarningLevel, contentWarningText, guildId, id, name, nsfw, nsfwOverride, parentId, permissionOverwrites, position

GuildMediaChannel#

A media channel, a forum channel that can hide media download options, selected by type === ChannelType.Media

interface GuildMediaChannel extends GuildForumChannelBaseinterface GuildMediaChannel
  extends GuildForumChannelBase
type#
16

Inherited from GuildForumChannelBase: availableTags, contentWarningLevel, contentWarningText, defaultAutoArchiveMinutes, defaultReactionEmoji, defaultSortOrder, defaultTagSetting, defaultThreadRateLimitPerUser, flags, guildId, id, lastMessageId, name, nsfw, nsfwOverride, parentId, permissionOverwrites, position, rateLimitPerUser, topic

GuildPrivateThreadChannel#

A private thread inside a text channel, selected by type === ChannelType.PrivateThread

interface GuildPrivateThreadChannel extends GuildThreadChannelBaseinterface GuildPrivateThreadChannel
  extends GuildThreadChannelBase
invitable#

Whether members who cannot manage threads may add other such members

boolean

Inherited from GuildThreadChannelBase: archived, archiveTimestamp, autoArchiveMinutes, contentWarningLevel, contentWarningText, createdAt, flags, guildId, id, lastMessageId, lastPinTimestamp, locked, memberCount, membership, messageCount, name, nsfw, nsfwOverride, ownerId, parentId, permissionOverwrites, position, rateLimitPerUser, totalMessageSent

GuildPublicThreadChannel#

A public thread inside a text channel, or a post inside a forum or media channel, selected by type === ChannelType.PublicThread

interface GuildPublicThreadChannel extends GuildThreadChannelBaseinterface GuildPublicThreadChannel
  extends GuildThreadChannelBase
appliedTagIds optional#

IDs of the forum tags applied to a forum or media post, at most 5

Absent on a thread in a text channel

readonly string[]

Inherited from GuildThreadChannelBase: archived, archiveTimestamp, autoArchiveMinutes, contentWarningLevel, contentWarningText, createdAt, flags, guildId, id, lastMessageId, lastPinTimestamp, locked, memberCount, membership, messageCount, name, nsfw, nsfwOverride, ownerId, parentId, permissionOverwrites, position, rateLimitPerUser, totalMessageSent

GuildTextChannelBase#

Message and topic fields shared by community text and announcement channels

interface GuildTextChannelBase extends GuildChannelBaseinterface GuildTextChannelBase
  extends GuildChannelBase
defaultAutoArchiveMinutes optional#

Stored default auto-archive period for threads in this channel, in minutes, such as ThreadAutoArchiveMinutes.OneDay

Fluxer sends it only when one is stored, and does not apply it to a new thread

number | null
defaultThreadRateLimitPerUser optional#

Slowmode delay in seconds that a new thread in this channel copies when its creation sets none

Fluxer sends it only when one is stored

number
lastMessageId optional#

Last message ID, with null meaning no known message

string | null
lastPinTimestamp optional#

ISO 8601 last-pin time, with null meaning no pins

string | null
rateLimitPerUser optional#

Slowmode delay in seconds

number
topic optional#

Topic, with null clearing it and omission meaning unavailable

string | null
type#

Text or announcement channel type

Each received shape has its own literal discriminant

0 | 5

Inherited from GuildChannelBase: contentWarningLevel, contentWarningText, guildId, id, name, nsfw, nsfwOverride, parentId, permissionOverwrites, position

GuildThreadChannelBase#

Fields every thread shares, whatever its type

A thread has no permission overwrites of its own, because Fluxer computes its permissions from the parent channel

interface GuildThreadChannelBase extends GuildChannelBaseinterface GuildThreadChannelBase
  extends GuildChannelBase
archived#

Whether the thread is archived

An archived thread accepts no new members, reactions, pins or edits, and a message sent to it unarchives it

boolean
archiveTimestamp#

ISO 8601 time the thread was last archived, unarchived or given a new autoArchiveMinutes

It equals createdAt until the first of those changes

string
autoArchiveMinutes#

Inactivity period in minutes after which Fluxer archives the thread, such as ThreadAutoArchiveMinutes.ThreeDays

number
createdAt#

ISO 8601 time the thread was created

string
flags optional#

Thread flags

Only ChannelFlags.Pinned can be set, and only on a forum or media post. Unrecognized bits are kept

number
lastMessageId optional#

Last message ID, with null meaning the thread has no message

string | null
lastPinTimestamp optional#

ISO 8601 last-pin time, with null meaning nothing was ever pinned

string | null
locked#

Whether only members who can manage threads may act in the thread

boolean
memberCount optional#

Approximate number of thread members, capped at 50

number
membership optional#

The bot's own membership, present when Fluxer reports that the bot is a member

Absence does not prove that the bot is not a member, because some reads leave it out

ThreadMembership
messageCount optional#

Messages in the thread, excluding the first message of a forum post and deleted messages

number
name#

Thread name

string
ownerId#

Decimal ID of the user or webhook that created the thread

string
parentId#

Decimal ID of the text, announcement, forum or media channel that holds the thread, never a category

string
rateLimitPerUser optional#

Slowmode delay in seconds

number
totalMessageSent optional#

Messages ever sent in the thread, excluding the first message of a forum post

Deleting a message does not lower it

number
type#

One of the three thread types

Each received shape has its own literal discriminant

10 | 11 | 12

Inherited from GuildChannelBase: contentWarningLevel, contentWarningText, guildId, id, nsfw, nsfwOverride, permissionOverwrites, position

GuildUnknownChannel#

A community channel of a type this SDK version does not know, such as a type Fluxer adds later, selected by type === "unknown"

No ChannelType constant equals "unknown", so a ChannelType comparison always excludes this shape, and rawType keeps the number Fluxer sent. The common optional fields of text, voice and link channels stay readable, so the channel remains usable without a type-specific shape. A later SDK version that knows the type returns the matching shape instead

interface GuildUnknownChannel
    extends GuildChannelBase, Omit<
        GuildTextChannelBase,
        | "type" | "defaultAutoArchiveMinutes"
        | "defaultThreadRateLimitPerUser"
    >, Omit<
        GuildVoiceChannel, "type"
    >, Omit<GuildLinkChannel, "type">interface GuildUnknownChannel
  extends GuildChannelBase, Omit<
    GuildTextChannelBase,
    | "type"
    | "defaultAutoArchiveMinutes"
    | "defaultThreadRateLimitPerUser"
  >, Omit<
    GuildVoiceChannel, "type"
  >, Omit<GuildLinkChannel, "type">
rawType#

Numeric channel type Fluxer sent, outside the known ChannelType constants

number
type#

Always "unknown"

"unknown"

Inherited from GuildVoiceChannel: bitrate, rtcRegion, userLimit, voiceConnectionLimit

Inherited from GuildChannelBase: contentWarningLevel, contentWarningText, guildId, id, name, nsfw, nsfwOverride, parentId, permissionOverwrites, position

Inherited from GuildTextChannelBase: lastMessageId, lastPinTimestamp, rateLimitPerUser, topic

Inherited from GuildLinkChannel: url

GuildVoiceChannel#

A community voice-call channel, selected by type === ChannelType.Voice

interface GuildVoiceChannel extends GuildChannelBaseinterface GuildVoiceChannel
  extends GuildChannelBase
bitrate optional#

Voice bitrate in bits per second, with null meaning no voice setting

number | null
lastMessageId optional#

Last message ID in the channel's text chat, with null meaning no known message

string | null
rateLimitPerUser optional#

Slowmode delay in seconds for the channel's text chat

number
rtcRegion optional#

Voice region ID, with null selecting automatic routing

string | null
type#
2
userLimit optional#

Voice user limit, with null meaning no voice setting

number | null
voiceConnectionLimit optional#

Voice connections permitted per user, with null meaning no voice setting

number | null

Inherited from GuildChannelBase: contentWarningLevel, contentWarningText, guildId, id, name, nsfw, nsfwOverride, parentId, permissionOverwrites, position

MediaChannelCreate#

Creates a media channel, a forum channel that can hide media download options

It has no layout setting

interface MediaChannelCreate extends ForumChannelCreateBaseinterface MediaChannelCreate
  extends ForumChannelCreateBase
type#

Media channel type

16

Inherited from ForumChannelCreateBase: availableTags, bitrate, contentWarningLevel, contentWarningText, defaultAutoArchiveMinutes, defaultReactionEmoji, defaultSortOrder, defaultTagSetting, defaultThreadRateLimitPerUser, flags, name, nsfw, nsfwOverride, parentId, permissionOverwrites, rateLimitPerUser, topic, url, userLimit, voiceConnectionLimit

TextChannelCreate#

Creates a text channel

interface TextChannelCreate
    extends ChannelCreateBase, ThreadParentDefaultsinterface TextChannelCreate
  extends ChannelCreateBase, ThreadParentDefaults
type#

Text channel type

0

Inherited from ChannelCreateBase: bitrate, contentWarningLevel, contentWarningText, name, nsfw, nsfwOverride, parentId, permissionOverwrites, rateLimitPerUser, topic, url, userLimit, voiceConnectionLimit

Inherited from ThreadParentDefaults: defaultAutoArchiveMinutes, defaultThreadRateLimitPerUser

ThreadCreate#

Settings for a new thread in a text or announcement channel, created with threads.create

Use threads.createFromMessage to start a thread on an existing message, and threads.createPost in a forum or media channel. Unknown keys fail locally

interface ThreadCreate
autoArchiveMinutes optional#

Inactivity period in minutes after which Fluxer archives the thread, one of the ThreadAutoArchiveMinutes values, default ThreadAutoArchiveMinutes.ThreeDays

number
invitable optional#

Whether members who cannot manage threads may add other such members, default true

Accepted only with type ChannelType.PrivateThread

boolean
name#

Thread name, 1–100 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming

The original string is sent unchanged

string
rateLimitPerUser optional#

Slowmode delay in seconds, an integer from 0 through 21,600

Omission copies the parent channel's defaultThreadRateLimitPerUser

number
type optional#

Thread type, default ChannelType.PublicThread

A private thread is possible only in a text channel. In an announcement channel Fluxer creates an announcement thread for PublicThread or AnnouncementThread, and rejects AnnouncementThread in a text channel

10 | 12 | 11

ThreadEdit#

Change an existing thread or post with threads.edit

Omitted fields stay unchanged, and an empty input or an unknown key fails locally. Fluxer lets the thread's creator rename it, archive it, lock it and change autoArchiveMinutes, invitable and appliedTagIds, while unlocking, rateLimitPerUser, pinned and moderated tags need Manage Threads. In a locked thread every change needs Manage Threads, and an archived thread accepts only a change that also sets archived to false

interface ThreadEdit
appliedTagIds optional#

Replace the tags of a forum or media post with these tag IDs, at most 5 decimal strings, with [] removing every tag

Fluxer rejects it on a public thread in a text channel and ignores it on private and announcement threads

readonly string[]
archived optional#

Archive the thread with true, or unarchive it with false

boolean
autoArchiveMinutes optional#

Inactivity period in minutes after which Fluxer archives the thread, one of the ThreadAutoArchiveMinutes values

A change restarts the period at archiveTimestamp

number
invitable optional#

Whether members who cannot manage threads may add other such members

Fluxer ignores it on threads that are not private

boolean
locked optional#

Whether only members who can manage threads may act in the thread

boolean
name optional#

Thread name, 1–100 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming

The original string is sent unchanged

string
pinned optional#

Pin a forum or media post with true, or unpin it with false, by setting ChannelFlags.Pinned

A channel holds at most one pinned post. Fluxer rejects true on any other thread

boolean
rateLimitPerUser optional#

Slowmode delay in seconds, an integer from 0 through 21,600

Zero disables slowmode

number

ThreadFromMessageCreate#

Settings for a public thread started on an existing message with threads.createFromMessage

The thread takes the message's ID, and a message can start only one thread. Unknown keys fail locally

interface ThreadFromMessageCreate
autoArchiveMinutes optional#

Inactivity period in minutes after which Fluxer archives the thread, one of the ThreadAutoArchiveMinutes values, default ThreadAutoArchiveMinutes.ThreeDays

number
name#

Thread name, 1–100 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming

The original string is sent unchanged

string
rateLimitPerUser optional#

Slowmode delay in seconds, an integer from 0 through 21,600

Omission copies the parent channel's defaultThreadRateLimitPerUser

number

ThreadMember#

One member of a thread

The object is frozen and does not update when the membership changes

interface ThreadMember
flags#

Fluxer's thread member flags, such as notification preferences

Unrecognized bits are kept

number
joinedAt#

ISO 8601 time the user last joined the thread

string
member optional#

The user's community membership, present only when Fluxer supplied it with the thread member

GuildMember
threadId#

Decimal thread ID

string
userId#

Decimal ID of the member's account

string

ThreadMemberIterationQuery#

Limits and starting point for threads.iterateMembers, reading thread members in ascending user ID order

The pageSize option defaults to 100 with a range of 1 through 100

interface ThreadMemberIterationQuery extends UserIterationQueryinterface ThreadMemberIterationQuery
  extends UserIterationQuery
withMember optional#

Also read each user's community membership into ThreadMember.member, default false

The thread's community is resolved once per consumption, from the channel cache or with one extra channel request on the first page

boolean

Inherited from UserIterationQuery: after, maxItems, maxPages, pageSize

ThreadMemberPageQuery#

Select one page of thread members, in ascending user ID order

Unknown keys fail locally

interface ThreadMemberPageQuery extends ThreadMemberQueryinterface ThreadMemberPageQuery
  extends ThreadMemberQuery
after optional#

Start with decimal user IDs greater than this ID, excluding it

Omit it for the first page

string
limit optional#

Maximum members in the page, an integer from 1 through 100, default 100

number

Inherited from ThreadMemberQuery: withMember

ThreadMemberQuery#

Options for reading one thread member with threads.fetchMember

Unknown keys fail locally

interface ThreadMemberQuery
withMember optional#

Also read the user's community membership into ThreadMember.member, default false

The member is decoded with the thread's community, which the SDK takes from the channel cache when the thread is cached there and otherwise reads with one extra channel request inside the same deadline

boolean

ThreadMembership#

The bot's own membership in a thread, as Fluxer reports it beside the thread

A thread read, a thread list or an event only describes this membership at that moment

interface ThreadMembership
flags#

Fluxer's thread member flags, such as notification preferences

Unrecognized bits are kept

number
joinedAt#

ISO 8601 time the bot last joined the thread

string

ThreadParentDefaults#

Default settings for the threads that start inside a text, announcement, forum or media channel

Where threads are not active for a community (GuildListSummary.threadsActive is false), Fluxer ignores both settings on a text or announcement channel

interface ThreadParentDefaults
defaultAutoArchiveMinutes optional#

Auto-archive period in minutes that the channel stores for its threads: One of the ThreadAutoArchiveMinutes values, or null to clear it

Fluxer stores the value but does not apply it to a new thread, which uses ThreadAutoArchiveMinutes.ThreeDays unless its creation sets another period

number | null
defaultThreadRateLimitPerUser optional#

Slowmode delay in seconds that a new thread in this channel copies when its creation sets none, an integer from 0 through 21,600, or null to clear it

number | null

ThreadSearchIndexingPage#

Successful search response while Fluxer still builds the community's search index

Fluxer answers HTTP 202 and starts building it. Retry later with another explicit search, which the SDK never sends by itself

interface ThreadSearchIndexingPage
indexing#

True distinguishes this response from a ThreadSearchResultsPage

true

ThreadSearchQuery#

Filters and paging for one threads.search request in a text, announcement, forum or media channel

Fluxer searches an index that can lag behind recent changes. The bot sees public threads, private threads it joined and, with Manage Threads, every private thread. Unknown keys and invalid values fail locally

interface ThreadSearchQuery
archived optional#

True for only archived threads, false for only active threads

Omit it for both

boolean
limit optional#

Maximum threads in the page, an integer from 1 through 25, default 25

number
maxId optional#

Include only thread IDs smaller than this decimal ID

string
minId optional#

Include only thread IDs greater than this decimal ID

string
name optional#

Text to look for in thread names, at most 100 UTF-16 code units

Omit it to match every name

string
offset optional#

Matching threads to skip, an integer from 0 through 9,975, default 0

number
sortBy optional#

Result order, default "last_message_time"

"relevance" | "last_message_time" | "archive_time" | "creation_time"| "relevance" | "last_message_time"
| "archive_time" | "creation_time"
sortOrder optional#

Ascending or descending result order, default "desc"

"desc" | "asc"
tagIds optional#

Forum tag IDs to filter by, at most 20 decimal strings

A tag the channel no longer has matches no thread

readonly string[]
tagSetting optional#

How tagIds match: "match_some" for any tag, "match_all" for every tag

Defaults to the channel's defaultTagSetting, otherwise "match_some"

"match_some" | "match_all"

ThreadSearchResultsPage#

Search results once Fluxer's index can answer

The page and its threads and messages are frozen

interface ThreadSearchResultsPage<M extends MessageCore = Message>interface ThreadSearchResultsPage<
  M extends MessageCore = Message
>
firstMessages#

The first message of each returned post in a forum or media channel, using the client's messageFields selection

Its channelId is the post's ID, and a post whose first message is gone has none. Empty in other channels

readonly M[]
hasMore#

Whether more matching threads follow this page, read by raising offset

boolean
indexing#

False distinguishes this response from an indexing response

false
threads#

Matching threads in result order

Each thread the bot joined has membership set

readonly GuildThreadChannel[]
total#

Number of matching threads Fluxer reported with this response, which can change between requests

number

Threads#

Create threads and forum posts, change, list and search threads, and manage thread members

Every method uses HTTP without a gateway connection. Methods returning ResultAsync start immediately, while iterateMembers starts reading when iteration begins. Bots can use threads in every community where Fluxer enables them, without a capability setting. Read a thread with channels.fetch, delete it with channels.delete and send to it with messages.send and its ID

interface Threads<M extends MessageCore = Message>interface Threads<
  M extends MessageCore = Message
>

Supply decimal IDs. Requests share the client's REST slots and queue limits. The default deadline, rest.defaultTimeoutMs (30,000 ms unless configured), includes capacity, rate-limit and retry waits. Eligible reads retry transport and HTTP 500, 502, 503 or 504 failures at most twice. Writes retry only confirmed HTTP 429 rejection, and no write is followed by an automatic confirmation fetch. Manage Threads is an elevated permission. In a community whose mfaLevel is GuildMfaLevels.Elevated, an action that needs it fails with apiError.code twoFactorRequired, unless the bot owns the community or its application owner has two-factor authentication enabled. The create, createFromMessage, createPost and edit methods accept a raw audit reason through AuditedRequestOptions, and the other methods reject auditReason. The fetchActive list enters the enabled channel cache, while archived pages, search results, forum posts and member reads do not. The edit, join, leave, addMember and removeMember methods remove their thread from the enabled channel cache. Inputs are copied when called. Expected failures return ChannelOperationError, whose operation names the threads method, or ClientClosedError. Abort returns CancelledError after cleanup. Unexpected failures reject with SdkDefect

addMember#

Add a community member who can view the parent channel to a thread, succeeding with no value after HTTP 204

Adding a current member also succeeds, and otherwise Fluxer posts a RecipientAdd notice in the thread. Fluxer requires Send Messages In Threads, plus Manage Threads in a locked thread and in a private thread that is not invitable, unless the added member can manage threads. An archived thread accepts no new members

addMember(
    threadId: string,
    userId: string,
    options?: RequestOptions
): ResultAsync<
    void,
    ChannelOperationFailure | ConfigurationError | CancelledError
>addMember(
  threadId: string,
  userId: string,
  options?: RequestOptions
): ResultAsync<
  void,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

threadId
string
userId
string
options optional
RequestOptions

create#

Create a thread that is not attached to a message in a text or announcement channel, and return its frozen snapshot

The bot becomes the thread's first member, and Fluxer posts a ThreadCreated notice in the parent channel for a public or announcement thread. Fluxer requires Create Public Threads, or Create Private Threads for a private thread. Use createPost in a forum or media channel. A lost response can leave the thread created, and the SDK never resends it

create(
    channelId: string,
    input: ThreadCreate,
    options?: AuditedRequestOptions
): ResultAsync<
    GuildThreadChannel,
    ChannelOperationFailure | ConfigurationError | CancelledError
>create(
  channelId: string,
  input: ThreadCreate,
  options?: AuditedRequestOptions
): ResultAsync<
  GuildThreadChannel,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
options optional
AuditedRequestOptions
import { ChannelType, ThreadAutoArchiveMinutes } from "@neontechspace/fluxerly"
export async function threadExample(client, channelId) {
    const thread = await client.threads.create(channelId, {
        name: "Release planning",
        type: ChannelType.PrivateThread,
        autoArchiveMinutes: ThreadAutoArchiveMinutes.OneDay,
    })
    if (thread.isErr())
        throw thread.error
    return client.messages.send(thread.value.id, "Planning starts here")
}
import { ChannelType, ThreadAutoArchiveMinutes, type Client } from "@neontechspace/fluxerly"
export async function threadExample(client: Client, channelId: string) {
    const thread = await client.threads.create(channelId, {
        name: "Release planning",
        type: ChannelType.PrivateThread,
        autoArchiveMinutes: ThreadAutoArchiveMinutes.OneDay,
    })
    if (thread.isErr()) throw thread.error
    return client.messages.send(thread.value.id, "Planning starts here")
}

createFromMessage#

Start a public thread on an existing message and return its frozen snapshot

The thread takes the message's ID, and the message gains MessageFlags.HasThread. Only a default message or a reply in a text or announcement channel can start a thread, and only one. In an announcement channel the thread is an announcement thread. Fluxer posts a ThreadCreated notice in the parent channel unless the message is among its five newest messages. Fluxer requires Create Public Threads and Read Message History. A lost response can leave the thread created, and the SDK never resends it. After an unknown outcome, channels.fetch(message.id) shows whether the thread exists

createFromMessage(
    message: MessageReference,
    input: ThreadFromMessageCreate,
    options?: AuditedRequestOptions
): ResultAsync<
    GuildThreadChannel,
    ChannelOperationFailure | ConfigurationError | CancelledError
>createFromMessage(
  message: MessageReference,
  input: ThreadFromMessageCreate,
  options?: AuditedRequestOptions
): ResultAsync<
  GuildThreadChannel,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

options optional
AuditedRequestOptions

createPost#

Create a post in a forum or media channel, a public thread with its first message, and return both frozen

Files in the message are sent inline as multipart form data in the same request, never through presigned uploads, under messages.send's attachment rules and the client's upload budget. Fluxer requires Send Messages in the channel plus the permissions the message content needs, and applies the channel's tag rules. When the first message fails, Fluxer removes the new post again. A lost response can leave the post created, and the SDK never resends it

createPost(
    channelId: string,
    input: ForumPostCreate,
    options?: AuditedRequestOptions
): ResultAsync<
    ForumPost<M>,
    ChannelOperationFailure | ConfigurationError | CancelledError
>createPost(
  channelId: string,
  input: ForumPostCreate,
  options?: AuditedRequestOptions
): ResultAsync<
  ForumPost<M>,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
options optional
AuditedRequestOptions

edit#

Change only the supplied thread settings and return the frozen thread

It uses the route and rate limit of channels.edit. ThreadEdit describes which changes the thread's creator may make and which need Manage Threads

edit(
    threadId: string,
    input: ThreadEdit,
    options?: AuditedRequestOptions
): ResultAsync<
    GuildThreadChannel,
    ChannelOperationFailure | ConfigurationError | CancelledError
>edit(
  threadId: string,
  input: ThreadEdit,
  options?: AuditedRequestOptions
): ResultAsync<
  GuildThreadChannel,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

threadId
string
options optional
AuditedRequestOptions

fetchActive#

Fetch every active thread the bot can view in a community, newest first, as one frozen list

A private thread appears when the bot joined it or can manage threads in its parent channel. Each thread the bot joined has membership set

fetchActive(guildId: string, options?: RequestOptions): ResultAsync<
    readonly GuildThreadChannel[],
    ChannelOperationFailure | ConfigurationError | CancelledError
>fetchActive(
  guildId: string,
  options?: RequestOptions
): ResultAsync<
  readonly GuildThreadChannel[],
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

guildId
string
options optional
RequestOptions

fetchArchived#

Fetch one frozen page of archived threads of a text, announcement, forum or media channel, as ArchivedThreadQuery selects

Scopes "public" and "private" list the most recently archived first, and "joinedPrivate" lists the newest threads first. Each thread the bot joined has membership set. Fluxer requires Read Message History, plus Manage Threads for scope "private"

fetchArchived(
    channelId: string,
    query?: ArchivedThreadQuery,
    options?: RequestOptions
): ResultAsync<
    ArchivedThreadPage,
    ChannelOperationFailure | ConfigurationError | CancelledError
>fetchArchived(
  channelId: string,
  query?: ArchivedThreadQuery,
  options?: RequestOptions
): ResultAsync<
  ArchivedThreadPage,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
query optional
ArchivedThreadQuery
options optional
RequestOptions

fetchMember#

Fetch one thread member as a frozen ThreadMember

A user who is not a member fails with UNKNOWN_THREAD_MEMBER. With withMember, member holds the user's community membership while the user has one. Its community comes from the channel cache when the thread is cached there, otherwise from one extra channel read that shares the deadline and whose failure fails this call

fetchMember(
    threadId: string,
    userId: string,
    query?: ThreadMemberQuery,
    options?: RequestOptions
): ResultAsync<
    ThreadMember,
    ChannelOperationFailure | ConfigurationError | CancelledError
>fetchMember(
  threadId: string,
  userId: string,
  query?: ThreadMemberQuery,
  options?: RequestOptions
): ResultAsync<
  ThreadMember,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

threadId
string
userId
string
query optional
ThreadMemberQuery
options optional
RequestOptions

fetchMembers#

Fetch one page of thread members in ascending user ID order, as frozen ThreadMember values

With withMember, each member holds the user's community membership while the user has one, with the community resolved as fetchMember describes

fetchMembers(
    threadId: string,
    query?: ThreadMemberPageQuery,
    options?: RequestOptions
): ResultAsync<
    readonly ThreadMember[],
    ChannelOperationFailure | ConfigurationError | CancelledError
>fetchMembers(
  threadId: string,
  query?: ThreadMemberPageQuery,
  options?: RequestOptions
): ResultAsync<
  readonly ThreadMember[],
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

threadId
string
query optional
ThreadMemberPageQuery
options optional
RequestOptions

iterateMembers#

Read thread members in ascending user ID order, buffering one page and never prefetching

The maxItems option is required. The pageSize option defaults to 100 and accepts 1–100, maxPages defaults to the pages maxItems needs at pageSize plus 100, and timeoutMs applies to each page. An empty page or maxItems ends the scan. Invalid traversal input, a stalled cursor or reaching the page budget fails with PaginationError, and remote failures keep threads.fetchMembers's errors. With withMember, one consumption resolves the thread's community once, as fetchMember describes. Each consumption is independent, and client closure releases the page and fails the next pull

iterateMembers(
    threadId: string,
    query: ThreadMemberIterationQuery,
    options?: RequestOptions
): AsyncIterable<
    Result<
        ThreadMember,
        | ChannelOperationFailure | PaginationError
        | ConfigurationError | CancelledError
    >
>iterateMembers(
  threadId: string,
  query:
    ThreadMemberIterationQuery,
  options?: RequestOptions
): AsyncIterable<
  Result<
    ThreadMember,
    | ChannelOperationFailure
    | PaginationError
    | ConfigurationError
    | CancelledError
  >
>

Parameters

threadId
string
options optional
RequestOptions

Consume the iterable with a for await loop, which starts the first request. An expected failure yields one Err and ends iteration. Breaking the loop releases the buffered page. Abort interrupts pending request work and waits for cleanup

join#

Add the bot to a thread, succeeding with no value after HTTP 204

Joining a thread the bot already belongs to also succeeds. An archived thread cannot be joined, and a locked one needs Manage Threads

join(threadId: string, options?: RequestOptions): ResultAsync<
    void,
    ChannelOperationFailure | ConfigurationError | CancelledError
>join(
  threadId: string,
  options?: RequestOptions
): ResultAsync<
  void,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

threadId
string
options optional
RequestOptions

leave#

Remove the bot from a thread, succeeding with no value after HTTP 204

An archived thread cannot be left, and Fluxer rejects a bot that is not a member with UNKNOWN_THREAD_MEMBER

leave(threadId: string, options?: RequestOptions): ResultAsync<
    void,
    ChannelOperationFailure | ConfigurationError | CancelledError
>leave(
  threadId: string,
  options?: RequestOptions
): ResultAsync<
  void,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

threadId
string
options optional
RequestOptions

removeMember#

Remove a member from a thread, succeeding with no value after HTTP 204, and Fluxer posts a RecipientRemove notice in the thread

Removing the bot's own ID works like leave. Fluxer requires Manage Threads unless the bot created the private thread. A user who is not a member fails with UNKNOWN_THREAD_MEMBER, and an archived thread cannot change

removeMember(
    threadId: string,
    userId: string,
    options?: RequestOptions
): ResultAsync<
    void,
    ChannelOperationFailure | ConfigurationError | CancelledError
>removeMember(
  threadId: string,
  userId: string,
  options?: RequestOptions
): ResultAsync<
  void,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

threadId
string
userId
string
options optional
RequestOptions

Search the threads of a text, announcement, forum or media channel by name, tags and state, and return one frozen page

Fluxer requires Read Message History. While Fluxer builds the community's search index it answers HTTP 202 with code SEARCH_INDEX_NOT_READY, which this method returns as an indexing page without retrying. Any other HTTP 202 answer fails with reason response. While Fluxer's search service is turned off, the call fails with reason rejected and apiError.providerCode FEATURE_TEMPORARILY_DISABLED

search(
    channelId: string,
    query?: ThreadSearchQuery,
    options?: RequestOptions
): ResultAsync<
    ThreadSearchPage<M>,
    ChannelOperationFailure | ConfigurationError | CancelledError
>search(
  channelId: string,
  query?: ThreadSearchQuery,
  options?: RequestOptions
): ResultAsync<
  ThreadSearchPage<M>,
  | ChannelOperationFailure
  | ConfigurationError
  | CancelledError
>

Parameters

channelId
string
query optional
ThreadSearchQuery
options optional
RequestOptions

Type Aliases#

ArchivedThreadScope#

Which archived threads threads.fetchArchived lists: Public threads, private threads, or only the private threads the bot joined

type ArchivedThreadScope = "public" | "private" | "joinedPrivate"type ArchivedThreadScope =
    | "public" | "private"
    | "joinedPrivate"

ForumPostMessage#

The first message of a forum or media post: The content, embeds, files and stickers of messages.send, with allowedMentions and flags

A post's first message cannot reply to another message, and has no nonce or text-to-speech setting

type ForumPostMessage =
    MessageBody & Pick<MessageInput, "allowedMentions" | "flags">type ForumPostMessage =
    & MessageBody
    & Pick<
        MessageInput,
        "allowedMentions" | "flags"
      >

GuildChannel#

Settings and identity of a community channel returned by a read or gateway event, as one shape per channel type

Compare type with ChannelType constants to narrow to exactly one shape, such as channel.type === ChannelType.Voice before reading bitrate. Threads, forum channels and media channels have their own shapes, and isThreadChannel selects every thread type at once. A type this SDK version does not know is a GuildUnknownChannel with type "unknown", its Fluxer number in rawType and the common optional text, voice and link fields, so a switch on type that also handles "unknown" is exhaustive. The object is frozen and does not update when the channel changes. Optional fields may be unavailable rather than set to their creation defaults. This excludes private conversations, which use DirectMessageChannel

type GuildChannel =
    | GuildTextChannel | GuildAnnouncementChannel
    | GuildVoiceChannel | GuildCategoryChannel
    | GuildAnnouncementThreadChannel | GuildPublicThreadChannel
    | GuildPrivateThreadChannel | GuildForumChannel
    | GuildMediaChannel | GuildLinkChannel | GuildUnknownChanneltype GuildChannel =
    | GuildTextChannel
    | GuildAnnouncementChannel
    | GuildVoiceChannel
    | GuildCategoryChannel
    | GuildAnnouncementThreadChannel
    | GuildPublicThreadChannel
    | GuildPrivateThreadChannel
    | GuildForumChannel
    | GuildMediaChannel
    | GuildLinkChannel
    | GuildUnknownChannel

GuildThreadChannel#

A thread: A channel inside a text, announcement, forum or media channel that holds its own messages

Compare type with ChannelType constants to narrow to one thread shape, or use isThreadChannel to tell threads from other community channels. The object is frozen and does not update when the thread changes

type GuildThreadChannel =
    | GuildAnnouncementThreadChannel | GuildPublicThreadChannel
    | GuildPrivateThreadChanneltype GuildThreadChannel =
    | GuildAnnouncementThreadChannel
    | GuildPublicThreadChannel
    | GuildPrivateThreadChannel