MatrixSDK.Client.RoomEvent (matrix_sdk v0.2.0) View Source

Convenience functions for building room events.

Link to this section Summary

Functions

Returns a RoomEvent struct of type m.room.message.

Link to this section Types

Specs

content() :: binary() | map()

Specs

event_type() :: :file | :notice | :text

Specs

t() :: %MatrixSDK.Client.RoomEvent{
  content: term(),
  room_id: term(),
  transaction_id: term(),
  type: term()
}

Link to this section Functions

Link to this function

message(room_id, type, content, transaction_id)

View Source

Specs

message(binary(), event_type(), content(), binary()) :: t()

Returns a RoomEvent struct of type m.room.message.

Example

iex> MatrixSDK.Client.RoomEvent.message("!someroom:matrix.org", :text, "Fire! Fire! Fire!", "transaction_id")
%MatrixSDK.Client.RoomEvent{
  content: %{body: "Fire! Fire! Fire!", msgtype: "m.text"},
  type: "m.room.message",
  room_id: "!someroom:matrix.org",
  transaction_id: "transaction_id"
}