BaileysEx.Feature.Chat (baileys_ex v0.1.0-alpha.8)

Copy Markdown View Source

Chat-level operations backed by app-state patches.

Summary

Functions

Archive or unarchive a chat using the Baileys archive patch shape.

Clear a chat history using the last-message range required by Syncd.

Delete a chat using the last-message range required by Syncd.

Mark a chat read or unread.

Mute a chat until the given Unix timestamp, or pass nil to unmute.

Pin or unpin a chat.

Star or unstar one or more messages in a chat.

Toggle the privacy setting that disables link previews server-side.

Functions

archive(conn, jid, archive?, last_messages)

@spec archive(term(), String.t(), boolean(), list()) ::
  {:ok, map()} | {:error, term()}

Archive or unarchive a chat using the Baileys archive patch shape.

clear(conn, jid, last_messages)

@spec clear(term(), String.t(), list()) :: {:ok, map()} | {:error, term()}

Clear a chat history using the last-message range required by Syncd.

delete(conn, jid, last_messages)

@spec delete(term(), String.t(), list()) :: {:ok, map()} | {:error, term()}

Delete a chat using the last-message range required by Syncd.

delete_message_for_me(conn, jid, message_key, timestamp, delete_media? \\ false)

@spec delete_message_for_me(term(), String.t(), map(), integer(), boolean()) ::
  {:ok, map()} | {:error, term()}

Delete a specific message for the current device.

mark_read(conn, jid, read?, last_messages)

@spec mark_read(term(), String.t(), boolean(), list()) ::
  {:ok, map()} | {:error, term()}

Mark a chat read or unread.

mute(conn, jid, duration)

@spec mute(term(), String.t(), integer() | nil) :: {:ok, map()} | {:error, term()}

Mute a chat until the given Unix timestamp, or pass nil to unmute.

pin(conn, jid, pin?)

@spec pin(term(), String.t(), boolean()) :: {:ok, map()} | {:error, term()}

Pin or unpin a chat.

star(conn, jid, messages, star?)

@spec star(term(), String.t(), [map()], boolean()) :: {:ok, map()} | {:error, term()}

Star or unstar one or more messages in a chat.