Polyjuice Client v0.3.1 Polyjuice.Client.LowLevel View Source
A lower-level client than Polyjuice.Client
.
Compared to Polyjuice.Client
, this module:
- does not manage the access token, user ID, or device ID; whenever these change (e.g. after logging in), the application must create a new client to use the new values
- does not provide a process for syncing with the server
- does not ensure that room requests (such as sending messages) are run in a queue
- does not start any processes
This module would be suitable, for example, for a bot that only sends messages and does not respond to messages.
Link to this section Summary
Link to this section Types
Link to this section Functions
Create a client.
opts
may contain:
access_token
: (required to make calls that require authorization) the access token to use.user_id
: (required by some endpoints) the ID of the userdevice_id
: the device IDstorage
: (required by sync) the storage backend to use (seePolyjuice.Client.Storage
)
Log in with a password.
identifier
may be a single string (in which case it represents a username
-- either just the localpart or the full MXID), a tuple of the form
{:email, "email@address"}
, a tuple of the form {:phone, "country_code", "phone_number"}
, or a map that is passed directly to the login endpoint.
opts
is a keyword list of options:
device_id:
(string) the device ID to useinitial_device_display_name:
(string) the display name to use for the device
Link to this function
log_out(client)
View Sourcelog_out(client :: Polyjuice.Client.LowLevel.t()) :: :ok | any()
Log out an existing session.