mx_messages: Fetch historical messages from a room

View source: R/messages.R

mx_messagesR Documentation

Fetch historical messages from a room

Description

Thin wrapper over the /rooms/{id}/messages endpoint.

Usage

mx_messages(session, room_id, from = NULL, dir = "b", limit = 50L)

Arguments

session

An "mx_session" object.

room_id

Character. The room ID.

from

Character or NULL. Pagination token; NULL starts at the most recent message.

dir

Character. "b" (backwards, default) or "f" (forwards).

limit

Integer. Maximum events to return.

Value

A list with fields chunk, start, end.

Examples

## Not run: 
mx_messages(s, "!abc:matrix.example", limit = 20L)

## End(Not run)

mx.api documentation built on Sept. 12, 2026, 1:07 a.m.