Fix possible panics (matrix). Closes #333

This commit is contained in:
Wim 2018-01-09 23:25:58 +01:00
parent ee87626a93
commit 8830a5a1df
1 changed files with 6 additions and 0 deletions

View File

@ -91,6 +91,9 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) {
if msg.Event == config.EVENT_USER_ACTION {
resp, err := b.mc.SendMessageEvent(channel, "m.room.message",
matrix.TextMessage{"m.emote", msg.Username + msg.Text})
if err != nil {
return "", err
}
return resp.EventID, err
}
@ -132,6 +135,9 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) {
}
resp, err := b.mc.SendText(channel, msg.Username+msg.Text)
if err != nil {
return "", err
}
return resp.EventID, err
}