Enum gm_types::messages::Message
[−]
[src]
pub enum Message { Text { body: String, formatted_body: Option<String>, format: Option<String>, }, Notice { body: String, formatted_body: Option<String>, format: Option<String>, }, Image { body: String, url: String, info: Option<ImageInfo>, thumbnail_url: Option<String>, thumbnail_info: Option<ImageInfo>, }, Emote { body: String, }, File { body: String, filename: String, info: Option<FileInfo>, thumbnail_info: Option<ImageInfo>, thumbnail_url: Option<String>, url: String, }, Location { body: String, geo_uri: String, }, Audio { body: String, url: String, info: Option<AudioInfo>, }, Video { body: String, url: String, info: Option<VideoInfo>, }, }
A message sent to a room.
Variants
Text
This message is the most basic message and is used to represent text.
Fields of Text
body: String | The body of the message. |
formatted_body: Option<String> | The formatted body of the message (if the message is formatted). |
format: Option<String> | The format of the formatted body (if the message is formatted). |
Notice
A m.notice message should be considered similar to a plain m.text message except that clients should visually distinguish it in some way. It is intended to be used by automated clients, such as bots, bridges, and other entities, rather than humans. Additionally, such automated agents which watch a room for messages and respond to them ought to ignore m.notice messages. This helps to prevent infinite-loop situations where two automated clients continuously exchange messages, as each responds to the other.
Fields of Notice
body: String | The notice text to send. |
formatted_body: Option<String> | The formatted body of the message (if the message is formatted). |
format: Option<String> | The format of the formatted body (if the message is formatted). |
Image
This message represents a single image and an optional thumbnail. Information about an image and it's thumbnail.
Fields of Image
body: String | A textual representation of the image. This could be the alt text of the image, the filename of the image, or some kind of content description for accessibility e.g. 'image attachment'. |
url: String | The URL to the image. |
info: Option<ImageInfo> | Metadata about the image referred to in url. |
thumbnail_url: Option<String> | The URL to the thumbnail of the image. |
thumbnail_info: Option<ImageInfo> | Metadata about the image referred to in thumbnail_url. |
Emote
This message is similar to m.text except that the sender is 'performing' the action contained in the body key, similar to /me in IRC. This message should be prefixed by the name of the sender. This message could also be represented in a different colour to distinguish it from regular m.text messages.
Fields of Emote
body: String | The emote action to perform. |
File
This message represents a generic file.
Fields of File
body: String | A human-readable description of the file. This is recommended to be the filename of the original upload. |
filename: String | The original filename of the uploaded file. |
info: Option<FileInfo> | Information about the file referred to in url. |
thumbnail_info: Option<ImageInfo> | Metadata about the image referred to in thumbnail_url. |
thumbnail_url: Option<String> | The URL to the thumbnail of the file. |
url: String | The URL to the file. |
Location
This message represents a real-world location.
Fields of Location
body: String | A description of the location e.g. 'Big Ben, London, UK', or some kind of content description for accessibility e.g. 'location attachment'. |
geo_uri: String | A geo URI representing this location. |
Audio
This message represents a single audio clip.
Fields of Audio
body: String | A description of the audio e.g. 'Bee Gees - Stayin' Alive', or some kind of content description for accessibility e.g. 'audio attachment'. |
url: String | The URL to the audio clip. |
info: Option<AudioInfo> | Metadata for the audio clip referred to in url. |
Video
This message represents a single video clip.
Fields of Video
body: String | A description of the video e.g. 'Gangnam style', or some kind of content description for accessibility e.g. 'video attachment'. |
url: String | The URL to the video clip. |
info: Option<VideoInfo> | Metadata about the video clip referred to in url. |