From 87c4335d546908d66ac3ea4297e74227976b860d Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Mon, 8 May 2017 16:58:25 +0100 Subject: [PATCH] Helper function to send html messages --- client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client.go b/client.go index 051c1f8..5caf4b4 100644 --- a/client.go +++ b/client.go @@ -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 // See https://matrix.org/docs/spec/client_server/r0.2.0.html#m-video func (cli *Client) SendVideo(roomID, body, url string) (*RespSendEvent, error) {