On This Page

Channels

65 symbols from @neontechspace/fluxerly/effect

Interfaces#

Channels#

Read or change community channels and permission overrides, or request gateway member counts

HTTP methods return Effects and do not connect the gateway. The REST rules below exclude fetchMemberCounts, which requires gateway readiness and has its own documented contract

interface Channels

DM operations are outside this API contract. Supply decimal community-channel IDs. ID-targeted writes do not prefetch or verify their community-channel type

Requests share the client's REST or upload slots across all 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)

Total deadline defaults to the client's rest.defaultTimeoutMs, 30,000 ms unless configured, including queue waits, retries and rate-limit waits. Reads retry transport failures and HTTP 500/502/503/504 at most twice. Writes retry only confirmed 429 responses. Permission, input, 404 and malformed-response failures do not retry

Sending a channel write removes the written channel from the enabled channel cache, with its threads when the write 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 write to a category, or one that names a community, such as create or reorder, removes that community's cached channels. A write to a channel the cache does not hold removes every cached channel, because its community is unknown. Input failures before dispatch leave the cache unchanged, and a write rejected after dispatch removes the same entries. The SDK does not fetch channels automatically after a write. The follow, create, edit, delete, reorder, permission-overwrite and forum-tag mutations accept AuditedRequestOptions. Read operations reject auditReason

Operation inputs are copied when the Effect executes and later caller mutations are not observed. Permission bits are bigint values encoded as decimal JSON strings. Fluxer enforces channel permissions and grant restrictions. Targeted overwrite operations require ManageRoles for role and member targets

Expected failures use ChannelOperationError or ClientClosedError. Interruption and defects retain Cause after owned cleanup

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
): Effect<GuildChannel, ChannelOperationFailure>create(
  guildId: string,
  input: ChannelCreate,
  options?: AuditedRequestOptions
): Effect<
  GuildChannel,
  ChannelOperationFailure
>

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
TypeScript
import { ChannelType, Permissions, type Client } from "@neontechspace/fluxerly/effect"
export const channelExample = (client: Client, guildId: string, botId: string) =>
    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 },
        ],
    })

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
): Effect<
    GuildForumChannel | GuildMediaChannel,
    ChannelOperationFailure
>createForumTag(
  channelId: string,
  input: ForumTagInput,
  options?: AuditedRequestOptions
): Effect<
  | GuildForumChannel
  | GuildMediaChannel,
  ChannelOperationFailure
>

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
): Effect<void, ChannelOperationFailure>delete(
  channelId: string,
  options?: AuditedRequestOptions
): Effect<
  void,
  ChannelOperationFailure
>

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
): Effect<
    GuildForumChannel | GuildMediaChannel,
    ChannelOperationFailure
>deleteForumTag(
  channelId: string,
  tagId: string,
  options?: AuditedRequestOptions
): Effect<
  | GuildForumChannel
  | GuildMediaChannel,
  ChannelOperationFailure
>

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
): Effect<GuildChannel, ChannelOperationFailure>edit(
  channelId: string,
  input: ChannelEdit,
  options?: AuditedRequestOptions
): Effect<
  GuildChannel,
  ChannelOperationFailure
>

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
): Effect<
    GuildForumChannel | GuildMediaChannel,
    ChannelOperationFailure
>editForumTag(
  channelId: string,
  tagId: string,
  input: ForumTagInput,
  options?: AuditedRequestOptions
): Effect<
  | GuildForumChannel
  | GuildMediaChannel,
  ChannelOperationFailure
>

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
): Effect<GuildChannel, ChannelOperationFailure>fetch(
  channelId: string,
  options?: RequestOptions
): Effect<
  GuildChannel,
  ChannelOperationFailure
>

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
): Effect<readonly GuildChannel[], ChannelOperationFailure>fetchAll(
  guildId: string,
  options?: RequestOptions
): Effect<
  readonly GuildChannel[],
  ChannelOperationFailure
>

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
): Effect<ChannelFollowerStats, ChannelOperationFailure>fetchFollowerStats(
  channelId: string,
  options?: RequestOptions
): Effect<
  ChannelFollowerStats,
  ChannelOperationFailure
>

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
): Effect<ChannelMemberCountsResult, CountOperationFailure>fetchMemberCounts(
  guildId: string,
  channelIds: readonly string[],
  options?: RequestOptions
): Effect<
  ChannelMemberCountsResult,
  CountOperationFailure
>

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
): Effect<FollowedChannel, ChannelOperationFailure>follow(
  channelId: string,
  input: ChannelFollowInput,
  options?: AuditedRequestOptions
): Effect<
  FollowedChannel,
  ChannelOperationFailure
>

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): Effect<GuildChannel | undefined>get(
  channelId: string
): Effect<GuildChannel | undefined>

Parameters

channelId
string
Returns
Effect<GuildChannel | undefined>

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
): Effect<void, ChannelOperationFailure>removePermissionOverwrite(
  channelId: string,
  targetId: string,
  options?: AuditedRequestOptions
): Effect<
  void,
  ChannelOperationFailure
>

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
): Effect<void, ChannelOperationFailure>reorder(
  guildId: string,
  positions:
    readonly ChannelPosition[],
  options?: AuditedRequestOptions
): Effect<
  void,
  ChannelOperationFailure
>

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
): Effect<void, ChannelOperationFailure>setPermissionOverwrite(
  channelId: string,
  input: PermissionOverwrite,
  options?: AuditedRequestOptions
): Effect<
  void,
  ChannelOperationFailure
>

Parameters

channelId
string
options optional
AuditedRequestOptions

Threads#

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

HTTP methods return Effects and do not connect the gateway. 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. Thread requests share this client's REST slots and queue limits with the other HTTP methods. Total deadline defaults to the client's rest.defaultTimeoutMs, 30,000 ms unless configured, including queue waits, retries and rate-limit waits. Reads retry transport failures and HTTP 500/502/503/504 at most twice. Writes retry only confirmed 429 responses, 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 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

Operation inputs are copied when the Effect executes. Expected failures use ChannelOperationError, whose operation names the threads method, or ClientClosedError. Interruption and defects retain Cause after owned cleanup

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
): Effect<void, ChannelOperationFailure>addMember(
  threadId: string,
  userId: string,
  options?: RequestOptions
): Effect<
  void,
  ChannelOperationFailure
>

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
): Effect<GuildThreadChannel, ChannelOperationFailure>create(
  channelId: string,
  input: ThreadCreate,
  options?: AuditedRequestOptions
): Effect<
  GuildThreadChannel,
  ChannelOperationFailure
>

Parameters

channelId
string
options optional
AuditedRequestOptions
TypeScript
import { Effect } from "effect"
import { ChannelType, ThreadAutoArchiveMinutes, type Client } from "@neontechspace/fluxerly/effect"
export const threadExample = (client: Client, channelId: string) =>
    client.threads
        .create(channelId, {
            name: "Release planning",
            type: ChannelType.PrivateThread,
            autoArchiveMinutes: ThreadAutoArchiveMinutes.OneDay,
        })
        .pipe(Effect.flatMap((thread) => client.messages.send(thread.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
): Effect<GuildThreadChannel, ChannelOperationFailure>createFromMessage(
  message: MessageReference,
  input: ThreadFromMessageCreate,
  options?: AuditedRequestOptions
): Effect<
  GuildThreadChannel,
  ChannelOperationFailure
>

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
): Effect<ForumPost<M>, ChannelOperationFailure>createPost(
  channelId: string,
  input: ForumPostCreate,
  options?: AuditedRequestOptions
): Effect<
  ForumPost<M>,
  ChannelOperationFailure
>

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
): Effect<GuildThreadChannel, ChannelOperationFailure>edit(
  threadId: string,
  input: ThreadEdit,
  options?: AuditedRequestOptions
): Effect<
  GuildThreadChannel,
  ChannelOperationFailure
>

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
): Effect<readonly GuildThreadChannel[], ChannelOperationFailure>fetchActive(
  guildId: string,
  options?: RequestOptions
): Effect<
  readonly GuildThreadChannel[],
  ChannelOperationFailure
>

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
): Effect<ArchivedThreadPage, ChannelOperationFailure>fetchArchived(
  channelId: string,
  query?: ArchivedThreadQuery,
  options?: RequestOptions
): Effect<
  ArchivedThreadPage,
  ChannelOperationFailure
>

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
): Effect<ThreadMember, ChannelOperationFailure>fetchMember(
  threadId: string,
  userId: string,
  query?: ThreadMemberQuery,
  options?: RequestOptions
): Effect<
  ThreadMember,
  ChannelOperationFailure
>

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
): Effect<readonly ThreadMember[], ChannelOperationFailure>fetchMembers(
  threadId: string,
  query?: ThreadMemberPageQuery,
  options?: RequestOptions
): Effect<
  readonly ThreadMember[],
  ChannelOperationFailure
>

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
): Stream<ThreadMember, ChannelOperationFailure | PaginationError>iterateMembers(
  threadId: string,
  query:
    ThreadMemberIterationQuery,
  options?: RequestOptions
): Stream<
  ThreadMember,
  | ChannelOperationFailure
  | PaginationError
>

Parameters

threadId
string
options optional
RequestOptions

The returned Stream reads pages only while it is consumed. Failures end the Stream in its error channel. Interruption waits for request cleanup, and ending consumption releases the buffered page

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
): Effect<void, ChannelOperationFailure>join(
  threadId: string,
  options?: RequestOptions
): Effect<
  void,
  ChannelOperationFailure
>

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
): Effect<void, ChannelOperationFailure>leave(
  threadId: string,
  options?: RequestOptions
): Effect<
  void,
  ChannelOperationFailure
>

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
): Effect<void, ChannelOperationFailure>removeMember(
  threadId: string,
  userId: string,
  options?: RequestOptions
): Effect<
  void,
  ChannelOperationFailure
>

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
): Effect<ThreadSearchPage<M>, ChannelOperationFailure>search(
  channelId: string,
  query?: ThreadSearchQuery,
  options?: RequestOptions
): Effect<
  ThreadSearchPage<M>,
  ChannelOperationFailure
>

Parameters

channelId
string
query optional
ThreadSearchQuery
options optional
RequestOptions

Re-Exports#

Declared in JavaScript & TypeScript and documented there. Import them from @neontechspace/fluxerly/effect as well

isThreadChannel#
Whether a community channel is a thread of any type
ChannelFlags#
Known bits in the flags of a thread, forum channel or media channel
ChannelType#
Choose what a new community channel does: Text messages, announcements, voice calls, a category that groups channels, or a link
ForumLayout#
Layouts in which clients show the posts of a forum channel by default
ForumSortOrder#
Orders in which clients list the posts of a forum or media channel by default
ThreadAutoArchiveMinutes#
Inactivity periods, in minutes, after which Fluxer archives a thread
AnnouncementChannelCreate#
Creates an announcement channel with the same settings as a text channel
ArchivedThreadPage#
One frozen page of archived threads
ArchivedThreadQuery#
Select one page of archived threads of a channel
CategoryChannelCreate#
Create a category to group community channels
ChannelCreateBase#
Settings shared by new text, announcement, voice, category and link channels
ChannelEdit#
Change an existing community channel's settings without replacing the channel
ChannelFollowInput#
Subscribe a text channel to messages published from an announcement channel
ChannelFollowerStats#
A frozen count of channels and communities following one announcement channel
ChannelMemberCount#
Visible member totals for one requested channel, with the guild ID supplied by the gateway response
ChannelMemberCountsResult#
Results from one community's requested channel counts, ordered to match the requested channel IDs
ChannelPosition#
Move or reorder one community channel with channels.reorder
FollowedChannel#
A confirmed announcement-channel follow, returned as a frozen value
ForumChannelCreate#
Creates a forum channel, which holds posts instead of messages
ForumChannelCreateBase#
Settings shared by new forum and media channels
ForumDefaultReaction#
The reaction that clients show on each post of a forum or media channel
ForumDefaultReactionInput#
The reaction that clients show on each post of a forum or media channel
ForumPost#
A post created with threads.createPost: Its thread and its first message, both frozen
ForumPostCreate#
A new post in a forum or media channel, created with threads.createPost
ForumTag#
A tag that posts in a forum or media channel can carry
ForumTagInput#
Settings of one tag that posts in a forum or media channel can carry
GuildAnnouncementChannel#
A community announcement channel, selected by type === ChannelType.Announcement
GuildAnnouncementThreadChannel#
A thread inside an announcement channel, selected by type === ChannelType.AnnouncementThread
GuildCategoryChannel#
A grouping parent for community channels, selected by type === ChannelType.Category
GuildChannelBase#
Fields every community channel shares, whatever its type
GuildForumChannel#
A forum channel, selected by type === ChannelType.Forum
GuildForumChannelBase#
Fields shared by forum and media channels, which hold posts and no messages of their own
GuildLinkChannel#
A channel that points to an external URL, selected by type === ChannelType.Link
GuildMediaChannel#
A media channel, a forum channel that can hide media download options, selected by type === ChannelType.Media
GuildPrivateThreadChannel#
A private thread inside a text channel, selected by type === ChannelType.PrivateThread
GuildPublicThreadChannel#
A public thread inside a text channel, or a post inside a forum or media channel, selected by type === ChannelType.PublicThread
GuildTextChannel#
A community text conversation, selected by type === ChannelType.Text
GuildTextChannelBase#
Message and topic fields shared by community text and announcement channels
GuildThreadChannelBase#
Fields every thread shares, whatever its type
GuildUnknownChannel#
A community channel of a type this SDK version does not know, such as a type Fluxer adds later, selected by type === "unknown"
GuildVoiceChannel#
A community voice-call channel, selected by type === ChannelType.Voice
LinkChannelCreate#
Create a community channel that points readers to a URL
MediaChannelCreate#
Creates a media channel, a forum channel that can hide media download options
ThreadCreate#
Settings for a new thread in a text or announcement channel, created with threads.create
ThreadEdit#
Change an existing thread or post with threads.edit
ThreadFromMessageCreate#
Settings for a public thread started on an existing message with threads.createFromMessage
ThreadMember#
One member of a thread
ThreadMemberIterationQuery#
Limits and starting point for threads.iterateMembers, reading thread members in ascending user ID order
ThreadMemberPageQuery#
Select one page of thread members, in ascending user ID order
ThreadMemberQuery#
Options for reading one thread member with threads.fetchMember
ThreadMembership#
The bot's own membership in a thread, as Fluxer reports it beside the thread
ThreadParentDefaults#
Default settings for the threads that start inside a text, announcement, forum or media channel
ThreadSearchIndexingPage#
Successful search response while Fluxer still builds the community's search index
ThreadSearchQuery#
Filters and paging for one threads.search request in a text, announcement, forum or media channel
ThreadSearchResultsPage#
Search results once Fluxer's index can answer
ArchivedThreadScope#
Which archived threads threads.fetchArchived lists: Public threads, private threads, or only the private threads the bot joined
ChannelCreate#
One supported community-channel creation request, with Fluxer positioning a new channel itself
ForumPostMessage#
The first message of a forum or media post: The content, embeds, files and stickers of messages.send, with allowedMentions and flags
GuildChannel#
Settings and identity of a community channel returned by a read or gateway event, as one shape per channel type
GuildThreadChannel#
A thread: A channel inside a text, announcement, forum or media channel that holds its own messages
ThreadSearchPage#
Successful outcome of one threads.search request