MatrixAppService.Client (MatrixAppService v0.1.0) View Source
Convenience wrapper around Polyjuice.Client.LowLevel.
Library users can use the wrapped functions or call user/1 and pass the
returned struct to Polyjuice functions.
Link to this section Summary
Functions
Returns a client for the application service.
Creates a new alias for a Matrix room.
Creates a Matrix room.
Registers a new Matrix user.
Sends a message to a Matrix room.
Link to this section Types
Specs
client_options() ::
{:base_url, String.t()} | MatrixAppService.Client.LowLevel.create_opts()
Link to this section Functions
Specs
client([client_options()]) :: Polyjuice.Client.LowLevel.t()
Returns a client for the application service.
By default, the client gets its homeserver URL and access token from configuration. Different options can be provided to override the defaults, those are:
:base_url: homerver URL:acces_token: access token:device_id: device ID:user_id: user ID:storage: aPolyjuice.Client.Storage.t/0
Specs
create_alias(String.t(), String.t(), client_options()) :: {:ok, String.t()} | Any
Creates a new alias for a Matrix room.
Arguments:
room_id: room IDroom_alias: room aliasclient_options: seeclient/1
Creates a Matrix room.
Arguments:
options: seePolyjuice.Client.Room.create_room/2client_options: seeclient/1
Specs
register(Polyjuice.Client.LowLevel.register_opts(), client_options()) :: {:ok, String.t()} | Any
Registers a new Matrix user.
Arguments:
opts: a keyword list that can contain these keys::inhibit_login: true:device_id: device ID, defaults to"APP_SERVICE":initial_device_display_name: device name, defaults to"ApplicationService":kind: kind of account to register, defaults to"user", can also be"guest"
client_options: seeclient/1
Specs
send_message(String.t(), String.t(), client_options()) :: {:ok, String.t()} | Any
Sends a message to a Matrix room.
Arguments:
room_id: room IDmsg: seePolyjuice.Client.Room.send_message/3client_options: seeclient/1