Caridina::Connection
Inherits Caridina::Modules::Typing < Caridina::Modules::Receipts < Caridina::ConnectionInterface < Reference < Object
A Matrix connection.
This is the main entrypoint for this library. You will find here all methods to interact with the Matrix API.
Those methods handle retrying when the connection is
being rate limited.
If there is another error, an ExecError while be returned.
Constants
Constructors
Class methods
Instance methods
Creates a sync filter and returns its id.
The filter parameter must be a JSON serializable object.
TODO: This should be implement with a proper model object.
Edits a message.
Only m.text messages are supported for now.
Sends a message to a given room.
Only m.text messages are supported for now.
Starts syncing.
This method starts a new fiber wich will run sync queries, and send received events in channel.
It uses a filter to limit the received events to supported ones.
When called, it will first do an inital sync. This first sync may return events you already seen in a previous sync. You should handle this in your code, either by skipping the first sync or by storing the id of the events you processed.
TODO: accept an next_batch parameter to skip the initial sync.
Returns the connected account's user_id.
You probably should use user_id which already store that information.