matrix_sdk v0.1.0 MatrixSDK.Client.RoomEvent 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

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, body, transaction_id)

View Source

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"
}