Fix passive command regex compiling and send m.notices by default

This commit is contained in:
Tulir Asokan 2018-09-21 16:09:26 +03:00
parent ba6bbead12
commit b805641ea4
4 changed files with 11 additions and 4 deletions

View file

@ -143,11 +143,15 @@ func (client *Client) JoinRoom(roomID string) (resp *gomatrix.RespJoinRoom, err
}
func (client *Client) SendMessage(roomID, text string) (string, error) {
return client.SendContent(roomID, format.RenderMarkdown(text))
content := format.RenderMarkdown(text)
content.MsgType = gomatrix.MsgNotice
return client.SendContent(roomID, content)
}
func (client *Client) SendMessagef(roomID, text string, args ...interface{}) (string, error) {
return client.SendContent(roomID, format.RenderMarkdown(fmt.Sprintf(text, args...)))
content := format.RenderMarkdown(fmt.Sprintf(text, args...))
content.MsgType = gomatrix.MsgNotice
return client.SendContent(roomID, content)
}
func (client *Client) SendContent(roomID string, content gomatrix.Content) (string, error) {