On This Page

Options

20 symbols from @neontechspace/fluxerly/effect

Interfaces#

AuditedRequestOptions#

Settings for a remote mutation that Fluxer can record in the community audit log: Its deadline and an optional reason

interface AuditedRequestOptions extends RequestOptionsinterface AuditedRequestOptions
  extends RequestOptions
auditReason optional#

Optional audit-log reason, 1–512 printable ASCII characters after trimming

Sent only as the raw X-Audit-Log-Reason header, without URL escaping, because Fluxer does not decode escapes. Non-ASCII and control characters fail before dispatch. Omission sends no header. Never included in SDK errors or diagnostics. Header delivery does not guarantee that Fluxer stores the reason in an audit entry. Methods name the known paths that do not

string

Inherited from RequestOptions: timeoutMs

CanManageOptions#

Settings for members.fetchCanManage: Whose rank to check, and the shared deadline of its reads

interface CanManageOptions extends RequestOptionsinterface CanManageOptions
  extends RequestOptions
actorUserId optional#

User ID of the member whose rank is checked against the target, such as the moderator who ran a command

Omit to check the bot itself. The actor must be a member of the target's community, or the read fails with notFound

string

Inherited from RequestOptions: timeoutMs

ClientOptions#

Choose the client's connection, logging, message fields, failure hook and optional caches

The createClient function reads these options when its Effect executes, not when the Effect is built. Required services for the onError hook are captured at that time. The sharding option chooses which gateway shards this client owns. Automatic sharding, and a client without sharding settings, may move to a larger plan while the client runs. Shard zero receives direct-message traffic. HTTP and cache budgets apply to the whole client, not separately to each shard. The messageFields option chooses which optional message fields are returned, including nested results, callbacks and cached messages. Omission returns full Message objects. The selection cannot change after client creation. TypeScript usually infers the type parameters from these options. If supplying error and service types E and R explicitly with messageFields, also supply the selected-field tuple as F

interface ClientOptions<
    E = never,
    R = never,
    F extends MessageFields | undefined = undefined
>
    extends Omit<
        SharedClientOptions<F>,
        "cache" | "logging" | "onError" | "connection"
    >interface ClientOptions<
  E = never,
  R = never,
  F extends
    | MessageFields | undefined
    = undefined
>
  extends Omit<
    SharedClientOptions<F>,
    | "cache" | "logging"
    | "onError" | "connection"
  >
cache optional#

Optionally keep resource snapshots in memory

Omission keeps none. Every configured budget applies across this client's locally owned shards. A gateway gap invalidates known-scope snapshots from its affected shard. Unknown community scope invalidates conservatively because the SDK keeps no channel-to-community index

channels optional

Cache community channels and threads from explicit reads and channel and thread events, without automatically listing them

A guild create event replaces this community's cached channels and threads with the channels and active threads the bot can view. Once a channel mutation is dispatched, the SDK removes the cached channels it can affect and prevents pending reads from restoring them. That is the written channel, with its threads when the mutation 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, or this community's channels for a category or a community-wide mutation such as create or reorder, or every cached channel when the cache does not hold the written channel. An operation confined to one thread removes only that thread. Bulk ordering events clear this community's cached channels because permission updates may still be in progress. Category updates or deletions also clear this community's channels because children can inherit changed permissions. Visibility loss clears the affected channel, and for a text, announcement, forum or media channel also its threads, because Fluxer deletes them without thread deletion events. A text or announcement channel update clears that channel's cached threads whose type its type cannot hold, because Fluxer retypes a converted channel's threads without thread events for archived ones. A forum or media channel update clears that channel's cached posts that apply a tag missing from the update, because Fluxer removes a tag through the channel update alone. Either update also stops pending reads from storing that channel's threads. Other pending reads by ID, and reads of other communities, still store what they return, while a pending read of the channel's own community stores nothing, as after any channel update. Thread create and update events store the thread, a thread deletion clears it, and a thread list replaces the cached threads of its community or of its listed parent channels. A change to the bot's own membership of a thread clears that thread, because its membership field is then out of date. A full list removes missing channels, never threads, only when no conflicting observation overlaps the read. These snapshots are not a complete copy of the community's channels or threads

boolean | ResourceCacheSettings<GuildChannel>| boolean
| ResourceCacheSettings<GuildChannel>
directMessages optional

Cache private conversations from explicit reads and complete channel events, without automatically listing them

A local lookup makes the item less likely to be removed for capacity, but does not extend its age limit. Targeted reads, mutations and channel events conflict only for the same conversation. Full-list reads, opening by user ID, account updates, connection gaps, clear and shutdown can prevent older responses from restoring the whole category

boolean | ResourceCacheSettings<DirectMessageChannel>| boolean
| ResourceCacheSettings<
    DirectMessageChannel
  >
emojis optional

Cache emoji metadata from REST reads and writes, not image bytes or creator accounts

A guild create event replaces this community's cached emojis with its complete list, and other community expression events clear observations. ResourceCacheSettings controls bounds and expiry, while gaps and shutdown release snapshots

boolean | ResourceCacheSettings<GuildEmoji>| boolean
| ResourceCacheSettings<GuildEmoji>
guilds optional

Cache community details from explicit reads and guild create or update events, without preloading members

Community removal or unavailability clears this community's cached resources, including channels

boolean | ResourceCacheSettings<Guild>
members optional

Cache individual memberships from explicit reads, REST pages, member add or update events and the members a guild create event lists, which are the bot's own and those in voice channels

The guild create events sent while a session starts list member accounts by ID only, so only the bot's own member, completed from READY's account, is stored from them. The member that Fluxer attaches to message create and update, reaction add and remove, and typing events refreshes it too, because Fluxer reads that member from the community's current state when it dispatches the event. It is stored whatever messageFields selects. A reaction or typing member that arrives without the user's name is completed from the member already cached before it is stored. When the member of such an event does not decode, or the whole event is rejected as malformed, the account's cached member is removed because the cached copy may now be stale. When a rejected event does not identify the account, the community's cached members are removed, and when it does not identify the community either, every cached member is. A member that fails to decode logs gateway.memberSkipped. A voice state's member is never stored, because it can lag behind role edits. The cache only receives these when Fluxer sends the events, so enabling it requests no extra dispatches and a bot that receives no such events fills it from reads alone. Member removal clears that membership. Successful or uncertain role assignment clears the target

boolean | ResourceCacheSettings<GuildMember>| boolean
| ResourceCacheSettings<GuildMember>
messages optional

Omit or pass false to disable caching

Pass true or an options object to keep bounded message snapshots in memory across the client. Eligible HTTP responses and gateway events populate the cache. Deletes and writes with unknown outcomes evict affected messages. Gateway gaps clear it even after successful resume. Conflicts can produce misses. A response that differs from an overlapping event only by lacking its community ID keeps the event snapshot. No automatic history retrieval. Shutdown releases cached references

boolean | MessageCacheOptions<NoInfer<SelectedMessage<F>>>| boolean
| MessageCacheOptions<
    NoInfer<SelectedMessage<F>>
  >
roles optional

Cache role definitions from explicit list, create or edit results and role events

Successful or uncertain creation or reordering clears this community's cached roles. Edits clear their target, or all this community's roles when changing hoistPosition. Role deletion also clears cached memberships because assignments can change without individual member events. A full list removes missing roles only when no conflicting observation overlaps the read. Partial bulk events replace only the roles they supply. A guild create event replaces this community's cached roles with its complete role list. The roles.getAll method returns a community's roles only while that list is known complete, which a full list read establishes only while the community's shard is connected. The entry limit counts the roles of every community together, so complete lists for many communities need a larger maxEntries. The cache counts bigint permission fields as decimal strings when measuring bytes

boolean | ResourceCacheSettings<GuildRole>| boolean
| ResourceCacheSettings<GuildRole>
stickers optional

Cache sticker metadata, with the same bounds, expiry and invalidation rules as emojis

boolean | ResourceCacheSettings<GuildSticker>| boolean
| ResourceCacheSettings<GuildSticker>
users optional

Cache public account profiles from explicit reads and complete user events, not partial message authors

A local lookup makes the item less likely to be removed for capacity, but does not extend its age limit. Targeted reads conflict only with later observations of the same account, so unrelated IDs can both populate. Reads without a target ID, lost gateway connections, clear and shutdown can prevent older responses from restoring the whole category

boolean | ResourceCacheSettings<User>
connection optional#

Set the startup deadline, retry limit and recovery timing, as in the default entry point

Native recovery can also take an Effect Schedule that decides established-session recovery delays

maxStartupAttempts optional

Maximum attempts to start each local shard, including its first attempt, as a positive safe integer

The SDK retries only failures it classifies as transient, and the overall deadline can stop retries sooner. This does not limit recovery attempts after a session has become ready

number
recovery optional

Recovery timing for established sessions, with the same settings as the default entry point plus schedule

& ConnectionRecoveryOptions
& {
      readonly schedule?:
          Schedule<unknown, ConnectionFailure, never, never>
  }& ConnectionRecoveryOptions
& {
    readonly schedule?: Schedule<
      unknown, ConnectionFailure,
      never, never
    >
  }
startupTimeoutMs optional

Total milliseconds allowed for startup, including instance discovery, retries and every local shard becoming ready

Must be an integer from 1 through 2,147,483,647. When this client owns several shards, the SDK spaces their new-session Identify commands by one second and adds one second to this deadline for each shard after the first, so the spacing alone never causes a timeout. The spacing does not coordinate quotas across processes or an IP address. An identify coordinator replaces it, and the coordinator's waits count against this deadline. Automatic sharding counts the bot's communities under a separate deadline of the same length before the shards start. Expiry stops startup work, while completion still waits for the SDK's owned-resource cleanup

number
logging optional#

Configure what the SDK logs, with the same settings as the default entry point

Without sink or format, records go through the caller's Effect logger with Effect.logWithLevel, the real Cause and fluxerly.* annotations such as fluxerly.code and fluxerly.category, so any Effect Logger, span and tracer applies. Debug and Trace records enabled by these settings bypass the Effect minimum log level, while Info and higher records respect it. Connection records use connect or run's services, handler records use registration services and shutdown records use shutdown's services. A sink or an explicit format replaces the Effect logger with the SDK's own output

LoggingOptions
TypeScript
import { Effect, Logger } from "effect"
import { createClient } from "@neontechspace/fluxerly/effect"
export function loggingExample(token: string) {
    return createClient({ token, logging: { categories: { rest: "debug" } } }).pipe(
        Effect.withLogger(Logger.consoleJson),
    )
}
messageFields optional#

Choose which optional message fields the application receives

Omit this setting for full Message output. An empty array keeps id, channelId, content, author, type and guildId, where the last two are kept when the response supplies them

F

Excluded fields are absent, not undefined or empty arrays, in this client's REST, event, cache and collector results

Selecting a field includes its nested values. For example, messageSnapshots keeps its own media even when top-level media fields are excluded

This reduces the objects the SDK builds locally, not network payloads or data stored by Fluxer. The SDK still rejects malformed recognized response fields, even when they are excluded

Unknown field names and non-arrays fail with ConfigurationError whose field is messageFields. Including core field names is allowed and does not change the required core

TypeScript knows the exact selection when given a literal tuple. For an array whose contents are unknown, optional fields remain optional. The copied selection lasts for this client's lifetime and does not affect separately created webhook clients or other resource types

import { createClient } from "@neontechspace/fluxerly"
export function selectedMessagesExample(token) {
    return createClient({ token, messageFields: ["attachments", "messageReference"] })
}
import { createClient } from "@neontechspace/fluxerly"
export function selectedMessagesExample(token: string) {
    return createClient({ token, messageFields: ["attachments", "messageReference"] })
}
onError optional#

Receive every failure that has no returned result, with the original error and its complete Cause

The hook runs with the services available when client creation executes, one report at a time in order. Up to 256 reports wait while it is busy, and later ones are logged instead, with fields.reportOutcome "queueFull", and counted in diagnostics().counters.reportsDropped. A subscription's own onError takes precedence. Without a hook the SDK logs each failure at Error with its full Cause. A failing hook is logged with the original failure and never retried. Shutdown interrupts a running hook and waits at most one second for its cleanup, so a hook that ignores interruption cannot hold shutdown open. The interrupted report and any queued ones are logged at Error, with fields.reportOutcome "interrupted" for the report being handled and "clientClosed" for queued or later reports. A hook that interrupts itself also logs its report with "interrupted", and later reports still reach the hook

(report: FailureReport) => Effect<unknown, E, R>(report: FailureReport)
  => Effect<unknown, E, R>
uploads optional#

Bound the attachment transfer bytes reserved by queued and active upload operations

maxBytes optional

Maximum reserved attachment transfer bytes across queued and active operations, as a positive safe integer

Defaults to 104,857,600 (100 MiB), separate from the rest.queuedJsonMaxBytes queued JSON budget (4 MiB by default). The SDK reserves accepted byte-array lengths, file sizes or declared stream sizes before waiting for a request slot. A new operation fails with busy if its reservation would exceed this limit. Reservations remain held across rate-limit retries and release after transport cleanup. This excludes caller buffers, metadata and runtime overhead, so it is not a JavaScript heap or process-memory ceiling

number

Inherited from ClientOptions: gateway, instance, observe, rest, sharding, token, transport

ExpressionDeleteOptions#

Choose whether deleting a community emoji or sticker also requests removal of its image asset

The inherited timeout and auditReason follow AuditedRequestOptions. Removing the image is a separate queued job. Deleting the community entry does not wait for it to finish

interface ExpressionDeleteOptions extends AuditedRequestOptionsinterface ExpressionDeleteOptions
  extends AuditedRequestOptions
purge optional#

False/default removes the community entry without asking to purge its image

True additionally requests irreversible queued asset/CDN removal and requires Fluxer's expression-purge feature. HTTP success does not mean the purge job has finished. Failure after dispatch can leave either effect applied

boolean

Inherited from AuditedRequestOptions: auditReason, timeoutMs

OwnMessageDeletionOptions#

Required confirmation and deadline for deleting this bot's entire authored history in a channel or community

The confirm field must be the literal true, so an accidental call without it fails before any request with reason input and inputValidation path options.confirm

interface OwnMessageDeletionOptions extends RequestOptionsinterface OwnMessageDeletionOptions
  extends RequestOptions
confirm#

Must be true to acknowledge that the deletion is irreversible and cannot be rolled back

true

Inherited from RequestOptions: timeoutMs

PermissionFetchOptions#

Settings for permissions.fetch: The shared deadline of its reads, and whether enabled caches may replace them

interface PermissionFetchOptions extends RequestOptionsinterface PermissionFetchOptions
  extends RequestOptions
preferCache optional#

Read each observation from an enabled cache before fetching it, such as to decide for every command without a request

Default false, which fetches every observation fresh. The guild, member and channel come from their caches when present, and the roles when the everyone role and every member role are all cached, otherwise one list read replaces all of them. A cached channel without its overwrite list is fetched, and a thread's parent channel is read the same way. Only fetches count toward the deadline. Cached observations reflect the last applied gateway events, so they can differ from Fluxer, and their snapshots can come from different moments. Cached entries stay while a shard can resume and are cleared when a new session starts, after which they are fetched. Use the default right before an action where a stale grant matters. With the caches disabled, the call behaves as it does by default. A value that is not a boolean fails with reason input

boolean

Inherited from RequestOptions: timeoutMs

RequestOptions#

Settings for one remote operation: Its deadline

Methods document what their deadline covers beyond these rules. Effect operations are cancelled by interrupting their fiber

interface RequestOptions
timeoutMs optional#

Total milliseconds for this call, an integer from 1 through 2,147,483,647

For a bot client's REST calls it covers local queueing, rate-limit waits, retries and HTTP, and defaults to the client's rest.defaultTimeoutMs, 30,000 unless configured. Calls outside a bot client's REST settings, such as standalone webhook clients, OAuth, instance discovery and gateway counts, default to 30,000. Owned cleanup is awaited afterward, so the call can finish later than this deadline

number

TimeoutOptions#

Timeout-only request settings

A timeoutReason is provider audit metadata, not a stored GuildMember field

interface TimeoutOptions extends AuditedRequestOptionsinterface TimeoutOptions
  extends AuditedRequestOptions
timeoutReason optional#

Optional timeout audit metadata

Null or omission sends no meaningful reason. A string must contain 1–512 UTF-16 code units after U+000C and U+202E removal and surrounding-whitespace trimming. The original string is sent unchanged

string | null

Inherited from AuditedRequestOptions: auditReason, timeoutMs

WebhookMessageOperationOptions#

Request settings for fetching, editing or deleting a message that a webhook client sent

interface WebhookMessageOperationOptions extends RequestOptionsinterface WebhookMessageOperationOptions
  extends RequestOptions
threadId optional#

Decimal ID of the thread that holds the message, sent as the thread_id query parameter

Set it for a message in a thread, because Fluxer looks in the webhook's channel otherwise and answers that the message is unknown. Fluxer rejects a thread that belongs to another channel

string

Inherited from RequestOptions: timeoutMs

Re-Exports#

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

ConnectionRecoveryOptions#
Retry timing for shards that lost an established session
GatewayOptions#
Optional gateway settings: Malformed-dispatch handling and the fields sent in each new session's Identify
InstanceOptions#
Connect a client to a selected Fluxer server instead of the hosted default
OperationSignal#
The AbortSignal members used by default-API operations
PaginationQuery#
Read a Fluxer list one page at a time through an iterator or Effect Stream
RestOptions#
Tune how many REST requests one client runs and queues, and the deadline an operation gets when it omits timeoutMs
RunBotOptions#
Configure how runBot stops
TransportOptions#
Replace the HTTP and WebSocket implementations one client uses, or the User-Agent it sends
WebSocketLike#
The subset of a ws WebSocket that the gateway uses
WebSocketOptions#
Options the gateway passes to a custom WebSocket factory for each connection it opens