Helper function to send html messages

This commit is contained in:
Richard Lewis 2017-05-08 16:58:25 +01:00
parent 462346e69d
commit 87c4335d54
1 changed files with 6 additions and 0 deletions

View File

@ -461,6 +461,12 @@ func (cli *Client) SendImage(roomID, body, url string) (*RespSendEvent, error) {
}) })
} }
// SendHTML sends an m.room.message event into the given room with a msgtype of m.text or / m.notice
// Not currently documented in the matrix.org specs
func (cli *Client) SendHTML(roomID, body, html string, msgType string) (*RespSendEvent, error) {
return cli.SendMessageEvent(roomID, "m.room.message", GetHTMLMessage(msgType, html))
}
// SendVideo sends an m.room.message event into the given room with a msgtype of m.video // SendVideo sends an m.room.message event into the given room with a msgtype of m.video
// See https://matrix.org/docs/spec/client_server/r0.2.0.html#m-video // See https://matrix.org/docs/spec/client_server/r0.2.0.html#m-video
func (cli *Client) SendVideo(roomID, body, url string) (*RespSendEvent, error) { func (cli *Client) SendVideo(roomID, body, url string) (*RespSendEvent, error) {