On This Page

Users and DMs

9 symbols from @neontechspace/fluxerly/effect

Interfaces#

DirectMessages#

Open private conversations, send messages or manage existing groups

Methods return Effects with the client's default deadline (rest.defaultTimeoutMs, 30,000 ms unless configured) and at most two eligible transient read retries. Writes retry only confirmed rate-limit rejection, never an unknown outcome. No gateway connection is required. Cancellation and unexpected faults remain in Cause rather than becoming UserOperationError

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

close#

Close a one-to-one conversation for this bot, or leave a group conversation

Another recipient's conversation is not erased. If the group owner leaves, ownership may transfer. Enabled cache invalidation normally stays scoped to this conversation. A cache-wide conflict check can also prevent older in-flight results from being stored

close(
    id: string,
    options?: RequestOptions
): Effect<void, UserOperationFailure>close(
  id: string,
  options?: RequestOptions
): Effect<
  void, UserOperationFailure
>

Parameters

id
string
options optional
RequestOptions

editGroup#

Change supplied settings of an existing group conversation

A null name clears it, and omitted fields remain unchanged. Fluxer enforces member and owner permissions. A failed response does not guarantee rollback. Enabled cache invalidation normally stays scoped to this conversation. A cache-wide conflict check can also prevent older in-flight results from being stored

editGroup(
    id: string,
    input: DirectMessageGroupEdit,
    options?: RequestOptions
): Effect<DirectMessageChannel, UserOperationFailure>editGroup(
  id: string,
  input: DirectMessageGroupEdit,
  options?: RequestOptions
): Effect<
  DirectMessageChannel,
  UserOperationFailure
>

Parameters

id
string
options optional
RequestOptions

fetch#

Fetch a private channel by decimal ID

A community-channel response is rejected as invalid. With the direct-message cache enabled, a concurrent fetch of another private channel ID does not keep this result from being stored, unless more than 256 private channel IDs are in flight at once

fetch(
    id: string,
    options?: RequestOptions
): Effect<DirectMessageChannel, UserOperationFailure>fetch(
  id: string,
  options?: RequestOptions
): Effect<
  DirectMessageChannel,
  UserOperationFailure
>

Parameters

id
string
options optional
RequestOptions

fetchAll#

Fetch this bot's currently open one-to-one and group conversations

Personal notes are excluded. The list is neither an atomic snapshot nor complete message history. Enabled cache replacement is skipped when a later targeted request or channel observation conflicts

fetchAll(
    options?: RequestOptions
): Effect<readonly DirectMessageChannel[], UserOperationFailure>fetchAll(
  options?: RequestOptions
): Effect<
  readonly DirectMessageChannel[],
  UserOperationFailure
>

Parameters

options optional
RequestOptions

fetchLatestMessages#

Fetch the latest messages for 1–100 selected, distinct private channel IDs through Fluxer's batch endpoint

IDs are copied by index when execution starts. This does not enumerate conversations or fill a cache. A null entry does not prove an empty channel or denied access. The omittedChannelIds field separately lists requested IDs that Fluxer did not return. Do not treat omission as null, an empty channel or denied access. The batch uses POST and is not retried after a dispatched failure with an unknown outcome, even though it reads data

fetchLatestMessages(
    channelIds: readonly string[],
    options?: RequestOptions
): Effect<DirectMessageLatestMessages<M>, UserOperationFailure>fetchLatestMessages(
  channelIds: readonly string[],
  options?: RequestOptions
): Effect<
  DirectMessageLatestMessages<M>,
  UserOperationFailure
>

Parameters

channelIds
readonly string[]
options optional
RequestOptions

get#

Look up a private channel in the optional cache using its decimal ID, without a request

A hit may be stale and becomes more recently used without extending its age. A miss produces undefined. An invalid ID is misuse: The default API throws UserOperationError with reason input and the native API dies with it. A closing or closed client has no cache, so the result is undefined

get(id: string): Effect<DirectMessageChannel | undefined>get(id: string): Effect<
  DirectMessageChannel | undefined
>

Parameters

id
string
Returns
Effect<DirectMessageChannel | undefined>Effect<
  DirectMessageChannel | undefined
>

open#

Open or reopen a one-to-one conversation with the selected user

The result is a private channel, not proof a message can be delivered. Privacy checks can still prevent sending after opening succeeds. With the direct-message cache enabled, the channel ID is unknown until the response arrives, so some concurrent direct-message cache changes keep the result out of the cache. Examples are a directMessages.fetch call and a direct-message update event. A successful opening replaces only the returned channel's cached snapshot and keeps other cached private channels. A failed opening that was started clears the direct-message cache, because its outcome may be unknown and no channel is known to evict. Invalid input fails before the cache is touched and leaves it intact

open(
    userId: string,
    options?: RequestOptions
): Effect<DirectMessageChannel, UserOperationFailure>open(
  userId: string,
  options?: RequestOptions
): Effect<
  DirectMessageChannel,
  UserOperationFailure
>

Parameters

userId
string
options optional
RequestOptions

removeRecipient#

Remove a group recipient as owner, or remove the bot itself

This does not request deletion of that user's messages. If the last recipient leaves, Fluxer deletes the group. Enabled cache invalidation normally stays scoped to this conversation. A cache-wide conflict check can also prevent older in-flight results from being stored

removeRecipient(
    id: string,
    userId: string,
    options?: RequestOptions
): Effect<void, UserOperationFailure>removeRecipient(
  id: string,
  userId: string,
  options?: RequestOptions
): Effect<
  void, UserOperationFailure
>

Parameters

id
string
userId
string
options optional
RequestOptions

send#

Open or reopen a one-to-one conversation with a user, then send a message

A plain string sends only that text, as shorthand for { content }. The whole operation uses one deadline, and mentions are disabled by default. Message metadata and data bytes are prepared before opening the conversation. File and stream sources are captured, not copied, and read later when uploads start, using messages.send's size, upload-budget and cleanup rules. An inline multipart 429 does not replay file or stream sources. MessageError with outcome notDispatched does not mean opening the conversation was undone. A send with an unknown outcome is never repeated automatically. The opened conversation is cached under the same conditions as open. Reply references are not accepted here. Use messages.reply with an existing channel and message reference

send(
    userId: string,
    input: string | ReplyInput,
    options?: RequestOptions
): Effect<M, SendError>send(
  userId: string,
  input: string | ReplyInput,
  options?: RequestOptions
): Effect<M, SendError>

Parameters

userId
string
input
string | ReplyInput
options optional
RequestOptions
Returns
Effect<M, SendError>
Fails with
TypeScript
import { Effect } from "effect"
import type { Client } from "@neontechspace/fluxerly/effect"
export const notifyUserExample = (client: Client, userId: string) => Effect.gen(function* () {
    const user = yield* client.users.fetch(userId)
    return yield* client.directMessages.send(user.id, { content: `Hello ${user.displayName ?? user.username}` })
})

Users#

Read public account information or a privacy-filtered profile

Methods return Effects with the client's default deadline (rest.defaultTimeoutMs, 30,000 ms unless configured) and at most two eligible transient read retries. Writes retry only confirmed rate-limit rejection, never an unknown outcome. No gateway connection is required. Cancellation and unexpected faults remain in Cause rather than becoming UserOperationError

interface Users

fetch#

Fetch a public account snapshot by decimal user ID

An unknown user fails with reason notFound rather than an empty result. With the user cache enabled, a concurrent fetch of another user ID does not keep this result from being stored, unless more than 256 user IDs are being read at once

fetch(
    id: string,
    options?: RequestOptions
): Effect<User, UserOperationFailure>fetch(
  id: string,
  options?: RequestOptions
): Effect<
  User, UserOperationFailure
>

Parameters

id
string
options optional
RequestOptions

fetchProfile#

Fetch a user's privacy-filtered profile, optionally for the community specified in query.guildId

The frozen result includes only documented identity and profile fields. The isLimited field reports Fluxer's privacy restriction, not missing community membership. A guildProfile of null means no contextual profile was supplied, not proof the user is outside the community. No gateway connection, hidden member fetch or account or profile cache use is performed, and each call issues a separate read. Users' shared deadlines and eligible read retries apply. Fluxer may clear expired premium state while serving this GET. Invalid input, denied access or a malformed response fails with UserOperationError for users.fetchProfile. Cancellation affects this request only and waits for cleanup

fetchProfile(
    id: string,
    query?: UserProfileQuery,
    options?: RequestOptions
): Effect<UserProfile, UserOperationFailure>fetchProfile(
  id: string,
  query?: UserProfileQuery,
  options?: RequestOptions
): Effect<
  UserProfile, UserOperationFailure
>

Parameters

id
string
query optional
UserProfileQuery
options optional
RequestOptions
TypeScript
import type { Client } from "@neontechspace/fluxerly/effect"
export function profileExample(client: Client, userId: string, guildId: string) {
    return client.users.fetchProfile(userId, { guildId })
}

fetchSelf#

Fetch the authenticated bot's public account data remotely

Private account fields are excluded. With the user cache enabled, the bot's ID is unknown until the response arrives, so some concurrent user cache changes keep the result out of the cache. Examples are another users.fetch or users.fetchSelf call, a user update event and a lost gateway connection

fetchSelf(
    options?: RequestOptions
): Effect<User, UserOperationFailure>fetchSelf(
  options?: RequestOptions
): Effect<
  User, UserOperationFailure
>

Parameters

options optional
RequestOptions

get#

Look up a public account in the optional cache using its decimal ID, without a request

A hit may be stale and becomes more recently used without extending its age. A miss produces undefined. An invalid ID is misuse: The default API throws UserOperationError with reason input and the native API dies with it. A closing or closed client has no cache, so the result is undefined

get(id: string): Effect<User | undefined>get(id: string): Effect<
  User | undefined
>

Parameters

id
string
Returns
Effect<User | undefined>

getSelf#

Look up the bot's own public account as the gateway's READY reported it, without a request

The result is undefined until this client's first READY, and also while no READY has carried a complete public account. A later READY with a complete public account, such as for a new session, replaces it, while an incomplete one keeps the previous account. Other user updates and fetchSelf results do not change it, so its username or avatar can be stale. The value remains available after the client stops. This lookup never fails. Use fetchSelf for a current remote snapshot

getSelf(): Effect<User | undefined>
Returns
Effect<User | undefined>

Re-Exports#

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

DirectMessageChannel#
A one-to-one direct message or group conversation outside a community
DirectMessageGroupEdit#
Rename a group conversation, change its icon or nicknames, or transfer its ownership
DirectMessageLatestMessages#
Latest-message lookup results for the selected private channel IDs
User#
Public identity of a Fluxer account, suitable for displaying who sent a message or belongs to a conversation
UserProfile#
Result of users.fetchProfile, combining public identity with the profile information Fluxer allowed this caller to see
UserProfileFields#
Displayable biography, pronouns and visual customization from a profile read
UserProfileQuery#
Choose whether users.fetchProfile also asks for profile customization in one community